diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/enums.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/enums.go new file mode 100644 index 000000000000..c5d9c68dc2fa --- /dev/null +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/enums.go @@ -0,0 +1,261 @@ +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// Action enumerates the values for action. +type Action string + +const ( + // Allow ... + Allow Action = "Allow" +) + +// PossibleActionValues returns an array of possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{Allow} +} + +// DefaultAction enumerates the values for default action. +type DefaultAction string + +const ( + // DefaultActionAllow ... + DefaultActionAllow DefaultAction = "Allow" + // DefaultActionDeny ... + DefaultActionDeny DefaultAction = "Deny" +) + +// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. +func PossibleDefaultActionValues() []DefaultAction { + return []DefaultAction{DefaultActionAllow, DefaultActionDeny} +} + +// ImportMode enumerates the values for import mode. +type ImportMode string + +const ( + // Force ... + Force ImportMode = "Force" + // NoForce ... + NoForce ImportMode = "NoForce" +) + +// PossibleImportModeValues returns an array of possible values for the ImportMode const type. +func PossibleImportModeValues() []ImportMode { + return []ImportMode{Force, NoForce} +} + +// PasswordName enumerates the values for password name. +type PasswordName string + +const ( + // Password ... + Password PasswordName = "password" + // Password2 ... + Password2 PasswordName = "password2" +) + +// PossiblePasswordNameValues returns an array of possible values for the PasswordName const type. +func PossiblePasswordNameValues() []PasswordName { + return []PasswordName{Password, Password2} +} + +// PolicyStatus enumerates the values for policy status. +type PolicyStatus string + +const ( + // Disabled ... + Disabled PolicyStatus = "disabled" + // Enabled ... + Enabled PolicyStatus = "enabled" +) + +// PossiblePolicyStatusValues returns an array of possible values for the PolicyStatus const type. +func PossiblePolicyStatusValues() []PolicyStatus { + return []PolicyStatus{Disabled, Enabled} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Canceled ... + Canceled ProvisioningState = "Canceled" + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} +} + +// RegistryUsageUnit enumerates the values for registry usage unit. +type RegistryUsageUnit string + +const ( + // Bytes ... + Bytes RegistryUsageUnit = "Bytes" + // Count ... + Count RegistryUsageUnit = "Count" +) + +// PossibleRegistryUsageUnitValues returns an array of possible values for the RegistryUsageUnit const type. +func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { + return []RegistryUsageUnit{Bytes, Count} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // Basic ... + Basic SkuName = "Basic" + // Classic ... + Classic SkuName = "Classic" + // Premium ... + Premium SkuName = "Premium" + // Standard ... + Standard SkuName = "Standard" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{Basic, Classic, Premium, Standard} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // SkuTierBasic ... + SkuTierBasic SkuTier = "Basic" + // SkuTierClassic ... + SkuTierClassic SkuTier = "Classic" + // SkuTierPremium ... + SkuTierPremium SkuTier = "Premium" + // SkuTierStandard ... + SkuTierStandard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierClassic, SkuTierPremium, SkuTierStandard} +} + +// TokenCertificateName enumerates the values for token certificate name. +type TokenCertificateName string + +const ( + // Certificate1 ... + Certificate1 TokenCertificateName = "certificate1" + // Certificate2 ... + Certificate2 TokenCertificateName = "certificate2" +) + +// PossibleTokenCertificateNameValues returns an array of possible values for the TokenCertificateName const type. +func PossibleTokenCertificateNameValues() []TokenCertificateName { + return []TokenCertificateName{Certificate1, Certificate2} +} + +// TokenPasswordName enumerates the values for token password name. +type TokenPasswordName string + +const ( + // TokenPasswordNamePassword1 ... + TokenPasswordNamePassword1 TokenPasswordName = "password1" + // TokenPasswordNamePassword2 ... + TokenPasswordNamePassword2 TokenPasswordName = "password2" +) + +// PossibleTokenPasswordNameValues returns an array of possible values for the TokenPasswordName const type. +func PossibleTokenPasswordNameValues() []TokenPasswordName { + return []TokenPasswordName{TokenPasswordNamePassword1, TokenPasswordNamePassword2} +} + +// TokenStatus enumerates the values for token status. +type TokenStatus string + +const ( + // TokenStatusDisabled ... + TokenStatusDisabled TokenStatus = "disabled" + // TokenStatusEnabled ... + TokenStatusEnabled TokenStatus = "enabled" +) + +// PossibleTokenStatusValues returns an array of possible values for the TokenStatus const type. +func PossibleTokenStatusValues() []TokenStatus { + return []TokenStatus{TokenStatusDisabled, TokenStatusEnabled} +} + +// TrustPolicyType enumerates the values for trust policy type. +type TrustPolicyType string + +const ( + // Notary ... + Notary TrustPolicyType = "Notary" +) + +// PossibleTrustPolicyTypeValues returns an array of possible values for the TrustPolicyType const type. +func PossibleTrustPolicyTypeValues() []TrustPolicyType { + return []TrustPolicyType{Notary} +} + +// WebhookAction enumerates the values for webhook action. +type WebhookAction string + +const ( + // ChartDelete ... + ChartDelete WebhookAction = "chart_delete" + // ChartPush ... + ChartPush WebhookAction = "chart_push" + // Delete ... + Delete WebhookAction = "delete" + // Push ... + Push WebhookAction = "push" + // Quarantine ... + Quarantine WebhookAction = "quarantine" +) + +// PossibleWebhookActionValues returns an array of possible values for the WebhookAction const type. +func PossibleWebhookActionValues() []WebhookAction { + return []WebhookAction{ChartDelete, ChartPush, Delete, Push, Quarantine} +} + +// WebhookStatus enumerates the values for webhook status. +type WebhookStatus string + +const ( + // WebhookStatusDisabled ... + WebhookStatusDisabled WebhookStatus = "disabled" + // WebhookStatusEnabled ... + WebhookStatusEnabled WebhookStatus = "enabled" +) + +// PossibleWebhookStatusValues returns an array of possible values for the WebhookStatus const type. +func PossibleWebhookStatusValues() []WebhookStatus { + return []WebhookStatus{WebhookStatusDisabled, WebhookStatusEnabled} +} diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go index 5c39c5a89614..7801b510b4a9 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/models.go @@ -31,249 +31,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01-preview/containerregistry" -// Action enumerates the values for action. -type Action string - -const ( - // Allow ... - Allow Action = "Allow" -) - -// PossibleActionValues returns an array of possible values for the Action const type. -func PossibleActionValues() []Action { - return []Action{Allow} -} - -// DefaultAction enumerates the values for default action. -type DefaultAction string - -const ( - // DefaultActionAllow ... - DefaultActionAllow DefaultAction = "Allow" - // DefaultActionDeny ... - DefaultActionDeny DefaultAction = "Deny" -) - -// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. -func PossibleDefaultActionValues() []DefaultAction { - return []DefaultAction{DefaultActionAllow, DefaultActionDeny} -} - -// ImportMode enumerates the values for import mode. -type ImportMode string - -const ( - // Force ... - Force ImportMode = "Force" - // NoForce ... - NoForce ImportMode = "NoForce" -) - -// PossibleImportModeValues returns an array of possible values for the ImportMode const type. -func PossibleImportModeValues() []ImportMode { - return []ImportMode{Force, NoForce} -} - -// PasswordName enumerates the values for password name. -type PasswordName string - -const ( - // Password ... - Password PasswordName = "password" - // Password2 ... - Password2 PasswordName = "password2" -) - -// PossiblePasswordNameValues returns an array of possible values for the PasswordName const type. -func PossiblePasswordNameValues() []PasswordName { - return []PasswordName{Password, Password2} -} - -// PolicyStatus enumerates the values for policy status. -type PolicyStatus string - -const ( - // Disabled ... - Disabled PolicyStatus = "disabled" - // Enabled ... - Enabled PolicyStatus = "enabled" -) - -// PossiblePolicyStatusValues returns an array of possible values for the PolicyStatus const type. -func PossiblePolicyStatusValues() []PolicyStatus { - return []PolicyStatus{Disabled, Enabled} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Canceled ... - Canceled ProvisioningState = "Canceled" - // Creating ... - Creating ProvisioningState = "Creating" - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" - // Updating ... - Updating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} -} - -// RegistryUsageUnit enumerates the values for registry usage unit. -type RegistryUsageUnit string - -const ( - // Bytes ... - Bytes RegistryUsageUnit = "Bytes" - // Count ... - Count RegistryUsageUnit = "Count" -) - -// PossibleRegistryUsageUnitValues returns an array of possible values for the RegistryUsageUnit const type. -func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { - return []RegistryUsageUnit{Bytes, Count} -} - -// SkuName enumerates the values for sku name. -type SkuName string - -const ( - // Basic ... - Basic SkuName = "Basic" - // Classic ... - Classic SkuName = "Classic" - // Premium ... - Premium SkuName = "Premium" - // Standard ... - Standard SkuName = "Standard" -) - -// PossibleSkuNameValues returns an array of possible values for the SkuName const type. -func PossibleSkuNameValues() []SkuName { - return []SkuName{Basic, Classic, Premium, Standard} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // SkuTierBasic ... - SkuTierBasic SkuTier = "Basic" - // SkuTierClassic ... - SkuTierClassic SkuTier = "Classic" - // SkuTierPremium ... - SkuTierPremium SkuTier = "Premium" - // SkuTierStandard ... - SkuTierStandard SkuTier = "Standard" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{SkuTierBasic, SkuTierClassic, SkuTierPremium, SkuTierStandard} -} - -// TokenCertificateName enumerates the values for token certificate name. -type TokenCertificateName string - -const ( - // Certificate1 ... - Certificate1 TokenCertificateName = "certificate1" - // Certificate2 ... - Certificate2 TokenCertificateName = "certificate2" -) - -// PossibleTokenCertificateNameValues returns an array of possible values for the TokenCertificateName const type. -func PossibleTokenCertificateNameValues() []TokenCertificateName { - return []TokenCertificateName{Certificate1, Certificate2} -} - -// TokenPasswordName enumerates the values for token password name. -type TokenPasswordName string - -const ( - // TokenPasswordNamePassword1 ... - TokenPasswordNamePassword1 TokenPasswordName = "password1" - // TokenPasswordNamePassword2 ... - TokenPasswordNamePassword2 TokenPasswordName = "password2" -) - -// PossibleTokenPasswordNameValues returns an array of possible values for the TokenPasswordName const type. -func PossibleTokenPasswordNameValues() []TokenPasswordName { - return []TokenPasswordName{TokenPasswordNamePassword1, TokenPasswordNamePassword2} -} - -// TokenStatus enumerates the values for token status. -type TokenStatus string - -const ( - // TokenStatusDisabled ... - TokenStatusDisabled TokenStatus = "disabled" - // TokenStatusEnabled ... - TokenStatusEnabled TokenStatus = "enabled" -) - -// PossibleTokenStatusValues returns an array of possible values for the TokenStatus const type. -func PossibleTokenStatusValues() []TokenStatus { - return []TokenStatus{TokenStatusDisabled, TokenStatusEnabled} -} - -// TrustPolicyType enumerates the values for trust policy type. -type TrustPolicyType string - -const ( - // Notary ... - Notary TrustPolicyType = "Notary" -) - -// PossibleTrustPolicyTypeValues returns an array of possible values for the TrustPolicyType const type. -func PossibleTrustPolicyTypeValues() []TrustPolicyType { - return []TrustPolicyType{Notary} -} - -// WebhookAction enumerates the values for webhook action. -type WebhookAction string - -const ( - // ChartDelete ... - ChartDelete WebhookAction = "chart_delete" - // ChartPush ... - ChartPush WebhookAction = "chart_push" - // Delete ... - Delete WebhookAction = "delete" - // Push ... - Push WebhookAction = "push" - // Quarantine ... - Quarantine WebhookAction = "quarantine" -) - -// PossibleWebhookActionValues returns an array of possible values for the WebhookAction const type. -func PossibleWebhookActionValues() []WebhookAction { - return []WebhookAction{ChartDelete, ChartPush, Delete, Push, Quarantine} -} - -// WebhookStatus enumerates the values for webhook status. -type WebhookStatus string - -const ( - // WebhookStatusDisabled ... - WebhookStatusDisabled WebhookStatus = "disabled" - // WebhookStatusEnabled ... - WebhookStatusEnabled WebhookStatus = "enabled" -) - -// PossibleWebhookStatusValues returns an array of possible values for the WebhookStatus const type. -func PossibleWebhookStatusValues() []WebhookStatus { - return []WebhookStatus{WebhookStatusDisabled, WebhookStatusEnabled} -} - // ActiveDirectoryObject the Active Directory Object that will be used for authenticating the token of a // container registry. type ActiveDirectoryObject struct { @@ -283,8 +40,8 @@ type ActiveDirectoryObject struct { TenantID *string `json:"tenantId,omitempty"` } -// Actor the agent that initiated the event. For most situations, this could be from the authorization -// context of the request. +// Actor the agent that initiated the event. For most situations, this could be from the authorization context +// of the request. type Actor struct { // Name - The subject or username associated with the request context that generated the event. Name *string `json:"name,omitempty"` @@ -423,10 +180,15 @@ func (elr EventListResult) IsEmpty() bool { return elr.Value == nil || len(*elr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (elr EventListResult) hasNextLink() bool { + return elr.NextLink != nil && len(*elr.NextLink) != 0 +} + // eventListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (elr EventListResult) eventListResultPreparer(ctx context.Context) (*http.Request, error) { - if elr.NextLink == nil || len(to.String(elr.NextLink)) < 1 { + if !elr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -454,11 +216,16 @@ func (page *EventListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.elr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.elr) + if err != nil { + return err + } + page.elr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.elr = next return nil } @@ -562,8 +329,8 @@ func (erm EventResponseMessage) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// GenerateCredentialsParameters the parameters used to generate credentials for a specified token or user -// of a container registry. +// GenerateCredentialsParameters the parameters used to generate credentials for a specified token or user of a +// container registry. type GenerateCredentialsParameters struct { // TokenID - The resource ID of the token for which credentials have to be generated. TokenID *string `json:"tokenId,omitempty"` @@ -805,10 +572,15 @@ func (olr OperationListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // operationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + if !olr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -836,11 +608,16 @@ func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.olr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.olr = next return nil } @@ -913,6 +690,12 @@ type ProxyResource struct { Type *string `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // QuarantinePolicy an object that represents quarantine policy for a container registry. type QuarantinePolicy struct { // Status - The value that indicates whether the policy is enabled or not. Possible values include: 'Enabled', 'Disabled' @@ -925,8 +708,7 @@ type RegenerateCredentialParameters struct { Name PasswordName `json:"name,omitempty"` } -// RegistriesCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// RegistriesCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type RegistriesCreateFuture struct { azure.Future } @@ -954,8 +736,7 @@ func (future *RegistriesCreateFuture) Result(client RegistriesClient) (r Registr return } -// RegistriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// RegistriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type RegistriesDeleteFuture struct { azure.Future } @@ -1029,8 +810,7 @@ func (future *RegistriesImportImageFuture) Result(client RegistriesClient) (ar a return } -// RegistriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// RegistriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type RegistriesUpdateFuture struct { azure.Future } @@ -1058,8 +838,8 @@ func (future *RegistriesUpdateFuture) Result(client RegistriesClient) (r Registr return } -// RegistriesUpdatePoliciesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// RegistriesUpdatePoliciesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type RegistriesUpdatePoliciesFuture struct { azure.Future } @@ -1288,10 +1068,15 @@ func (rlr RegistryListResult) IsEmpty() bool { return rlr.Value == nil || len(*rlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rlr RegistryListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + // registryListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rlr RegistryListResult) registryListResultPreparer(ctx context.Context) (*http.Request, error) { - if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + if !rlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1319,11 +1104,16 @@ func (page *RegistryListResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rlr = next return nil } @@ -1411,6 +1201,21 @@ type RegistryProperties struct { NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` } +// MarshalJSON is the custom marshaler for RegistryProperties. +func (rp RegistryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.AdminUserEnabled != nil { + objectMap["adminUserEnabled"] = rp.AdminUserEnabled + } + if rp.StorageAccount != nil { + objectMap["storageAccount"] = rp.StorageAccount + } + if rp.NetworkRuleSet != nil { + objectMap["networkRuleSet"] = rp.NetworkRuleSet + } + return json.Marshal(objectMap) +} + // RegistryPropertiesUpdateParameters the parameters for updating the properties of a container registry. type RegistryPropertiesUpdateParameters struct { // AdminUserEnabled - The value that indicates whether the admin user is enabled. @@ -1685,10 +1490,15 @@ func (rlr ReplicationListResult) IsEmpty() bool { return rlr.Value == nil || len(*rlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rlr ReplicationListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + // replicationListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rlr ReplicationListResult) replicationListResultPreparer(ctx context.Context) (*http.Request, error) { - if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { + if !rlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1716,11 +1526,16 @@ func (page *ReplicationListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rlr = next return nil } @@ -1762,6 +1577,12 @@ type ReplicationProperties struct { Status *Status `json:"status,omitempty"` } +// MarshalJSON is the custom marshaler for ReplicationProperties. +func (rp ReplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type ReplicationsCreateFuture struct { @@ -2048,10 +1869,15 @@ func (smlr ScopeMapListResult) IsEmpty() bool { return smlr.Value == nil || len(*smlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (smlr ScopeMapListResult) hasNextLink() bool { + return smlr.NextLink != nil && len(*smlr.NextLink) != 0 +} + // scopeMapListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (smlr ScopeMapListResult) scopeMapListResultPreparer(ctx context.Context) (*http.Request, error) { - if smlr.NextLink == nil || len(to.String(smlr.NextLink)) < 1 { + if !smlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2079,11 +1905,16 @@ func (page *ScopeMapListResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.smlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.smlr) + if err != nil { + return err + } + page.smlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.smlr = next return nil } @@ -2133,6 +1964,18 @@ type ScopeMapProperties struct { Actions *[]string `json:"actions,omitempty"` } +// MarshalJSON is the custom marshaler for ScopeMapProperties. +func (smp ScopeMapProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smp.Description != nil { + objectMap["description"] = smp.Description + } + if smp.Actions != nil { + objectMap["actions"] = smp.Actions + } + return json.Marshal(objectMap) +} + // ScopeMapPropertiesUpdateParameters the update parameters for scope map properties. type ScopeMapPropertiesUpdateParameters struct { // Description - The user friendly description of the scope map. @@ -2143,8 +1986,7 @@ type ScopeMapPropertiesUpdateParameters struct { Actions *[]string `json:"actions,omitempty"` } -// ScopeMapsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ScopeMapsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ScopeMapsCreateFuture struct { azure.Future } @@ -2172,8 +2014,7 @@ func (future *ScopeMapsCreateFuture) Result(client ScopeMapsClient) (sm ScopeMap return } -// ScopeMapsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ScopeMapsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ScopeMapsDeleteFuture struct { azure.Future } @@ -2195,8 +2036,7 @@ func (future *ScopeMapsDeleteFuture) Result(client ScopeMapsClient) (ar autorest return } -// ScopeMapsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ScopeMapsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ScopeMapsUpdateFuture struct { azure.Future } @@ -2271,8 +2111,17 @@ type Sku struct { Tier SkuTier `json:"tier,omitempty"` } -// Source the registry node that generated the event. Put differently, while the actor initiates the event, -// the source generates it. +// MarshalJSON is the custom marshaler for Sku. +func (s Sku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Name != "" { + objectMap["name"] = s.Name + } + return json.Marshal(objectMap) +} + +// Source the registry node that generated the event. Put differently, while the actor initiates the event, the +// source generates it. type Source struct { // Addr - The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. Addr *string `json:"addr,omitempty"` @@ -2290,8 +2139,14 @@ type Status struct { Timestamp *date.Time `json:"timestamp,omitempty"` } -// StorageAccountProperties the properties of a storage account for a container registry. Only applicable -// to Classic SKU. +// MarshalJSON is the custom marshaler for Status. +func (s Status) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// StorageAccountProperties the properties of a storage account for a container registry. Only applicable to +// Classic SKU. type StorageAccountProperties struct { // ID - The resource ID of the storage account. ID *string `json:"id,omitempty"` @@ -2404,8 +2259,7 @@ type TokenCertificate struct { EncodedPemCertificate *string `json:"encodedPemCertificate,omitempty"` } -// TokenCredentialsProperties the properties of the credentials that can be used for authenticating the -// token. +// TokenCredentialsProperties the properties of the credentials that can be used for authenticating the token. type TokenCredentialsProperties struct { ActiveDirectoryObject *ActiveDirectoryObject `json:"activeDirectoryObject,omitempty"` Certificates *[]TokenCertificate `json:"certificates,omitempty"` @@ -2489,10 +2343,15 @@ func (tlr TokenListResult) IsEmpty() bool { return tlr.Value == nil || len(*tlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (tlr TokenListResult) hasNextLink() bool { + return tlr.NextLink != nil && len(*tlr.NextLink) != 0 +} + // tokenListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (tlr TokenListResult) tokenListResultPreparer(ctx context.Context) (*http.Request, error) { - if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { + if !tlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2520,11 +2379,16 @@ func (page *TokenListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.tlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.tlr) + if err != nil { + return err + } + page.tlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.tlr = next return nil } @@ -2570,6 +2434,21 @@ type TokenPassword struct { Value *string `json:"value,omitempty"` } +// MarshalJSON is the custom marshaler for TokenPassword. +func (tp TokenPassword) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tp.CreationTime != nil { + objectMap["creationTime"] = tp.CreationTime + } + if tp.Expiry != nil { + objectMap["expiry"] = tp.Expiry + } + if tp.Name != "" { + objectMap["name"] = tp.Name + } + return json.Marshal(objectMap) +} + // TokenProperties the properties of a token. type TokenProperties struct { // CreationDate - READ-ONLY; The creation date of scope map. @@ -2584,6 +2463,21 @@ type TokenProperties struct { Status TokenStatus `json:"status,omitempty"` } +// MarshalJSON is the custom marshaler for TokenProperties. +func (tp TokenProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tp.ScopeMapID != nil { + objectMap["scopeMapId"] = tp.ScopeMapID + } + if tp.Credentials != nil { + objectMap["credentials"] = tp.Credentials + } + if tp.Status != "" { + objectMap["status"] = tp.Status + } + return json.Marshal(objectMap) +} + // TokensCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type TokensCreateFuture struct { azure.Future @@ -2972,10 +2866,15 @@ func (wlr WebhookListResult) IsEmpty() bool { return wlr.Value == nil || len(*wlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (wlr WebhookListResult) hasNextLink() bool { + return wlr.NextLink != nil && len(*wlr.NextLink) != 0 +} + // webhookListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (wlr WebhookListResult) webhookListResultPreparer(ctx context.Context) (*http.Request, error) { - if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 { + if !wlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3003,11 +2902,16 @@ func (page *WebhookListResultPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.wlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.wlr) + if err != nil { + return err + } + page.wlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.wlr = next return nil } @@ -3053,6 +2957,21 @@ type WebhookProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for WebhookProperties. +func (wp WebhookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.Status != "" { + objectMap["status"] = wp.Status + } + if wp.Scope != nil { + objectMap["scope"] = wp.Scope + } + if wp.Actions != nil { + objectMap["actions"] = wp.Actions + } + return json.Marshal(objectMap) +} + // WebhookPropertiesCreateParameters the parameters for creating the properties of a webhook. type WebhookPropertiesCreateParameters struct { // ServiceURI - The service URI for the webhook to post notifications. @@ -3123,8 +3042,7 @@ func (wpup WebhookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// WebhooksCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// WebhooksCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type WebhooksCreateFuture struct { azure.Future } @@ -3152,8 +3070,7 @@ func (future *WebhooksCreateFuture) Result(client WebhooksClient) (w Webhook, er return } -// WebhooksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// WebhooksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type WebhooksDeleteFuture struct { azure.Future } @@ -3175,8 +3092,7 @@ func (future *WebhooksDeleteFuture) Result(client WebhooksClient) (ar autorest.R return } -// WebhooksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// WebhooksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type WebhooksUpdateFuture struct { azure.Future } diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/operations.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/operations.go index cd3527e7664c..36d74d8ced3b 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/operations.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/operations.go @@ -71,6 +71,9 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.OperationsClient", "List", resp, "Failure responding to request") } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -101,7 +104,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/registries.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/registries.go index 18cf9d9c0786..ad87d08a3aae 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/registries.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/registries.go @@ -121,7 +121,6 @@ func (client RegistriesClient) CheckNameAvailabilitySender(req *http.Request) (* func (client RegistriesClient) CheckNameAvailabilityResponder(resp *http.Response) (result RegistryNameStatus, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -216,7 +215,6 @@ func (client RegistriesClient) CreateSender(req *http.Request) (future Registrie func (client RegistriesClient) CreateResponder(resp *http.Response) (result Registry, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -302,7 +300,6 @@ func (client RegistriesClient) DeleteSender(req *http.Request) (future Registrie func (client RegistriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -390,7 +387,6 @@ func (client RegistriesClient) GenerateCredentialsSender(req *http.Request) (fut func (client RegistriesClient) GenerateCredentialsResponder(resp *http.Response) (result GenerateCredentialsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -476,7 +472,6 @@ func (client RegistriesClient) GetSender(req *http.Request) (*http.Response, err func (client RegistriesClient) GetResponder(resp *http.Response) (result Registry, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -571,7 +566,6 @@ func (client RegistriesClient) ImportImageSender(req *http.Request) (future Regi func (client RegistriesClient) ImportImageResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -608,6 +602,9 @@ func (client RegistriesClient) List(ctx context.Context) (result RegistryListRes if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure responding to request") } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -642,7 +639,6 @@ func (client RegistriesClient) ListSender(req *http.Request) (*http.Response, er func (client RegistriesClient) ListResponder(resp *http.Response) (result RegistryListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -725,6 +721,9 @@ func (client RegistriesClient) ListByResourceGroup(ctx context.Context, resource if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -760,7 +759,6 @@ func (client RegistriesClient) ListByResourceGroupSender(req *http.Request) (*ht func (client RegistriesClient) ListByResourceGroupResponder(resp *http.Response) (result RegistryListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -883,7 +881,6 @@ func (client RegistriesClient) ListCredentialsSender(req *http.Request) (*http.R func (client RegistriesClient) ListCredentialsResponder(resp *http.Response) (result RegistryListCredentialsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -969,7 +966,6 @@ func (client RegistriesClient) ListPoliciesSender(req *http.Request) (*http.Resp func (client RegistriesClient) ListPoliciesResponder(resp *http.Response) (result RegistryPolicies, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1055,7 +1051,6 @@ func (client RegistriesClient) ListUsagesSender(req *http.Request) (*http.Respon func (client RegistriesClient) ListUsagesResponder(resp *http.Response) (result RegistryUsageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1145,7 +1140,6 @@ func (client RegistriesClient) RegenerateCredentialSender(req *http.Request) (*h func (client RegistriesClient) RegenerateCredentialResponder(resp *http.Response) (result RegistryListCredentialsResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1234,7 +1228,6 @@ func (client RegistriesClient) UpdateSender(req *http.Request) (future Registrie func (client RegistriesClient) UpdateResponder(resp *http.Response) (result Registry, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1323,7 +1316,6 @@ func (client RegistriesClient) UpdatePoliciesSender(req *http.Request) (future R func (client RegistriesClient) UpdatePoliciesResponder(resp *http.Response) (result RegistryPolicies, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/replications.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/replications.go index 2997cc628370..8826bcc8e0c0 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/replications.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/replications.go @@ -129,7 +129,6 @@ func (client ReplicationsClient) CreateSender(req *http.Request) (future Replica func (client ReplicationsClient) CreateResponder(resp *http.Response) (result Replication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -221,7 +220,6 @@ func (client ReplicationsClient) DeleteSender(req *http.Request) (future Replica func (client ReplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -312,7 +310,6 @@ func (client ReplicationsClient) GetSender(req *http.Request) (*http.Response, e func (client ReplicationsClient) GetResponder(resp *http.Response) (result Replication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -363,6 +360,9 @@ func (client ReplicationsClient) List(ctx context.Context, resourceGroupName str if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure responding to request") } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -399,7 +399,6 @@ func (client ReplicationsClient) ListSender(req *http.Request) (*http.Response, func (client ReplicationsClient) ListResponder(resp *http.Response) (result ReplicationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -531,7 +530,6 @@ func (client ReplicationsClient) UpdateSender(req *http.Request) (future Replica func (client ReplicationsClient) UpdateResponder(resp *http.Response) (result Replication, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/scopemaps.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/scopemaps.go index a67d209acc27..3d62a4d0078c 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/scopemaps.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/scopemaps.go @@ -132,7 +132,6 @@ func (client ScopeMapsClient) CreateSender(req *http.Request) (future ScopeMapsC func (client ScopeMapsClient) CreateResponder(resp *http.Response) (result ScopeMap, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -224,7 +223,6 @@ func (client ScopeMapsClient) DeleteSender(req *http.Request) (future ScopeMapsD func (client ScopeMapsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -315,7 +313,6 @@ func (client ScopeMapsClient) GetSender(req *http.Request) (*http.Response, erro func (client ScopeMapsClient) GetResponder(resp *http.Response) (result ScopeMap, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -366,6 +363,9 @@ func (client ScopeMapsClient) List(ctx context.Context, resourceGroupName string if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsClient", "List", resp, "Failure responding to request") } + if result.smlr.hasNextLink() && result.smlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -402,7 +402,6 @@ func (client ScopeMapsClient) ListSender(req *http.Request) (*http.Response, err func (client ScopeMapsClient) ListResponder(resp *http.Response) (result ScopeMapListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -534,7 +533,6 @@ func (client ScopeMapsClient) UpdateSender(req *http.Request) (future ScopeMapsU func (client ScopeMapsClient) UpdateResponder(resp *http.Response) (result ScopeMap, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/tokens.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/tokens.go index 7e36e5d6e3f3..c5995b49cb2a 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/tokens.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/tokens.go @@ -129,7 +129,6 @@ func (client TokensClient) CreateSender(req *http.Request) (future TokensCreateF func (client TokensClient) CreateResponder(resp *http.Response) (result Token, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -221,7 +220,6 @@ func (client TokensClient) DeleteSender(req *http.Request) (future TokensDeleteF func (client TokensClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -312,7 +310,6 @@ func (client TokensClient) GetSender(req *http.Request) (*http.Response, error) func (client TokensClient) GetResponder(resp *http.Response) (result Token, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -363,6 +360,9 @@ func (client TokensClient) List(ctx context.Context, resourceGroupName string, r if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.TokensClient", "List", resp, "Failure responding to request") } + if result.tlr.hasNextLink() && result.tlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -399,7 +399,6 @@ func (client TokensClient) ListSender(req *http.Request) (*http.Response, error) func (client TokensClient) ListResponder(resp *http.Response) (result TokenListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -531,7 +530,6 @@ func (client TokensClient) UpdateSender(req *http.Request) (future TokensUpdateF func (client TokensClient) UpdateResponder(resp *http.Response) (result Token, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/version.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/version.go index c4601cbfc4b2..2dae7fccb168 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/version.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " containerregistry/2019-05-01-preview" + return "Azure-SDK-For-Go/" + Version() + " containerregistry/2019-05-01-preview" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/webhooks.go b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/webhooks.go index 3e0456876789..64c6048cb6af 100644 --- a/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/webhooks.go +++ b/services/containerregistry/mgmt/2019-05-01-preview/containerregistry/webhooks.go @@ -135,7 +135,6 @@ func (client WebhooksClient) CreateSender(req *http.Request) (future WebhooksCre func (client WebhooksClient) CreateResponder(resp *http.Response) (result Webhook, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -227,7 +226,6 @@ func (client WebhooksClient) DeleteSender(req *http.Request) (future WebhooksDel func (client WebhooksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -318,7 +316,6 @@ func (client WebhooksClient) GetSender(req *http.Request) (*http.Response, error func (client WebhooksClient) GetResponder(resp *http.Response) (result Webhook, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -410,7 +407,6 @@ func (client WebhooksClient) GetCallbackConfigSender(req *http.Request) (*http.R func (client WebhooksClient) GetCallbackConfigResponder(resp *http.Response) (result CallbackConfig, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -461,6 +457,9 @@ func (client WebhooksClient) List(ctx context.Context, resourceGroupName string, if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure responding to request") } + if result.wlr.hasNextLink() && result.wlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -497,7 +496,6 @@ func (client WebhooksClient) ListSender(req *http.Request) (*http.Response, erro func (client WebhooksClient) ListResponder(resp *http.Response) (result WebhookListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -590,6 +588,9 @@ func (client WebhooksClient) ListEvents(ctx context.Context, resourceGroupName s if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure responding to request") } + if result.elr.hasNextLink() && result.elr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -627,7 +628,6 @@ func (client WebhooksClient) ListEventsSender(req *http.Request) (*http.Response func (client WebhooksClient) ListEventsResponder(resp *http.Response) (result EventListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -756,7 +756,6 @@ func (client WebhooksClient) PingSender(req *http.Request) (*http.Response, erro func (client WebhooksClient) PingResponder(resp *http.Response) (result EventInfo, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -851,7 +850,6 @@ func (client WebhooksClient) UpdateSender(req *http.Request) (future WebhooksUpd func (client WebhooksClient) UpdateResponder(resp *http.Response) (result Webhook, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing())