diff --git a/services/cdn/mgmt/2017-10-12/cdn/client.go b/services/cdn/mgmt/2017-10-12/cdn/client.go index c3ca71296cca..86fa34a32c00 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/client.go +++ b/services/cdn/mgmt/2017-10-12/cdn/client.go @@ -127,7 +127,6 @@ func (client BaseClient) CheckNameAvailabilitySender(req *http.Request) (*http.R func (client BaseClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -210,7 +209,6 @@ func (client BaseClient) CheckNameAvailabilityWithSubscriptionSender(req *http.R func (client BaseClient) CheckNameAvailabilityWithSubscriptionResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -293,7 +291,6 @@ func (client BaseClient) ValidateProbeSender(req *http.Request) (*http.Response, func (client BaseClient) ValidateProbeResponder(resp *http.Response) (result ValidateProbeOutput, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/cdn/mgmt/2017-10-12/cdn/customdomains.go b/services/cdn/mgmt/2017-10-12/cdn/customdomains.go index 12efd820ed9d..7bf07161c7e6 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/customdomains.go +++ b/services/cdn/mgmt/2017-10-12/cdn/customdomains.go @@ -128,7 +128,6 @@ func (client CustomDomainsClient) CreateSender(req *http.Request) (future Custom func (client CustomDomainsClient) CreateResponder(resp *http.Response) (result CustomDomain, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -216,7 +215,6 @@ func (client CustomDomainsClient) DeleteSender(req *http.Request) (future Custom func (client CustomDomainsClient) DeleteResponder(resp *http.Response) (result CustomDomain, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -304,7 +302,6 @@ func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (* func (client CustomDomainsClient) DisableCustomHTTPSResponder(resp *http.Response) (result CustomDomain, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -400,7 +397,6 @@ func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (*h func (client CustomDomainsClient) EnableCustomHTTPSResponder(resp *http.Response) (result CustomDomain, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -488,7 +484,6 @@ func (client CustomDomainsClient) GetSender(req *http.Request) (*http.Response, func (client CustomDomainsClient) GetResponder(resp *http.Response) (result CustomDomain, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -538,6 +533,9 @@ func (client CustomDomainsClient) ListByEndpoint(ctx context.Context, resourceGr if err != nil { err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", resp, "Failure responding to request") } + if result.cdlr.hasNextLink() && result.cdlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -575,7 +573,6 @@ func (client CustomDomainsClient) ListByEndpointSender(req *http.Request) (*http func (client CustomDomainsClient) ListByEndpointResponder(resp *http.Response) (result CustomDomainListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/cdn/mgmt/2017-10-12/cdn/edgenodes.go b/services/cdn/mgmt/2017-10-12/cdn/edgenodes.go index 259612f2978f..1b554ef1027f 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/edgenodes.go +++ b/services/cdn/mgmt/2017-10-12/cdn/edgenodes.go @@ -71,6 +71,9 @@ func (client EdgeNodesClient) List(ctx context.Context) (result EdgenodeResultPa if err != nil { err = autorest.NewErrorWithError(err, "cdn.EdgeNodesClient", "List", resp, "Failure responding to request") } + if result.er.hasNextLink() && result.er.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -101,7 +104,6 @@ func (client EdgeNodesClient) ListSender(req *http.Request) (*http.Response, err func (client EdgeNodesClient) ListResponder(resp *http.Response) (result EdgenodeResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/cdn/mgmt/2017-10-12/cdn/endpoints.go b/services/cdn/mgmt/2017-10-12/cdn/endpoints.go index d9db2eb1d50f..18d7fdf9efd4 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/endpoints.go +++ b/services/cdn/mgmt/2017-10-12/cdn/endpoints.go @@ -127,7 +127,6 @@ func (client EndpointsClient) CreateSender(req *http.Request) (future EndpointsC func (client EndpointsClient) CreateResponder(resp *http.Response) (result Endpoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -214,7 +213,6 @@ func (client EndpointsClient) DeleteSender(req *http.Request) (future EndpointsD func (client EndpointsClient) 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 @@ -300,7 +298,6 @@ func (client EndpointsClient) GetSender(req *http.Request) (*http.Response, erro func (client EndpointsClient) GetResponder(resp *http.Response) (result Endpoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -349,6 +346,9 @@ func (client EndpointsClient) ListByProfile(ctx context.Context, resourceGroupNa if err != nil { err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", resp, "Failure responding to request") } + if result.elr.hasNextLink() && result.elr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -385,7 +385,6 @@ func (client EndpointsClient) ListByProfileSender(req *http.Request) (*http.Resp func (client EndpointsClient) ListByProfileResponder(resp *http.Response) (result EndpointListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -472,6 +471,9 @@ func (client EndpointsClient) ListResourceUsage(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListResourceUsage", resp, "Failure responding to request") } + if result.rulr.hasNextLink() && result.rulr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -509,7 +511,6 @@ func (client EndpointsClient) ListResourceUsageSender(req *http.Request) (*http. func (client EndpointsClient) ListResourceUsageResponder(resp *http.Response) (result ResourceUsageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -638,7 +639,6 @@ func (client EndpointsClient) LoadContentSender(req *http.Request) (future Endpo func (client EndpointsClient) LoadContentResponder(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 @@ -730,7 +730,6 @@ func (client EndpointsClient) PurgeContentSender(req *http.Request) (future Endp func (client EndpointsClient) PurgeContentResponder(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 @@ -815,7 +814,6 @@ func (client EndpointsClient) StartSender(req *http.Request) (future EndpointsSt func (client EndpointsClient) StartResponder(resp *http.Response) (result Endpoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -901,7 +899,6 @@ func (client EndpointsClient) StopSender(req *http.Request) (future EndpointsSto func (client EndpointsClient) StopResponder(resp *http.Response) (result Endpoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -992,7 +989,6 @@ func (client EndpointsClient) UpdateSender(req *http.Request) (future EndpointsU func (client EndpointsClient) UpdateResponder(resp *http.Response) (result Endpoint, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -1083,7 +1079,6 @@ func (client EndpointsClient) ValidateCustomDomainSender(req *http.Request) (*ht func (client EndpointsClient) ValidateCustomDomainResponder(resp *http.Response) (result ValidateCustomDomainOutput, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/cdn/mgmt/2017-10-12/cdn/enums.go b/services/cdn/mgmt/2017-10-12/cdn/enums.go new file mode 100644 index 000000000000..6eff39208f3d --- /dev/null +++ b/services/cdn/mgmt/2017-10-12/cdn/enums.go @@ -0,0 +1,350 @@ +package cdn + +// 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. + +// CacheBehavior enumerates the values for cache behavior. +type CacheBehavior string + +const ( + // BypassCache ... + BypassCache CacheBehavior = "BypassCache" + // Override ... + Override CacheBehavior = "Override" + // SetIfMissing ... + SetIfMissing CacheBehavior = "SetIfMissing" +) + +// PossibleCacheBehaviorValues returns an array of possible values for the CacheBehavior const type. +func PossibleCacheBehaviorValues() []CacheBehavior { + return []CacheBehavior{BypassCache, Override, SetIfMissing} +} + +// CertificateSource enumerates the values for certificate source. +type CertificateSource string + +const ( + // CertificateSourceAzureKeyVault ... + CertificateSourceAzureKeyVault CertificateSource = "AzureKeyVault" + // CertificateSourceCdn ... + CertificateSourceCdn CertificateSource = "Cdn" + // CertificateSourceCustomDomainHTTPSParameters ... + CertificateSourceCustomDomainHTTPSParameters CertificateSource = "CustomDomainHttpsParameters" +) + +// PossibleCertificateSourceValues returns an array of possible values for the CertificateSource const type. +func PossibleCertificateSourceValues() []CertificateSource { + return []CertificateSource{CertificateSourceAzureKeyVault, CertificateSourceCdn, CertificateSourceCustomDomainHTTPSParameters} +} + +// CertificateType enumerates the values for certificate type. +type CertificateType string + +const ( + // Dedicated ... + Dedicated CertificateType = "Dedicated" + // Shared ... + Shared CertificateType = "Shared" +) + +// PossibleCertificateTypeValues returns an array of possible values for the CertificateType const type. +func PossibleCertificateTypeValues() []CertificateType { + return []CertificateType{Dedicated, Shared} +} + +// CustomDomainResourceState enumerates the values for custom domain resource state. +type CustomDomainResourceState string + +const ( + // Active ... + Active CustomDomainResourceState = "Active" + // Creating ... + Creating CustomDomainResourceState = "Creating" + // Deleting ... + Deleting CustomDomainResourceState = "Deleting" +) + +// PossibleCustomDomainResourceStateValues returns an array of possible values for the CustomDomainResourceState const type. +func PossibleCustomDomainResourceStateValues() []CustomDomainResourceState { + return []CustomDomainResourceState{Active, Creating, Deleting} +} + +// CustomHTTPSProvisioningState enumerates the values for custom https provisioning state. +type CustomHTTPSProvisioningState string + +const ( + // Disabled ... + Disabled CustomHTTPSProvisioningState = "Disabled" + // Disabling ... + Disabling CustomHTTPSProvisioningState = "Disabling" + // Enabled ... + Enabled CustomHTTPSProvisioningState = "Enabled" + // Enabling ... + Enabling CustomHTTPSProvisioningState = "Enabling" + // Failed ... + Failed CustomHTTPSProvisioningState = "Failed" +) + +// PossibleCustomHTTPSProvisioningStateValues returns an array of possible values for the CustomHTTPSProvisioningState const type. +func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState { + return []CustomHTTPSProvisioningState{Disabled, Disabling, Enabled, Enabling, Failed} +} + +// CustomHTTPSProvisioningSubstate enumerates the values for custom https provisioning substate. +type CustomHTTPSProvisioningSubstate string + +const ( + // CertificateDeleted ... + CertificateDeleted CustomHTTPSProvisioningSubstate = "CertificateDeleted" + // CertificateDeployed ... + CertificateDeployed CustomHTTPSProvisioningSubstate = "CertificateDeployed" + // DeletingCertificate ... + DeletingCertificate CustomHTTPSProvisioningSubstate = "DeletingCertificate" + // DeployingCertificate ... + DeployingCertificate CustomHTTPSProvisioningSubstate = "DeployingCertificate" + // DomainControlValidationRequestApproved ... + DomainControlValidationRequestApproved CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestApproved" + // DomainControlValidationRequestRejected ... + DomainControlValidationRequestRejected CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestRejected" + // DomainControlValidationRequestTimedOut ... + DomainControlValidationRequestTimedOut CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestTimedOut" + // IssuingCertificate ... + IssuingCertificate CustomHTTPSProvisioningSubstate = "IssuingCertificate" + // PendingDomainControlValidationREquestApproval ... + PendingDomainControlValidationREquestApproval CustomHTTPSProvisioningSubstate = "PendingDomainControlValidationREquestApproval" + // SubmittingDomainControlValidationRequest ... + SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = "SubmittingDomainControlValidationRequest" +) + +// PossibleCustomHTTPSProvisioningSubstateValues returns an array of possible values for the CustomHTTPSProvisioningSubstate const type. +func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate { + return []CustomHTTPSProvisioningSubstate{CertificateDeleted, CertificateDeployed, DeletingCertificate, DeployingCertificate, DomainControlValidationRequestApproved, DomainControlValidationRequestRejected, DomainControlValidationRequestTimedOut, IssuingCertificate, PendingDomainControlValidationREquestApproval, SubmittingDomainControlValidationRequest} +} + +// EndpointResourceState enumerates the values for endpoint resource state. +type EndpointResourceState string + +const ( + // EndpointResourceStateCreating ... + EndpointResourceStateCreating EndpointResourceState = "Creating" + // EndpointResourceStateDeleting ... + EndpointResourceStateDeleting EndpointResourceState = "Deleting" + // EndpointResourceStateRunning ... + EndpointResourceStateRunning EndpointResourceState = "Running" + // EndpointResourceStateStarting ... + EndpointResourceStateStarting EndpointResourceState = "Starting" + // EndpointResourceStateStopped ... + EndpointResourceStateStopped EndpointResourceState = "Stopped" + // EndpointResourceStateStopping ... + EndpointResourceStateStopping EndpointResourceState = "Stopping" +) + +// PossibleEndpointResourceStateValues returns an array of possible values for the EndpointResourceState const type. +func PossibleEndpointResourceStateValues() []EndpointResourceState { + return []EndpointResourceState{EndpointResourceStateCreating, EndpointResourceStateDeleting, EndpointResourceStateRunning, EndpointResourceStateStarting, EndpointResourceStateStopped, EndpointResourceStateStopping} +} + +// GeoFilterActions enumerates the values for geo filter actions. +type GeoFilterActions string + +const ( + // Allow ... + Allow GeoFilterActions = "Allow" + // Block ... + Block GeoFilterActions = "Block" +) + +// PossibleGeoFilterActionsValues returns an array of possible values for the GeoFilterActions const type. +func PossibleGeoFilterActionsValues() []GeoFilterActions { + return []GeoFilterActions{Allow, Block} +} + +// MatchType enumerates the values for match type. +type MatchType string + +const ( + // Literal ... + Literal MatchType = "Literal" + // Wildcard ... + Wildcard MatchType = "Wildcard" +) + +// PossibleMatchTypeValues returns an array of possible values for the MatchType const type. +func PossibleMatchTypeValues() []MatchType { + return []MatchType{Literal, Wildcard} +} + +// Name enumerates the values for name. +type Name string + +const ( + // NameCacheExpiration ... + NameCacheExpiration Name = "CacheExpiration" + // NameDeliveryRuleAction ... + NameDeliveryRuleAction Name = "DeliveryRuleAction" +) + +// PossibleNameValues returns an array of possible values for the Name const type. +func PossibleNameValues() []Name { + return []Name{NameCacheExpiration, NameDeliveryRuleAction} +} + +// NameBasicDeliveryRuleCondition enumerates the values for name basic delivery rule condition. +type NameBasicDeliveryRuleCondition string + +const ( + // NameDeliveryRuleCondition ... + NameDeliveryRuleCondition NameBasicDeliveryRuleCondition = "DeliveryRuleCondition" + // NameURLFileExtension ... + NameURLFileExtension NameBasicDeliveryRuleCondition = "UrlFileExtension" + // NameURLPath ... + NameURLPath NameBasicDeliveryRuleCondition = "UrlPath" +) + +// PossibleNameBasicDeliveryRuleConditionValues returns an array of possible values for the NameBasicDeliveryRuleCondition const type. +func PossibleNameBasicDeliveryRuleConditionValues() []NameBasicDeliveryRuleCondition { + return []NameBasicDeliveryRuleCondition{NameDeliveryRuleCondition, NameURLFileExtension, NameURLPath} +} + +// OptimizationType enumerates the values for optimization type. +type OptimizationType string + +const ( + // DynamicSiteAcceleration ... + DynamicSiteAcceleration OptimizationType = "DynamicSiteAcceleration" + // GeneralMediaStreaming ... + GeneralMediaStreaming OptimizationType = "GeneralMediaStreaming" + // GeneralWebDelivery ... + GeneralWebDelivery OptimizationType = "GeneralWebDelivery" + // LargeFileDownload ... + LargeFileDownload OptimizationType = "LargeFileDownload" + // VideoOnDemandMediaStreaming ... + VideoOnDemandMediaStreaming OptimizationType = "VideoOnDemandMediaStreaming" +) + +// PossibleOptimizationTypeValues returns an array of possible values for the OptimizationType const type. +func PossibleOptimizationTypeValues() []OptimizationType { + return []OptimizationType{DynamicSiteAcceleration, GeneralMediaStreaming, GeneralWebDelivery, LargeFileDownload, VideoOnDemandMediaStreaming} +} + +// OriginResourceState enumerates the values for origin resource state. +type OriginResourceState string + +const ( + // OriginResourceStateActive ... + OriginResourceStateActive OriginResourceState = "Active" + // OriginResourceStateCreating ... + OriginResourceStateCreating OriginResourceState = "Creating" + // OriginResourceStateDeleting ... + OriginResourceStateDeleting OriginResourceState = "Deleting" +) + +// PossibleOriginResourceStateValues returns an array of possible values for the OriginResourceState const type. +func PossibleOriginResourceStateValues() []OriginResourceState { + return []OriginResourceState{OriginResourceStateActive, OriginResourceStateCreating, OriginResourceStateDeleting} +} + +// ProfileResourceState enumerates the values for profile resource state. +type ProfileResourceState string + +const ( + // ProfileResourceStateActive ... + ProfileResourceStateActive ProfileResourceState = "Active" + // ProfileResourceStateCreating ... + ProfileResourceStateCreating ProfileResourceState = "Creating" + // ProfileResourceStateDeleting ... + ProfileResourceStateDeleting ProfileResourceState = "Deleting" + // ProfileResourceStateDisabled ... + ProfileResourceStateDisabled ProfileResourceState = "Disabled" +) + +// PossibleProfileResourceStateValues returns an array of possible values for the ProfileResourceState const type. +func PossibleProfileResourceStateValues() []ProfileResourceState { + return []ProfileResourceState{ProfileResourceStateActive, ProfileResourceStateCreating, ProfileResourceStateDeleting, ProfileResourceStateDisabled} +} + +// ProtocolType enumerates the values for protocol type. +type ProtocolType string + +const ( + // IPBased ... + IPBased ProtocolType = "IPBased" + // ServerNameIndication ... + ServerNameIndication ProtocolType = "ServerNameIndication" +) + +// PossibleProtocolTypeValues returns an array of possible values for the ProtocolType const type. +func PossibleProtocolTypeValues() []ProtocolType { + return []ProtocolType{IPBased, ServerNameIndication} +} + +// QueryStringCachingBehavior enumerates the values for query string caching behavior. +type QueryStringCachingBehavior string + +const ( + // BypassCaching ... + BypassCaching QueryStringCachingBehavior = "BypassCaching" + // IgnoreQueryString ... + IgnoreQueryString QueryStringCachingBehavior = "IgnoreQueryString" + // NotSet ... + NotSet QueryStringCachingBehavior = "NotSet" + // UseQueryString ... + UseQueryString QueryStringCachingBehavior = "UseQueryString" +) + +// PossibleQueryStringCachingBehaviorValues returns an array of possible values for the QueryStringCachingBehavior const type. +func PossibleQueryStringCachingBehaviorValues() []QueryStringCachingBehavior { + return []QueryStringCachingBehavior{BypassCaching, IgnoreQueryString, NotSet, UseQueryString} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // MicrosoftCdnProfilesEndpoints ... + MicrosoftCdnProfilesEndpoints ResourceType = "Microsoft.Cdn/Profiles/Endpoints" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{MicrosoftCdnProfilesEndpoints} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // CustomVerizon ... + CustomVerizon SkuName = "Custom_Verizon" + // PremiumChinaCdn ... + PremiumChinaCdn SkuName = "Premium_ChinaCdn" + // PremiumVerizon ... + PremiumVerizon SkuName = "Premium_Verizon" + // StandardAkamai ... + StandardAkamai SkuName = "Standard_Akamai" + // StandardChinaCdn ... + StandardChinaCdn SkuName = "Standard_ChinaCdn" + // StandardMicrosoft ... + StandardMicrosoft SkuName = "Standard_Microsoft" + // StandardVerizon ... + StandardVerizon SkuName = "Standard_Verizon" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{CustomVerizon, PremiumChinaCdn, PremiumVerizon, StandardAkamai, StandardChinaCdn, StandardMicrosoft, StandardVerizon} +} diff --git a/services/cdn/mgmt/2017-10-12/cdn/models.go b/services/cdn/mgmt/2017-10-12/cdn/models.go index 6181e03ee133..dd71c674404f 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/models.go +++ b/services/cdn/mgmt/2017-10-12/cdn/models.go @@ -30,338 +30,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/cdn/mgmt/2017-10-12/cdn" -// CacheBehavior enumerates the values for cache behavior. -type CacheBehavior string - -const ( - // BypassCache ... - BypassCache CacheBehavior = "BypassCache" - // Override ... - Override CacheBehavior = "Override" - // SetIfMissing ... - SetIfMissing CacheBehavior = "SetIfMissing" -) - -// PossibleCacheBehaviorValues returns an array of possible values for the CacheBehavior const type. -func PossibleCacheBehaviorValues() []CacheBehavior { - return []CacheBehavior{BypassCache, Override, SetIfMissing} -} - -// CertificateSource enumerates the values for certificate source. -type CertificateSource string - -const ( - // CertificateSourceAzureKeyVault ... - CertificateSourceAzureKeyVault CertificateSource = "AzureKeyVault" - // CertificateSourceCdn ... - CertificateSourceCdn CertificateSource = "Cdn" - // CertificateSourceCustomDomainHTTPSParameters ... - CertificateSourceCustomDomainHTTPSParameters CertificateSource = "CustomDomainHttpsParameters" -) - -// PossibleCertificateSourceValues returns an array of possible values for the CertificateSource const type. -func PossibleCertificateSourceValues() []CertificateSource { - return []CertificateSource{CertificateSourceAzureKeyVault, CertificateSourceCdn, CertificateSourceCustomDomainHTTPSParameters} -} - -// CertificateType enumerates the values for certificate type. -type CertificateType string - -const ( - // Dedicated ... - Dedicated CertificateType = "Dedicated" - // Shared ... - Shared CertificateType = "Shared" -) - -// PossibleCertificateTypeValues returns an array of possible values for the CertificateType const type. -func PossibleCertificateTypeValues() []CertificateType { - return []CertificateType{Dedicated, Shared} -} - -// CustomDomainResourceState enumerates the values for custom domain resource state. -type CustomDomainResourceState string - -const ( - // Active ... - Active CustomDomainResourceState = "Active" - // Creating ... - Creating CustomDomainResourceState = "Creating" - // Deleting ... - Deleting CustomDomainResourceState = "Deleting" -) - -// PossibleCustomDomainResourceStateValues returns an array of possible values for the CustomDomainResourceState const type. -func PossibleCustomDomainResourceStateValues() []CustomDomainResourceState { - return []CustomDomainResourceState{Active, Creating, Deleting} -} - -// CustomHTTPSProvisioningState enumerates the values for custom https provisioning state. -type CustomHTTPSProvisioningState string - -const ( - // Disabled ... - Disabled CustomHTTPSProvisioningState = "Disabled" - // Disabling ... - Disabling CustomHTTPSProvisioningState = "Disabling" - // Enabled ... - Enabled CustomHTTPSProvisioningState = "Enabled" - // Enabling ... - Enabling CustomHTTPSProvisioningState = "Enabling" - // Failed ... - Failed CustomHTTPSProvisioningState = "Failed" -) - -// PossibleCustomHTTPSProvisioningStateValues returns an array of possible values for the CustomHTTPSProvisioningState const type. -func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState { - return []CustomHTTPSProvisioningState{Disabled, Disabling, Enabled, Enabling, Failed} -} - -// CustomHTTPSProvisioningSubstate enumerates the values for custom https provisioning substate. -type CustomHTTPSProvisioningSubstate string - -const ( - // CertificateDeleted ... - CertificateDeleted CustomHTTPSProvisioningSubstate = "CertificateDeleted" - // CertificateDeployed ... - CertificateDeployed CustomHTTPSProvisioningSubstate = "CertificateDeployed" - // DeletingCertificate ... - DeletingCertificate CustomHTTPSProvisioningSubstate = "DeletingCertificate" - // DeployingCertificate ... - DeployingCertificate CustomHTTPSProvisioningSubstate = "DeployingCertificate" - // DomainControlValidationRequestApproved ... - DomainControlValidationRequestApproved CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestApproved" - // DomainControlValidationRequestRejected ... - DomainControlValidationRequestRejected CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestRejected" - // DomainControlValidationRequestTimedOut ... - DomainControlValidationRequestTimedOut CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestTimedOut" - // IssuingCertificate ... - IssuingCertificate CustomHTTPSProvisioningSubstate = "IssuingCertificate" - // PendingDomainControlValidationREquestApproval ... - PendingDomainControlValidationREquestApproval CustomHTTPSProvisioningSubstate = "PendingDomainControlValidationREquestApproval" - // SubmittingDomainControlValidationRequest ... - SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = "SubmittingDomainControlValidationRequest" -) - -// PossibleCustomHTTPSProvisioningSubstateValues returns an array of possible values for the CustomHTTPSProvisioningSubstate const type. -func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate { - return []CustomHTTPSProvisioningSubstate{CertificateDeleted, CertificateDeployed, DeletingCertificate, DeployingCertificate, DomainControlValidationRequestApproved, DomainControlValidationRequestRejected, DomainControlValidationRequestTimedOut, IssuingCertificate, PendingDomainControlValidationREquestApproval, SubmittingDomainControlValidationRequest} -} - -// EndpointResourceState enumerates the values for endpoint resource state. -type EndpointResourceState string - -const ( - // EndpointResourceStateCreating ... - EndpointResourceStateCreating EndpointResourceState = "Creating" - // EndpointResourceStateDeleting ... - EndpointResourceStateDeleting EndpointResourceState = "Deleting" - // EndpointResourceStateRunning ... - EndpointResourceStateRunning EndpointResourceState = "Running" - // EndpointResourceStateStarting ... - EndpointResourceStateStarting EndpointResourceState = "Starting" - // EndpointResourceStateStopped ... - EndpointResourceStateStopped EndpointResourceState = "Stopped" - // EndpointResourceStateStopping ... - EndpointResourceStateStopping EndpointResourceState = "Stopping" -) - -// PossibleEndpointResourceStateValues returns an array of possible values for the EndpointResourceState const type. -func PossibleEndpointResourceStateValues() []EndpointResourceState { - return []EndpointResourceState{EndpointResourceStateCreating, EndpointResourceStateDeleting, EndpointResourceStateRunning, EndpointResourceStateStarting, EndpointResourceStateStopped, EndpointResourceStateStopping} -} - -// GeoFilterActions enumerates the values for geo filter actions. -type GeoFilterActions string - -const ( - // Allow ... - Allow GeoFilterActions = "Allow" - // Block ... - Block GeoFilterActions = "Block" -) - -// PossibleGeoFilterActionsValues returns an array of possible values for the GeoFilterActions const type. -func PossibleGeoFilterActionsValues() []GeoFilterActions { - return []GeoFilterActions{Allow, Block} -} - -// MatchType enumerates the values for match type. -type MatchType string - -const ( - // Literal ... - Literal MatchType = "Literal" - // Wildcard ... - Wildcard MatchType = "Wildcard" -) - -// PossibleMatchTypeValues returns an array of possible values for the MatchType const type. -func PossibleMatchTypeValues() []MatchType { - return []MatchType{Literal, Wildcard} -} - -// Name enumerates the values for name. -type Name string - -const ( - // NameCacheExpiration ... - NameCacheExpiration Name = "CacheExpiration" - // NameDeliveryRuleAction ... - NameDeliveryRuleAction Name = "DeliveryRuleAction" -) - -// PossibleNameValues returns an array of possible values for the Name const type. -func PossibleNameValues() []Name { - return []Name{NameCacheExpiration, NameDeliveryRuleAction} -} - -// NameBasicDeliveryRuleCondition enumerates the values for name basic delivery rule condition. -type NameBasicDeliveryRuleCondition string - -const ( - // NameDeliveryRuleCondition ... - NameDeliveryRuleCondition NameBasicDeliveryRuleCondition = "DeliveryRuleCondition" - // NameURLFileExtension ... - NameURLFileExtension NameBasicDeliveryRuleCondition = "UrlFileExtension" - // NameURLPath ... - NameURLPath NameBasicDeliveryRuleCondition = "UrlPath" -) - -// PossibleNameBasicDeliveryRuleConditionValues returns an array of possible values for the NameBasicDeliveryRuleCondition const type. -func PossibleNameBasicDeliveryRuleConditionValues() []NameBasicDeliveryRuleCondition { - return []NameBasicDeliveryRuleCondition{NameDeliveryRuleCondition, NameURLFileExtension, NameURLPath} -} - -// OptimizationType enumerates the values for optimization type. -type OptimizationType string - -const ( - // DynamicSiteAcceleration ... - DynamicSiteAcceleration OptimizationType = "DynamicSiteAcceleration" - // GeneralMediaStreaming ... - GeneralMediaStreaming OptimizationType = "GeneralMediaStreaming" - // GeneralWebDelivery ... - GeneralWebDelivery OptimizationType = "GeneralWebDelivery" - // LargeFileDownload ... - LargeFileDownload OptimizationType = "LargeFileDownload" - // VideoOnDemandMediaStreaming ... - VideoOnDemandMediaStreaming OptimizationType = "VideoOnDemandMediaStreaming" -) - -// PossibleOptimizationTypeValues returns an array of possible values for the OptimizationType const type. -func PossibleOptimizationTypeValues() []OptimizationType { - return []OptimizationType{DynamicSiteAcceleration, GeneralMediaStreaming, GeneralWebDelivery, LargeFileDownload, VideoOnDemandMediaStreaming} -} - -// OriginResourceState enumerates the values for origin resource state. -type OriginResourceState string - -const ( - // OriginResourceStateActive ... - OriginResourceStateActive OriginResourceState = "Active" - // OriginResourceStateCreating ... - OriginResourceStateCreating OriginResourceState = "Creating" - // OriginResourceStateDeleting ... - OriginResourceStateDeleting OriginResourceState = "Deleting" -) - -// PossibleOriginResourceStateValues returns an array of possible values for the OriginResourceState const type. -func PossibleOriginResourceStateValues() []OriginResourceState { - return []OriginResourceState{OriginResourceStateActive, OriginResourceStateCreating, OriginResourceStateDeleting} -} - -// ProfileResourceState enumerates the values for profile resource state. -type ProfileResourceState string - -const ( - // ProfileResourceStateActive ... - ProfileResourceStateActive ProfileResourceState = "Active" - // ProfileResourceStateCreating ... - ProfileResourceStateCreating ProfileResourceState = "Creating" - // ProfileResourceStateDeleting ... - ProfileResourceStateDeleting ProfileResourceState = "Deleting" - // ProfileResourceStateDisabled ... - ProfileResourceStateDisabled ProfileResourceState = "Disabled" -) - -// PossibleProfileResourceStateValues returns an array of possible values for the ProfileResourceState const type. -func PossibleProfileResourceStateValues() []ProfileResourceState { - return []ProfileResourceState{ProfileResourceStateActive, ProfileResourceStateCreating, ProfileResourceStateDeleting, ProfileResourceStateDisabled} -} - -// ProtocolType enumerates the values for protocol type. -type ProtocolType string - -const ( - // IPBased ... - IPBased ProtocolType = "IPBased" - // ServerNameIndication ... - ServerNameIndication ProtocolType = "ServerNameIndication" -) - -// PossibleProtocolTypeValues returns an array of possible values for the ProtocolType const type. -func PossibleProtocolTypeValues() []ProtocolType { - return []ProtocolType{IPBased, ServerNameIndication} -} - -// QueryStringCachingBehavior enumerates the values for query string caching behavior. -type QueryStringCachingBehavior string - -const ( - // BypassCaching ... - BypassCaching QueryStringCachingBehavior = "BypassCaching" - // IgnoreQueryString ... - IgnoreQueryString QueryStringCachingBehavior = "IgnoreQueryString" - // NotSet ... - NotSet QueryStringCachingBehavior = "NotSet" - // UseQueryString ... - UseQueryString QueryStringCachingBehavior = "UseQueryString" -) - -// PossibleQueryStringCachingBehaviorValues returns an array of possible values for the QueryStringCachingBehavior const type. -func PossibleQueryStringCachingBehaviorValues() []QueryStringCachingBehavior { - return []QueryStringCachingBehavior{BypassCaching, IgnoreQueryString, NotSet, UseQueryString} -} - -// ResourceType enumerates the values for resource type. -type ResourceType string - -const ( - // MicrosoftCdnProfilesEndpoints ... - MicrosoftCdnProfilesEndpoints ResourceType = "Microsoft.Cdn/Profiles/Endpoints" -) - -// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. -func PossibleResourceTypeValues() []ResourceType { - return []ResourceType{MicrosoftCdnProfilesEndpoints} -} - -// SkuName enumerates the values for sku name. -type SkuName string - -const ( - // CustomVerizon ... - CustomVerizon SkuName = "Custom_Verizon" - // PremiumChinaCdn ... - PremiumChinaCdn SkuName = "Premium_ChinaCdn" - // PremiumVerizon ... - PremiumVerizon SkuName = "Premium_Verizon" - // StandardAkamai ... - StandardAkamai SkuName = "Standard_Akamai" - // StandardChinaCdn ... - StandardChinaCdn SkuName = "Standard_ChinaCdn" - // StandardMicrosoft ... - StandardMicrosoft SkuName = "Standard_Microsoft" - // StandardVerizon ... - StandardVerizon SkuName = "Standard_Verizon" -) - -// PossibleSkuNameValues returns an array of possible values for the SkuName const type. -func PossibleSkuNameValues() []SkuName { - return []SkuName{CustomVerizon, PremiumChinaCdn, PremiumVerizon, StandardAkamai, StandardChinaCdn, StandardMicrosoft, StandardVerizon} -} - // CacheExpirationActionParameters defines the parameters for the cache expiration action. type CacheExpirationActionParameters struct { OdataType *string `json:"@odata.type,omitempty"` @@ -408,8 +76,8 @@ type CidrIPAddress struct { PrefixLength *int32 `json:"prefixLength,omitempty"` } -// CustomDomain friendly domain name mapping to the endpoint hostname that the customer provides for -// branding purposes, e.g. www.contoso.com. +// CustomDomain friendly domain name mapping to the endpoint hostname that the customer provides for branding +// purposes, e.g. www.contoso.com. type CustomDomain struct { autorest.Response `json:"-"` *CustomDomainProperties `json:"properties,omitempty"` @@ -580,6 +248,15 @@ type CustomDomainListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for CustomDomainListResult. +func (cdlr CustomDomainListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cdlr.NextLink != nil { + objectMap["nextLink"] = cdlr.NextLink + } + return json.Marshal(objectMap) +} + // CustomDomainListResultIterator provides access to a complete listing of CustomDomain values. type CustomDomainListResultIterator struct { i int @@ -648,10 +325,15 @@ func (cdlr CustomDomainListResult) IsEmpty() bool { return cdlr.Value == nil || len(*cdlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (cdlr CustomDomainListResult) hasNextLink() bool { + return cdlr.NextLink != nil && len(*cdlr.NextLink) != 0 +} + // customDomainListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (cdlr CustomDomainListResult) customDomainListResultPreparer(ctx context.Context) (*http.Request, error) { - if cdlr.NextLink == nil || len(to.String(cdlr.NextLink)) < 1 { + if !cdlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -679,11 +361,16 @@ func (page *CustomDomainListResultPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.cdlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.cdlr) + if err != nil { + return err + } + page.cdlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.cdlr = next return nil } @@ -771,6 +458,18 @@ type CustomDomainProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for CustomDomainProperties. +func (cdp CustomDomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cdp.HostName != nil { + objectMap["hostName"] = cdp.HostName + } + if cdp.ValidationData != nil { + objectMap["validationData"] = cdp.ValidationData + } + return json.Marshal(objectMap) +} + // CustomDomainPropertiesParameters the JSON object that contains the properties of the custom domain to // create. type CustomDomainPropertiesParameters struct { @@ -1301,8 +1000,8 @@ type EdgeNodeProperties struct { IPAddressGroups *[]IPAddressGroup `json:"ipAddressGroups,omitempty"` } -// EdgenodeResult result of the request to list CDN edgenodes. It contains a list of ip address group and a -// URL link to get the next set of results. +// EdgenodeResult result of the request to list CDN edgenodes. It contains a list of ip address group and a URL +// link to get the next set of results. type EdgenodeResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; Edge node of CDN service. @@ -1311,6 +1010,15 @@ type EdgenodeResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for EdgenodeResult. +func (er EdgenodeResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if er.NextLink != nil { + objectMap["nextLink"] = er.NextLink + } + return json.Marshal(objectMap) +} + // EdgenodeResultIterator provides access to a complete listing of EdgeNode values. type EdgenodeResultIterator struct { i int @@ -1379,10 +1087,15 @@ func (er EdgenodeResult) IsEmpty() bool { return er.Value == nil || len(*er.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (er EdgenodeResult) hasNextLink() bool { + return er.NextLink != nil && len(*er.NextLink) != 0 +} + // edgenodeResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (er EdgenodeResult) edgenodeResultPreparer(ctx context.Context) (*http.Request, error) { - if er.NextLink == nil || len(to.String(er.NextLink)) < 1 { + if !er.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1410,11 +1123,16 @@ func (page *EdgenodeResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.er) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.er) + if err != nil { + return err + } + page.er = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.er = next return nil } @@ -1550,8 +1268,8 @@ func (e *Endpoint) UnmarshalJSON(body []byte) error { return nil } -// EndpointListResult result of the request to list endpoints. It contains a list of endpoint objects and a -// URL link to get the next set of results. +// EndpointListResult result of the request to list endpoints. It contains a list of endpoint objects and a URL +// link to get the next set of results. type EndpointListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; List of CDN endpoints within a profile @@ -1560,6 +1278,15 @@ type EndpointListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for EndpointListResult. +func (elr EndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if elr.NextLink != nil { + objectMap["nextLink"] = elr.NextLink + } + return json.Marshal(objectMap) +} + // EndpointListResultIterator provides access to a complete listing of Endpoint values. type EndpointListResultIterator struct { i int @@ -1628,10 +1355,15 @@ func (elr EndpointListResult) IsEmpty() bool { return elr.Value == nil || len(*elr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (elr EndpointListResult) hasNextLink() bool { + return elr.NextLink != nil && len(*elr.NextLink) != 0 +} + // endpointListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (elr EndpointListResult) endpointListResultPreparer(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), @@ -1659,11 +1391,16 @@ func (page *EndpointListResultPage) NextWithContext(ctx context.Context) (err er 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 } @@ -1731,6 +1468,48 @@ type EndpointProperties struct { DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` } +// MarshalJSON is the custom marshaler for EndpointProperties. +func (ep EndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ep.Origins != nil { + objectMap["origins"] = ep.Origins + } + if ep.OriginHostHeader != nil { + objectMap["originHostHeader"] = ep.OriginHostHeader + } + if ep.OriginPath != nil { + objectMap["originPath"] = ep.OriginPath + } + if ep.ContentTypesToCompress != nil { + objectMap["contentTypesToCompress"] = ep.ContentTypesToCompress + } + if ep.IsCompressionEnabled != nil { + objectMap["isCompressionEnabled"] = ep.IsCompressionEnabled + } + if ep.IsHTTPAllowed != nil { + objectMap["isHttpAllowed"] = ep.IsHTTPAllowed + } + if ep.IsHTTPSAllowed != nil { + objectMap["isHttpsAllowed"] = ep.IsHTTPSAllowed + } + if ep.QueryStringCachingBehavior != "" { + objectMap["queryStringCachingBehavior"] = ep.QueryStringCachingBehavior + } + if ep.OptimizationType != "" { + objectMap["optimizationType"] = ep.OptimizationType + } + if ep.ProbePath != nil { + objectMap["probePath"] = ep.ProbePath + } + if ep.GeoFilters != nil { + objectMap["geoFilters"] = ep.GeoFilters + } + if ep.DeliveryPolicy != nil { + objectMap["deliveryPolicy"] = ep.DeliveryPolicy + } + return json.Marshal(objectMap) +} + // EndpointPropertiesUpdateParameters the JSON object containing endpoint update parameters. type EndpointPropertiesUpdateParameters struct { // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. @@ -1757,8 +1536,8 @@ type EndpointPropertiesUpdateParameters struct { DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` } -// EndpointPropertiesUpdateParametersDeliveryPolicy a policy that specifies the delivery rules to be used -// for an endpoint. +// EndpointPropertiesUpdateParametersDeliveryPolicy a policy that specifies the delivery rules to be used for +// an endpoint. type EndpointPropertiesUpdateParametersDeliveryPolicy struct { // Description - User-friendly description of the policy. Description *string `json:"description,omitempty"` @@ -1766,8 +1545,7 @@ type EndpointPropertiesUpdateParametersDeliveryPolicy struct { Rules *[]DeliveryRule `json:"rules,omitempty"` } -// EndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// EndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type EndpointsCreateFuture struct { azure.Future } @@ -1795,8 +1573,7 @@ func (future *EndpointsCreateFuture) Result(client EndpointsClient) (e Endpoint, return } -// EndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// EndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type EndpointsDeleteFuture struct { azure.Future } @@ -1864,8 +1641,7 @@ func (future *EndpointsPurgeContentFuture) Result(client EndpointsClient) (ar au return } -// EndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// EndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running operation. type EndpointsStartFuture struct { azure.Future } @@ -1893,8 +1669,7 @@ func (future *EndpointsStartFuture) Result(client EndpointsClient) (e Endpoint, return } -// EndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// EndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. type EndpointsStopFuture struct { azure.Future } @@ -1922,8 +1697,7 @@ func (future *EndpointsStopFuture) Result(client EndpointsClient) (e Endpoint, e return } -// EndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// EndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type EndpointsUpdateFuture struct { azure.Future } @@ -2003,8 +1777,8 @@ func (eup *EndpointUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// ErrorResponse error response indicates CDN service is not able to process the incoming request. The -// reason is provided in the error message. +// ErrorResponse error response indicates CDN service is not able to process the incoming request. The reason +// is provided in the error message. type ErrorResponse struct { // Code - READ-ONLY; Error code. Code *string `json:"code,omitempty"` @@ -2058,8 +1832,8 @@ type LoadParameters struct { ContentPaths *[]string `json:"contentPaths,omitempty"` } -// ManagedHTTPSParameters defines the certificate source parameters using CDN managed certificate for -// enabling SSL. +// ManagedHTTPSParameters defines the certificate source parameters using CDN managed certificate for enabling +// SSL. type ManagedHTTPSParameters struct { // CertificateSourceParameters - Defines the certificate source parameters using CDN managed certificate for enabling SSL. CertificateSourceParameters *CertificateSourceParameters `json:"certificateSourceParameters,omitempty"` @@ -2113,6 +1887,15 @@ type Operation struct { Display *OperationDisplay `json:"display,omitempty"` } +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Display != nil { + objectMap["display"] = o.Display + } + return json.Marshal(objectMap) +} + // OperationDisplay the object that represents the operation. type OperationDisplay struct { // Provider - READ-ONLY; Service provider: Microsoft.Cdn @@ -2123,8 +1906,8 @@ type OperationDisplay struct { Operation *string `json:"operation,omitempty"` } -// OperationsListResult result of the request to list CDN operations. It contains a list of operations and -// a URL link to get the next set of results. +// OperationsListResult result of the request to list CDN operations. It contains a list of operations and a +// URL link to get the next set of results. type OperationsListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; List of CDN operations supported by the CDN resource provider. @@ -2133,6 +1916,15 @@ type OperationsListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for OperationsListResult. +func (olr OperationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if olr.NextLink != nil { + objectMap["nextLink"] = olr.NextLink + } + return json.Marshal(objectMap) +} + // OperationsListResultIterator provides access to a complete listing of Operation values. type OperationsListResultIterator struct { i int @@ -2201,10 +1993,15 @@ func (olr OperationsListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationsListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // operationsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OperationsListResult) operationsListResultPreparer(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), @@ -2232,11 +2029,16 @@ func (page *OperationsListResultPage) NextWithContext(ctx context.Context) (err 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 } @@ -2270,9 +2072,9 @@ func NewOperationsListResultPage(getNextPage func(context.Context, OperationsLis return OperationsListResultPage{fn: getNextPage} } -// Origin CDN origin is the source of the content being delivered via CDN. When the edge nodes represented -// by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of -// the configured origins. +// Origin CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by +// an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the +// configured origins. type Origin struct { autorest.Response `json:"-"` *OriginProperties `json:"properties,omitempty"` @@ -2372,8 +2174,8 @@ func (o *Origin) UnmarshalJSON(body []byte) error { return nil } -// OriginListResult result of the request to list origins. It contains a list of origin objects and a URL -// link to get the next set of results. +// OriginListResult result of the request to list origins. It contains a list of origin objects and a URL link +// to get the next set of results. type OriginListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; List of CDN origins within an endpoint @@ -2382,6 +2184,15 @@ type OriginListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for OriginListResult. +func (olr OriginListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if olr.NextLink != nil { + objectMap["nextLink"] = olr.NextLink + } + return json.Marshal(objectMap) +} + // OriginListResultIterator provides access to a complete listing of Origin values. type OriginListResultIterator struct { i int @@ -2450,10 +2261,15 @@ func (olr OriginListResult) IsEmpty() bool { return olr.Value == nil || len(*olr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (olr OriginListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + // originListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (olr OriginListResult) originListResultPreparer(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), @@ -2481,11 +2297,16 @@ func (page *OriginListResultPage) NextWithContext(ctx context.Context) (err erro 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 } @@ -2533,6 +2354,21 @@ type OriginProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } +// MarshalJSON is the custom marshaler for OriginProperties. +func (op OriginProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if op.HostName != nil { + objectMap["hostName"] = op.HostName + } + if op.HTTPPort != nil { + objectMap["httpPort"] = op.HTTPPort + } + if op.HTTPSPort != nil { + objectMap["httpsPort"] = op.HTTPSPort + } + return json.Marshal(objectMap) +} + // OriginPropertiesParameters the JSON object that contains the properties of the origin. type OriginPropertiesParameters struct { // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported. @@ -2543,8 +2379,7 @@ type OriginPropertiesParameters struct { HTTPSPort *int32 `json:"httpsPort,omitempty"` } -// OriginsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// OriginsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type OriginsUpdateFuture struct { azure.Future } @@ -2610,8 +2445,8 @@ func (oup *OriginUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// Profile CDN profile is a logical grouping of endpoints that share the same settings, such as CDN -// provider and pricing tier. +// Profile CDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider +// and pricing tier. type Profile struct { autorest.Response `json:"-"` // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. @@ -2725,8 +2560,8 @@ func (p *Profile) UnmarshalJSON(body []byte) error { return nil } -// ProfileListResult result of the request to list profiles. It contains a list of profile objects and a -// URL link to get the next set of results. +// ProfileListResult result of the request to list profiles. It contains a list of profile objects and a URL +// link to get the next set of results. type ProfileListResult struct { autorest.Response `json:"-"` // Value - READ-ONLY; List of CDN profiles within a resource group. @@ -2735,6 +2570,15 @@ type ProfileListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ProfileListResult. +func (plr ProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.NextLink != nil { + objectMap["nextLink"] = plr.NextLink + } + return json.Marshal(objectMap) +} + // ProfileListResultIterator provides access to a complete listing of Profile values. type ProfileListResultIterator struct { i int @@ -2803,10 +2647,15 @@ func (plr ProfileListResult) IsEmpty() bool { return plr.Value == nil || len(*plr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (plr ProfileListResult) hasNextLink() bool { + return plr.NextLink != nil && len(*plr.NextLink) != 0 +} + // profileListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { - if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + if !plr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -2834,11 +2683,16 @@ func (page *ProfileListResultPage) NextWithContext(ctx context.Context) (err err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.plr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.plr = next return nil } @@ -2880,8 +2734,7 @@ type ProfileProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ProfilesCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ProfilesCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ProfilesCreateFuture struct { azure.Future } @@ -2909,8 +2762,7 @@ func (future *ProfilesCreateFuture) Result(client ProfilesClient) (p Profile, er return } -// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ProfilesDeleteFuture struct { azure.Future } @@ -2932,8 +2784,7 @@ func (future *ProfilesDeleteFuture) Result(client ProfilesClient) (ar autorest.R return } -// ProfilesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// ProfilesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. type ProfilesUpdateFuture struct { azure.Future } @@ -3024,6 +2875,15 @@ type ResourceUsageListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// MarshalJSON is the custom marshaler for ResourceUsageListResult. +func (rulr ResourceUsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rulr.NextLink != nil { + objectMap["nextLink"] = rulr.NextLink + } + return json.Marshal(objectMap) +} + // ResourceUsageListResultIterator provides access to a complete listing of ResourceUsage values. type ResourceUsageListResultIterator struct { i int @@ -3092,10 +2952,15 @@ func (rulr ResourceUsageListResult) IsEmpty() bool { return rulr.Value == nil || len(*rulr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (rulr ResourceUsageListResult) hasNextLink() bool { + return rulr.NextLink != nil && len(*rulr.NextLink) != 0 +} + // resourceUsageListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (rulr ResourceUsageListResult) resourceUsageListResultPreparer(ctx context.Context) (*http.Request, error) { - if rulr.NextLink == nil || len(to.String(rulr.NextLink)) < 1 { + if !rulr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -3123,11 +2988,16 @@ func (page *ResourceUsageListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.rulr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.rulr) + if err != nil { + return err + } + page.rulr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.rulr = next return nil } @@ -3223,8 +3093,8 @@ type URLPathConditionParameters struct { MatchType MatchType `json:"matchType,omitempty"` } -// UserManagedHTTPSParameters defines the certificate source parameters using user's keyvault certificate -// for enabling SSL. +// UserManagedHTTPSParameters defines the certificate source parameters using user's keyvault certificate for +// enabling SSL. type UserManagedHTTPSParameters struct { // CertificateSourceParameters - Defines the certificate source parameters using user's keyvault certificate for enabling SSL. CertificateSourceParameters *KeyVaultCertificateSourceParameters `json:"certificateSourceParameters,omitempty"` diff --git a/services/cdn/mgmt/2017-10-12/cdn/operations.go b/services/cdn/mgmt/2017-10-12/cdn/operations.go index d52e1b598621..bbf8bb083055 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/operations.go +++ b/services/cdn/mgmt/2017-10-12/cdn/operations.go @@ -71,6 +71,9 @@ func (client OperationsClient) List(ctx context.Context) (result OperationsListR if err != nil { err = autorest.NewErrorWithError(err, "cdn.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 OperationsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/cdn/mgmt/2017-10-12/cdn/origins.go b/services/cdn/mgmt/2017-10-12/cdn/origins.go index 05c6870b8776..b01bc72f79c6 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/origins.go +++ b/services/cdn/mgmt/2017-10-12/cdn/origins.go @@ -122,7 +122,6 @@ func (client OriginsClient) GetSender(req *http.Request) (*http.Response, error) func (client OriginsClient) GetResponder(resp *http.Response) (result Origin, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -172,6 +171,9 @@ func (client OriginsClient) ListByEndpoint(ctx context.Context, resourceGroupNam if err != nil { err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", resp, "Failure responding to request") } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -209,7 +211,6 @@ func (client OriginsClient) ListByEndpointSender(req *http.Request) (*http.Respo func (client OriginsClient) ListByEndpointResponder(resp *http.Response) (result OriginListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -337,7 +338,6 @@ func (client OriginsClient) UpdateSender(req *http.Request) (future OriginsUpdat func (client OriginsClient) UpdateResponder(resp *http.Response) (result Origin, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/cdn/mgmt/2017-10-12/cdn/profiles.go b/services/cdn/mgmt/2017-10-12/cdn/profiles.go index 12e0133d785a..de718de8621a 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/profiles.go +++ b/services/cdn/mgmt/2017-10-12/cdn/profiles.go @@ -123,7 +123,6 @@ func (client ProfilesClient) CreateSender(req *http.Request) (future ProfilesCre func (client ProfilesClient) CreateResponder(resp *http.Response) (result Profile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -208,7 +207,6 @@ func (client ProfilesClient) DeleteSender(req *http.Request) (future ProfilesDel func (client ProfilesClient) 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 @@ -294,7 +292,6 @@ func (client ProfilesClient) GenerateSsoURISender(req *http.Request) (*http.Resp func (client ProfilesClient) GenerateSsoURIResponder(resp *http.Response) (result SsoURI, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -378,7 +375,6 @@ func (client ProfilesClient) GetSender(req *http.Request) (*http.Response, error func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -416,6 +412,9 @@ func (client ProfilesClient) List(ctx context.Context) (result ProfileListResult if err != nil { err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", resp, "Failure responding to request") } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -450,7 +449,6 @@ func (client ProfilesClient) ListSender(req *http.Request) (*http.Response, erro func (client ProfilesClient) ListResponder(resp *http.Response) (result ProfileListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -535,6 +533,9 @@ func (client ProfilesClient) ListByResourceGroup(ctx context.Context, resourceGr if err != nil { err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", resp, "Failure responding to request") } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -570,7 +571,6 @@ func (client ProfilesClient) ListByResourceGroupSender(req *http.Request) (*http func (client ProfilesClient) ListByResourceGroupResponder(resp *http.Response) (result ProfileListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -656,6 +656,9 @@ func (client ProfilesClient) ListResourceUsage(ctx context.Context, resourceGrou if err != nil { err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListResourceUsage", resp, "Failure responding to request") } + if result.rulr.hasNextLink() && result.rulr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -692,7 +695,6 @@ func (client ProfilesClient) ListResourceUsageSender(req *http.Request) (*http.R func (client ProfilesClient) ListResourceUsageResponder(resp *http.Response) (result ResourceUsageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -814,7 +816,6 @@ func (client ProfilesClient) ListSupportedOptimizationTypesSender(req *http.Requ func (client ProfilesClient) ListSupportedOptimizationTypesResponder(resp *http.Response) (result SupportedOptimizationTypesListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -902,7 +903,6 @@ func (client ProfilesClient) UpdateSender(req *http.Request) (future ProfilesUpd func (client ProfilesClient) UpdateResponder(resp *http.Response) (result Profile, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/cdn/mgmt/2017-10-12/cdn/resourceusage.go b/services/cdn/mgmt/2017-10-12/cdn/resourceusage.go index 71ae8646fd8f..3af752e71298 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/resourceusage.go +++ b/services/cdn/mgmt/2017-10-12/cdn/resourceusage.go @@ -71,6 +71,9 @@ func (client ResourceUsageClient) List(ctx context.Context) (result ResourceUsag if err != nil { err = autorest.NewErrorWithError(err, "cdn.ResourceUsageClient", "List", resp, "Failure responding to request") } + if result.rulr.hasNextLink() && result.rulr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -105,7 +108,6 @@ func (client ResourceUsageClient) ListSender(req *http.Request) (*http.Response, func (client ResourceUsageClient) ListResponder(resp *http.Response) (result ResourceUsageListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/cdn/mgmt/2017-10-12/cdn/version.go b/services/cdn/mgmt/2017-10-12/cdn/version.go index f6472564e13c..e06174c4e839 100644 --- a/services/cdn/mgmt/2017-10-12/cdn/version.go +++ b/services/cdn/mgmt/2017-10-12/cdn/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 + " cdn/2017-10-12" + return "Azure-SDK-For-Go/" + Version() + " cdn/2017-10-12" } // Version returns the semantic version (see http://semver.org) of the client.