diff --git a/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md b/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md index afc785f5bf48..1cb54acaa527 100644 --- a/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md +++ b/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md @@ -1,5 +1,163 @@ # Release History +## 3.0.0 (2025-05-12) +### Breaking Changes + +- Type of `CacheExpirationActionParameters.TypeName` has been changed from `*CacheExpirationActionParametersTypeName` to `*DeliveryRuleActionParametersType` +- Type of `CacheKeyQueryStringActionParameters.TypeName` has been changed from `*CacheKeyQueryStringActionParametersTypeName` to `*DeliveryRuleActionParametersType` +- Type of `CertificateSourceParameters.TypeName` has been changed from `*CdnCertificateSourceParametersTypeName` to `*CertificateSourceParametersType` +- Type of `ClientPortMatchConditionParameters.TypeName` has been changed from `*ClientPortMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `CookiesMatchConditionParameters.TypeName` has been changed from `*CookiesMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `DeliveryRule.Actions` has been changed from `[]DeliveryRuleActionAutoGeneratedClassification` to `[]DeliveryRuleActionClassification` +- Type of `DeliveryRuleCacheExpirationAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `DeliveryRuleCacheKeyQueryStringAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `DeliveryRuleRequestHeaderAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `DeliveryRuleResponseHeaderAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `DeliveryRuleRouteConfigurationOverrideAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `HTTPVersionMatchConditionParameters.TypeName` has been changed from `*HTTPVersionMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `HeaderActionParameters.TypeName` has been changed from `*HeaderActionParametersTypeName` to `*DeliveryRuleActionParametersType` +- Type of `HostNameMatchConditionParameters.TypeName` has been changed from `*HostNameMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `IsDeviceMatchConditionParameters.MatchValues` has been changed from `[]*IsDeviceMatchConditionParametersMatchValuesItem` to `[]*IsDeviceMatchValue` +- Type of `IsDeviceMatchConditionParameters.TypeName` has been changed from `*IsDeviceMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `KeyVaultCertificateSourceParameters.TypeName` has been changed from `*KeyVaultCertificateSourceParametersTypeName` to `*CertificateSourceParametersType` +- Type of `KeyVaultSigningKeyParameters.TypeName` has been changed from `*KeyVaultSigningKeyParametersTypeName` to `*KeyVaultSigningKeyParametersType` +- Type of `OriginGroupOverrideAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `OriginGroupOverrideActionParameters.TypeName` has been changed from `*OriginGroupOverrideActionParametersTypeName` to `*DeliveryRuleActionParametersType` +- Type of `PostArgsMatchConditionParameters.TypeName` has been changed from `*PostArgsMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `QueryStringMatchConditionParameters.TypeName` has been changed from `*QueryStringMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `RemoteAddressMatchConditionParameters.TypeName` has been changed from `*RemoteAddressMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `RequestBodyMatchConditionParameters.TypeName` has been changed from `*RequestBodyMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `RequestHeaderMatchConditionParameters.TypeName` has been changed from `*RequestHeaderMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `RequestMethodMatchConditionParameters.MatchValues` has been changed from `[]*RequestMethodMatchConditionParametersMatchValuesItem` to `[]*RequestMethodMatchValue` +- Type of `RequestMethodMatchConditionParameters.TypeName` has been changed from `*RequestMethodMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `RequestSchemeMatchConditionParameters.MatchValues` has been changed from `[]*RequestSchemeMatchConditionParametersMatchValuesItem` to `[]*RequestSchemeMatchValue` +- Type of `RequestSchemeMatchConditionParameters.TypeName` has been changed from `*RequestSchemeMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `RequestURIMatchConditionParameters.TypeName` has been changed from `*RequestURIMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `RouteConfigurationOverrideActionParameters.TypeName` has been changed from `*RouteConfigurationOverrideActionParametersTypeName` to `*DeliveryRuleActionParametersType` +- Type of `RuleProperties.Actions` has been changed from `[]DeliveryRuleActionAutoGeneratedClassification` to `[]DeliveryRuleActionClassification` +- Type of `RuleUpdatePropertiesParameters.Actions` has been changed from `[]DeliveryRuleActionAutoGeneratedClassification` to `[]DeliveryRuleActionClassification` +- Type of `SSLProtocolMatchConditionParameters.TypeName` has been changed from `*SSLProtocolMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `ServerPortMatchConditionParameters.TypeName` has been changed from `*ServerPortMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `SocketAddrMatchConditionParameters.TypeName` has been changed from `*SocketAddrMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `URLFileExtensionMatchConditionParameters.TypeName` has been changed from `*URLFileExtensionMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `URLFileNameMatchConditionParameters.TypeName` has been changed from `*URLFileNameMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `URLPathMatchConditionParameters.TypeName` has been changed from `*URLPathMatchConditionParametersTypeName` to `*DeliveryRuleConditionParametersType` +- Type of `URLRedirectAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `URLRedirectActionParameters.TypeName` has been changed from `*URLRedirectActionParametersTypeName` to `*DeliveryRuleActionParametersType` +- Type of `URLRewriteAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `URLRewriteActionParameters.TypeName` has been changed from `*URLRewriteActionParametersTypeName` to `*DeliveryRuleActionParametersType` +- Type of `URLSigningAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `URLSigningActionParameters.TypeName` has been changed from `*URLSigningActionParametersTypeName` to `*DeliveryRuleActionParametersType` +- Enum `CacheExpirationActionParametersTypeName` has been removed +- Enum `CacheKeyQueryStringActionParametersTypeName` has been removed +- Enum `CdnCertificateSourceParametersTypeName` has been removed +- Enum `ClientPortMatchConditionParametersTypeName` has been removed +- Enum `CookiesMatchConditionParametersTypeName` has been removed +- Enum `DeliveryRuleAction` has been removed +- Enum `HTTPVersionMatchConditionParametersTypeName` has been removed +- Enum `HeaderActionParametersTypeName` has been removed +- Enum `HostNameMatchConditionParametersTypeName` has been removed +- Enum `IsDeviceMatchConditionParametersMatchValuesItem` has been removed +- Enum `IsDeviceMatchConditionParametersTypeName` has been removed +- Enum `KeyVaultCertificateSourceParametersTypeName` has been removed +- Enum `KeyVaultSigningKeyParametersTypeName` has been removed +- Enum `OriginGroupOverrideActionParametersTypeName` has been removed +- Enum `PostArgsMatchConditionParametersTypeName` has been removed +- Enum `QueryStringMatchConditionParametersTypeName` has been removed +- Enum `RemoteAddressMatchConditionParametersTypeName` has been removed +- Enum `RequestBodyMatchConditionParametersTypeName` has been removed +- Enum `RequestHeaderMatchConditionParametersTypeName` has been removed +- Enum `RequestMethodMatchConditionParametersMatchValuesItem` has been removed +- Enum `RequestMethodMatchConditionParametersTypeName` has been removed +- Enum `RequestSchemeMatchConditionParametersMatchValuesItem` has been removed +- Enum `RequestSchemeMatchConditionParametersTypeName` has been removed +- Enum `RequestURIMatchConditionParametersTypeName` has been removed +- Enum `RouteConfigurationOverrideActionParametersTypeName` has been removed +- Enum `SSLProtocolMatchConditionParametersTypeName` has been removed +- Enum `ServerPortMatchConditionParametersTypeName` has been removed +- Enum `SocketAddrMatchConditionParametersTypeName` has been removed +- Enum `URLFileExtensionMatchConditionParametersTypeName` has been removed +- Enum `URLFileNameMatchConditionParametersTypeName` has been removed +- Enum `URLPathMatchConditionParametersTypeName` has been removed +- Enum `URLRedirectActionParametersTypeName` has been removed +- Enum `URLRewriteActionParametersTypeName` has been removed +- Enum `URLSigningActionParametersTypeName` has been removed +- Function `*DeliveryRuleActionAutoGenerated.GetDeliveryRuleActionAutoGenerated` has been removed +- Function `*DeliveryRuleCacheExpirationAction.GetDeliveryRuleActionAutoGenerated` has been removed +- Function `*DeliveryRuleCacheKeyQueryStringAction.GetDeliveryRuleActionAutoGenerated` has been removed +- Function `*DeliveryRuleRequestHeaderAction.GetDeliveryRuleActionAutoGenerated` has been removed +- Function `*DeliveryRuleResponseHeaderAction.GetDeliveryRuleActionAutoGenerated` has been removed +- Function `*DeliveryRuleRouteConfigurationOverrideAction.GetDeliveryRuleActionAutoGenerated` has been removed +- Function `*OriginGroupOverrideAction.GetDeliveryRuleActionAutoGenerated` has been removed +- Function `*URLRedirectAction.GetDeliveryRuleActionAutoGenerated` has been removed +- Function `*URLRewriteAction.GetDeliveryRuleActionAutoGenerated` has been removed +- Function `*URLSigningAction.GetDeliveryRuleActionAutoGenerated` has been removed + +### Features Added + +- New value `AfdMinimumTLSVersionTLS13` added to enum type `AfdMinimumTLSVersion` +- New enum type `AfdCipherSuiteSetType` with values `AfdCipherSuiteSetTypeCustomized`, `AfdCipherSuiteSetTypeTLS102019`, `AfdCipherSuiteSetTypeTLS122022`, `AfdCipherSuiteSetTypeTLS122023` +- New enum type `AfdCustomizedCipherSuiteForTls12` with values `AfdCustomizedCipherSuiteForTls12DHERSAAES128GCMSHA256`, `AfdCustomizedCipherSuiteForTls12DHERSAAES256GCMSHA384`, `AfdCustomizedCipherSuiteForTls12ECDHERSAAES128GCMSHA256`, `AfdCustomizedCipherSuiteForTls12ECDHERSAAES128SHA256`, `AfdCustomizedCipherSuiteForTls12ECDHERSAAES256GCMSHA384`, `AfdCustomizedCipherSuiteForTls12ECDHERSAAES256SHA384` +- New enum type `AfdCustomizedCipherSuiteForTls13` with values `AfdCustomizedCipherSuiteForTls13TLSAES128GCMSHA256`, `AfdCustomizedCipherSuiteForTls13TLSAES256GCMSHA384` +- New enum type `CertificateSourceParametersType` with values `CertificateSourceParametersTypeCdnCertificateSourceParameters`, `CertificateSourceParametersTypeKeyVaultCertificateSourceParameters` +- New enum type `DeliveryRuleActionName` with values `DeliveryRuleActionNameCacheExpiration`, `DeliveryRuleActionNameCacheKeyQueryString`, `DeliveryRuleActionNameModifyRequestHeader`, `DeliveryRuleActionNameModifyResponseHeader`, `DeliveryRuleActionNameOriginGroupOverride`, `DeliveryRuleActionNameRouteConfigurationOverride`, `DeliveryRuleActionNameURLRedirect`, `DeliveryRuleActionNameURLRewrite`, `DeliveryRuleActionNameURLSigning` +- New enum type `DeliveryRuleActionParametersType` with values `DeliveryRuleActionParametersTypeDeliveryRuleCacheExpirationActionParameters`, `DeliveryRuleActionParametersTypeDeliveryRuleCacheKeyQueryStringBehaviorActionParameters`, `DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters`, `DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters`, `DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters`, `DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters`, `DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters`, `DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters` +- New enum type `DeliveryRuleConditionParametersType` with values `DeliveryRuleConditionParametersTypeDeliveryRuleClientPortConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleCookiesConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleHTTPVersionConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleHostNameConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleIsDeviceConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRulePostArgsConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleQueryStringConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleRemoteAddressConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleRequestBodyConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleRequestHeaderConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleRequestMethodConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleRequestSchemeConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleRequestURIConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleSSLProtocolConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters`, `DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters` +- New enum type `IsDeviceMatchValue` with values `IsDeviceMatchValueDesktop`, `IsDeviceMatchValueMobile` +- New enum type `KeyVaultSigningKeyParametersType` with values `KeyVaultSigningKeyParametersTypeKeyVaultSigningKeyParameters` +- New enum type `RequestMethodMatchValue` with values `RequestMethodMatchValueDELETE`, `RequestMethodMatchValueGET`, `RequestMethodMatchValueHEAD`, `RequestMethodMatchValueOPTIONS`, `RequestMethodMatchValuePOST`, `RequestMethodMatchValuePUT`, `RequestMethodMatchValueTRACE` +- New enum type `RequestSchemeMatchValue` with values `RequestSchemeMatchValueHTTP`, `RequestSchemeMatchValueHTTPS` +- New function `*CacheExpirationActionParameters.GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters` +- New function `*CacheKeyQueryStringActionParameters.GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters` +- New function `*CertificateSourceParameters.GetCertificateSourceParametersBase() *CertificateSourceParametersBase` +- New function `*CertificateSourceParametersBase.GetCertificateSourceParametersBase() *CertificateSourceParametersBase` +- New function `*ClientPortMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*CookiesMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*DeliveryRuleAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleActionParameters.GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters` +- New function `*DeliveryRuleCacheExpirationAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleCacheKeyQueryStringAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*DeliveryRuleRequestHeaderAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleResponseHeaderAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleRouteConfigurationOverrideAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*HTTPVersionMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*HeaderActionParameters.GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters` +- New function `*HostNameMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*IsDeviceMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*KeyVaultCertificateSourceParameters.GetCertificateSourceParametersBase() *CertificateSourceParametersBase` +- New function `*OriginGroupOverrideAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*OriginGroupOverrideActionParameters.GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters` +- New function `*PostArgsMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*ProfilesClient.BeginCdnCanMigrateToAfd(context.Context, string, string, *ProfilesClientBeginCdnCanMigrateToAfdOptions) (*runtime.Poller[ProfilesClientCdnCanMigrateToAfdResponse], error)` +- New function `*ProfilesClient.BeginCdnMigrateToAfd(context.Context, string, string, MigrationToAfdParameters, *ProfilesClientBeginCdnMigrateToAfdOptions) (*runtime.Poller[ProfilesClientCdnMigrateToAfdResponse], error)` +- New function `*ProfilesClient.BeginMigrationAbort(context.Context, string, string, *ProfilesClientBeginMigrationAbortOptions) (*runtime.Poller[ProfilesClientMigrationAbortResponse], error)` +- New function `*QueryStringMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*RemoteAddressMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*RequestBodyMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*RequestHeaderMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*RequestMethodMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*RequestSchemeMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*RequestURIMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*RouteConfigurationOverrideActionParameters.GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters` +- New function `*SSLProtocolMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*ServerPortMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*SocketAddrMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*URLFileExtensionMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*URLFileNameMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*URLPathMatchConditionParameters.GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters` +- New function `*URLRedirectAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*URLRedirectActionParameters.GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters` +- New function `*URLRewriteAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*URLRewriteActionParameters.GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters` +- New function `*URLSigningAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*URLSigningActionParameters.GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters` +- New struct `AFDDomainHTTPSCustomizedCipherSuiteSet` +- New struct `MigrationEndpointMapping` +- New struct `MigrationToAfdParameters` +- New field `CipherSuiteSetType`, `CustomizedCipherSuiteSet` in struct `AFDDomainHTTPSParameters` + + ## 2.2.0 (2024-04-26) ### Features Added diff --git a/sdk/resourcemanager/cdn/armcdn/README.md b/sdk/resourcemanager/cdn/armcdn/README.md index d03ad4a68884..6769bdc67fdd 100644 --- a/sdk/resourcemanager/cdn/armcdn/README.md +++ b/sdk/resourcemanager/cdn/armcdn/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Content Delivery Network module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3 ``` ## Authorization diff --git a/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go index 02b48c332624..8333194a3a3f 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,10 +43,9 @@ func NewAFDCustomDomainsClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Creates a new domain within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - customDomainName - Name of the domain under the profile which is unique globally // - customDomain - Domain properties // - options - AFDCustomDomainsClientBeginCreateOptions contains the optional parameters for the AFDCustomDomainsClient.BeginCreate @@ -75,7 +71,7 @@ func (client *AFDCustomDomainsClient) BeginCreate(ctx context.Context, resourceG // Create - Creates a new domain within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDCustomDomainsClient) create(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomain AFDDomain, options *AFDCustomDomainsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "AFDCustomDomainsClient.BeginCreate" @@ -98,7 +94,7 @@ func (client *AFDCustomDomainsClient) create(ctx context.Context, resourceGroupN } // createCreateRequest creates the Create request. -func (client *AFDCustomDomainsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomain AFDDomain, options *AFDCustomDomainsClientBeginCreateOptions) (*policy.Request, error) { +func (client *AFDCustomDomainsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomain AFDDomain, _ *AFDCustomDomainsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +117,7 @@ func (client *AFDCustomDomainsClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, customDomain); err != nil { @@ -134,10 +130,9 @@ func (client *AFDCustomDomainsClient) createCreateRequest(ctx context.Context, r // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - customDomainName - Name of the domain under the profile which is unique globally. // - options - AFDCustomDomainsClientBeginDeleteOptions contains the optional parameters for the AFDCustomDomainsClient.BeginDelete // method. @@ -163,7 +158,7 @@ func (client *AFDCustomDomainsClient) BeginDelete(ctx context.Context, resourceG // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AFDCustomDomainsClient.BeginDelete" @@ -186,7 +181,7 @@ func (client *AFDCustomDomainsClient) deleteOperation(ctx context.Context, resou } // deleteCreateRequest creates the Delete request. -func (client *AFDCustomDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *AFDCustomDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, _ *AFDCustomDomainsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -209,7 +204,7 @@ func (client *AFDCustomDomainsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -219,10 +214,9 @@ func (client *AFDCustomDomainsClient) deleteCreateRequest(ctx context.Context, r // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - customDomainName - Name of the domain under the profile which is unique globally. // - options - AFDCustomDomainsClientGetOptions contains the optional parameters for the AFDCustomDomainsClient.Get method. func (client *AFDCustomDomainsClient) Get(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientGetOptions) (AFDCustomDomainsClientGetResponse, error) { @@ -248,7 +242,7 @@ func (client *AFDCustomDomainsClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *AFDCustomDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientGetOptions) (*policy.Request, error) { +func (client *AFDCustomDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, _ *AFDCustomDomainsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -271,7 +265,7 @@ func (client *AFDCustomDomainsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,10 +282,9 @@ func (client *AFDCustomDomainsClient) getHandleResponse(resp *http.Response) (AF // NewListByProfilePager - Lists existing AzureFrontDoor domains. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - options - AFDCustomDomainsClientListByProfileOptions contains the optional parameters for the AFDCustomDomainsClient.NewListByProfilePager // method. func (client *AFDCustomDomainsClient) NewListByProfilePager(resourceGroupName string, profileName string, options *AFDCustomDomainsClientListByProfileOptions) *runtime.Pager[AFDCustomDomainsClientListByProfileResponse] { @@ -318,7 +311,7 @@ func (client *AFDCustomDomainsClient) NewListByProfilePager(resourceGroupName st } // listByProfileCreateRequest creates the ListByProfile request. -func (client *AFDCustomDomainsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *AFDCustomDomainsClientListByProfileOptions) (*policy.Request, error) { +func (client *AFDCustomDomainsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *AFDCustomDomainsClientListByProfileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -337,7 +330,7 @@ func (client *AFDCustomDomainsClient) listByProfileCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -355,10 +348,9 @@ func (client *AFDCustomDomainsClient) listByProfileHandleResponse(resp *http.Res // BeginRefreshValidationToken - Updates the domain validation token. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - customDomainName - Name of the domain under the profile which is unique globally. // - options - AFDCustomDomainsClientBeginRefreshValidationTokenOptions contains the optional parameters for the AFDCustomDomainsClient.BeginRefreshValidationToken // method. @@ -383,7 +375,7 @@ func (client *AFDCustomDomainsClient) BeginRefreshValidationToken(ctx context.Co // RefreshValidationToken - Updates the domain validation token. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDCustomDomainsClient) refreshValidationToken(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientBeginRefreshValidationTokenOptions) (*http.Response, error) { var err error const operationName = "AFDCustomDomainsClient.BeginRefreshValidationToken" @@ -406,7 +398,7 @@ func (client *AFDCustomDomainsClient) refreshValidationToken(ctx context.Context } // refreshValidationTokenCreateRequest creates the RefreshValidationToken request. -func (client *AFDCustomDomainsClient) refreshValidationTokenCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientBeginRefreshValidationTokenOptions) (*policy.Request, error) { +func (client *AFDCustomDomainsClient) refreshValidationTokenCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, _ *AFDCustomDomainsClientBeginRefreshValidationTokenOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}/refreshValidationToken" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -429,7 +421,7 @@ func (client *AFDCustomDomainsClient) refreshValidationTokenCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -438,10 +430,9 @@ func (client *AFDCustomDomainsClient) refreshValidationTokenCreateRequest(ctx co // BeginUpdate - Updates an existing domain within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - customDomainName - Name of the domain under the profile which is unique globally // - customDomainUpdateProperties - Domain properties // - options - AFDCustomDomainsClientBeginUpdateOptions contains the optional parameters for the AFDCustomDomainsClient.BeginUpdate @@ -467,7 +458,7 @@ func (client *AFDCustomDomainsClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates an existing domain within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDCustomDomainsClient) update(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomainUpdateProperties AFDDomainUpdateParameters, options *AFDCustomDomainsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AFDCustomDomainsClient.BeginUpdate" @@ -490,7 +481,7 @@ func (client *AFDCustomDomainsClient) update(ctx context.Context, resourceGroupN } // updateCreateRequest creates the Update request. -func (client *AFDCustomDomainsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomainUpdateProperties AFDDomainUpdateParameters, options *AFDCustomDomainsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AFDCustomDomainsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomainUpdateProperties AFDDomainUpdateParameters, _ *AFDCustomDomainsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/customDomains/{customDomainName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -513,7 +504,7 @@ func (client *AFDCustomDomainsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, customDomainUpdateProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client_example_test.go deleted file mode 100644 index a9c80355600a..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client_example_test.go +++ /dev/null @@ -1,294 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDCustomDomains_ListByProfile.json -func ExampleAFDCustomDomainsClient_NewListByProfilePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAFDCustomDomainsClient().NewListByProfilePager("RG", "profile1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AFDDomainListResult = armcdn.AFDDomainListResult{ - // Value: []*armcdn.AFDDomain{ - // { - // Name: to.Ptr("domain1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/domain1"), - // Properties: &armcdn.AFDDomainProperties{ - // AzureDNSZone: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // PreValidatedCustomDomainResourceID: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // ProfileName: to.Ptr("profile1"), - // TLSSettings: &armcdn.AFDDomainHTTPSParameters{ - // CertificateType: to.Ptr(armcdn.AfdCertificateTypeManagedCertificate), - // MinimumTLSVersion: to.Ptr(armcdn.AfdMinimumTLSVersionTLS12), - // Secret: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // }, - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // DomainValidationState: to.Ptr(armcdn.DomainValidationStatePending), - // HostName: to.Ptr("www.contoso.com"), - // ValidationProperties: &armcdn.DomainValidationProperties{ - // ExpirationDate: to.Ptr("2009-06-15T13:45:43.0000000Z"), - // ValidationToken: to.Ptr("8c9912db-c615-4eeb-8465"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDCustomDomains_Get.json -func ExampleAFDCustomDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAFDCustomDomainsClient().Get(ctx, "RG", "profile1", "domain1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDDomain = armcdn.AFDDomain{ - // Name: to.Ptr("domain1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/domain1"), - // Properties: &armcdn.AFDDomainProperties{ - // AzureDNSZone: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // PreValidatedCustomDomainResourceID: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // ProfileName: to.Ptr("profile1"), - // TLSSettings: &armcdn.AFDDomainHTTPSParameters{ - // CertificateType: to.Ptr(armcdn.AfdCertificateTypeManagedCertificate), - // MinimumTLSVersion: to.Ptr(armcdn.AfdMinimumTLSVersionTLS12), - // Secret: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // }, - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // DomainValidationState: to.Ptr(armcdn.DomainValidationStatePending), - // HostName: to.Ptr("www.contoso.com"), - // ValidationProperties: &armcdn.DomainValidationProperties{ - // ExpirationDate: to.Ptr("2009-06-15T13:45:43.0000000Z"), - // ValidationToken: to.Ptr("8c9912db-c615-4eeb-8465"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDCustomDomains_Create.json -func ExampleAFDCustomDomainsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDCustomDomainsClient().BeginCreate(ctx, "RG", "profile1", "domain1", armcdn.AFDDomain{ - Properties: &armcdn.AFDDomainProperties{ - AzureDNSZone: &armcdn.ResourceReference{ - ID: to.Ptr(""), - }, - TLSSettings: &armcdn.AFDDomainHTTPSParameters{ - CertificateType: to.Ptr(armcdn.AfdCertificateTypeManagedCertificate), - MinimumTLSVersion: to.Ptr(armcdn.AfdMinimumTLSVersionTLS12), - }, - HostName: to.Ptr("www.someDomain.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDDomain = armcdn.AFDDomain{ - // Name: to.Ptr("domain1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/domain1"), - // Properties: &armcdn.AFDDomainProperties{ - // AzureDNSZone: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // PreValidatedCustomDomainResourceID: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // ProfileName: to.Ptr("profile1"), - // TLSSettings: &armcdn.AFDDomainHTTPSParameters{ - // CertificateType: to.Ptr(armcdn.AfdCertificateTypeManagedCertificate), - // MinimumTLSVersion: to.Ptr(armcdn.AfdMinimumTLSVersionTLS12), - // Secret: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // }, - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // DomainValidationState: to.Ptr(armcdn.DomainValidationStateSubmitting), - // HostName: to.Ptr("www.contoso.com"), - // ValidationProperties: &armcdn.DomainValidationProperties{ - // ExpirationDate: to.Ptr(""), - // ValidationToken: to.Ptr(""), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDCustomDomains_Update.json -func ExampleAFDCustomDomainsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDCustomDomainsClient().BeginUpdate(ctx, "RG", "profile1", "domain1", armcdn.AFDDomainUpdateParameters{ - Properties: &armcdn.AFDDomainUpdatePropertiesParameters{ - AzureDNSZone: &armcdn.ResourceReference{ - ID: to.Ptr(""), - }, - TLSSettings: &armcdn.AFDDomainHTTPSParameters{ - CertificateType: to.Ptr(armcdn.AfdCertificateTypeCustomerCertificate), - MinimumTLSVersion: to.Ptr(armcdn.AfdMinimumTLSVersionTLS12), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDDomain = armcdn.AFDDomain{ - // Name: to.Ptr("domain1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/domain1"), - // Properties: &armcdn.AFDDomainProperties{ - // AzureDNSZone: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // PreValidatedCustomDomainResourceID: &armcdn.ResourceReference{ - // ID: to.Ptr(""), - // }, - // ProfileName: to.Ptr("profile1"), - // TLSSettings: &armcdn.AFDDomainHTTPSParameters{ - // CertificateType: to.Ptr(armcdn.AfdCertificateTypeManagedCertificate), - // MinimumTLSVersion: to.Ptr(armcdn.AfdMinimumTLSVersionTLS12), - // Secret: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/secrets/mysecert"), - // }, - // }, - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // DomainValidationState: to.Ptr(armcdn.DomainValidationStateApproved), - // HostName: to.Ptr("www.contoso.com"), - // ValidationProperties: &armcdn.DomainValidationProperties{ - // ExpirationDate: to.Ptr("2009-06-15T13:45:43.0000000Z"), - // ValidationToken: to.Ptr("8c9912db-c615-4eeb-8465"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDCustomDomains_Delete.json -func ExampleAFDCustomDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDCustomDomainsClient().BeginDelete(ctx, "RG", "profile1", "domain1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDCustomDomains_RefreshValidationToken.json -func ExampleAFDCustomDomainsClient_BeginRefreshValidationToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDCustomDomainsClient().BeginRefreshValidationToken(ctx, "RG", "profile1", "domain1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go index f2e2f3db3226..d3ae553f85ec 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,10 +44,9 @@ func NewAFDEndpointsClient(subscriptionID string, credential azcore.TokenCredent // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - endpoint - Endpoint properties // - options - AFDEndpointsClientBeginCreateOptions contains the optional parameters for the AFDEndpointsClient.BeginCreate @@ -77,7 +73,7 @@ func (client *AFDEndpointsClient) BeginCreate(ctx context.Context, resourceGroup // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDEndpointsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint AFDEndpoint, options *AFDEndpointsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "AFDEndpointsClient.BeginCreate" @@ -100,7 +96,7 @@ func (client *AFDEndpointsClient) create(ctx context.Context, resourceGroupName } // createCreateRequest creates the Create request. -func (client *AFDEndpointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint AFDEndpoint, options *AFDEndpointsClientBeginCreateOptions) (*policy.Request, error) { +func (client *AFDEndpointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint AFDEndpoint, _ *AFDEndpointsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -123,7 +119,7 @@ func (client *AFDEndpointsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, endpoint); err != nil { @@ -136,10 +132,9 @@ func (client *AFDEndpointsClient) createCreateRequest(ctx context.Context, resou // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - options - AFDEndpointsClientBeginDeleteOptions contains the optional parameters for the AFDEndpointsClient.BeginDelete // method. @@ -165,7 +160,7 @@ func (client *AFDEndpointsClient) BeginDelete(ctx context.Context, resourceGroup // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *AFDEndpointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AFDEndpointsClient.BeginDelete" @@ -188,7 +183,7 @@ func (client *AFDEndpointsClient) deleteOperation(ctx context.Context, resourceG } // deleteCreateRequest creates the Delete request. -func (client *AFDEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *AFDEndpointsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *AFDEndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *AFDEndpointsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -211,7 +206,7 @@ func (client *AFDEndpointsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -221,10 +216,9 @@ func (client *AFDEndpointsClient) deleteCreateRequest(ctx context.Context, resou // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - options - AFDEndpointsClientGetOptions contains the optional parameters for the AFDEndpointsClient.Get method. func (client *AFDEndpointsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *AFDEndpointsClientGetOptions) (AFDEndpointsClientGetResponse, error) { @@ -250,7 +244,7 @@ func (client *AFDEndpointsClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *AFDEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *AFDEndpointsClientGetOptions) (*policy.Request, error) { +func (client *AFDEndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *AFDEndpointsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -273,7 +267,7 @@ func (client *AFDEndpointsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -290,10 +284,9 @@ func (client *AFDEndpointsClient) getHandleResponse(resp *http.Response) (AFDEnd // NewListByProfilePager - Lists existing AzureFrontDoor endpoints. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - options - AFDEndpointsClientListByProfileOptions contains the optional parameters for the AFDEndpointsClient.NewListByProfilePager // method. func (client *AFDEndpointsClient) NewListByProfilePager(resourceGroupName string, profileName string, options *AFDEndpointsClientListByProfileOptions) *runtime.Pager[AFDEndpointsClientListByProfileResponse] { @@ -320,7 +313,7 @@ func (client *AFDEndpointsClient) NewListByProfilePager(resourceGroupName string } // listByProfileCreateRequest creates the ListByProfile request. -func (client *AFDEndpointsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *AFDEndpointsClientListByProfileOptions) (*policy.Request, error) { +func (client *AFDEndpointsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *AFDEndpointsClientListByProfileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -339,7 +332,7 @@ func (client *AFDEndpointsClient) listByProfileCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -356,10 +349,9 @@ func (client *AFDEndpointsClient) listByProfileHandleResponse(resp *http.Respons // NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - options - AFDEndpointsClientListResourceUsageOptions contains the optional parameters for the AFDEndpointsClient.NewListResourceUsagePager // method. @@ -387,7 +379,7 @@ func (client *AFDEndpointsClient) NewListResourceUsagePager(resourceGroupName st } // listResourceUsageCreateRequest creates the ListResourceUsage request. -func (client *AFDEndpointsClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *AFDEndpointsClientListResourceUsageOptions) (*policy.Request, error) { +func (client *AFDEndpointsClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *AFDEndpointsClientListResourceUsageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/usages" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -410,7 +402,7 @@ func (client *AFDEndpointsClient) listResourceUsageCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -428,10 +420,9 @@ func (client *AFDEndpointsClient) listResourceUsageHandleResponse(resp *http.Res // BeginPurgeContent - Removes a content from AzureFrontDoor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - contents - The list of paths to the content and the list of linked domains to be purged. Path can be a full URL, e.g. '/pictures/city.png' // which removes a single file, or a directory with a wildcard, e.g. @@ -459,7 +450,7 @@ func (client *AFDEndpointsClient) BeginPurgeContent(ctx context.Context, resourc // PurgeContent - Removes a content from AzureFrontDoor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDEndpointsClient) purgeContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contents AfdPurgeParameters, options *AFDEndpointsClientBeginPurgeContentOptions) (*http.Response, error) { var err error const operationName = "AFDEndpointsClient.BeginPurgeContent" @@ -482,7 +473,7 @@ func (client *AFDEndpointsClient) purgeContent(ctx context.Context, resourceGrou } // purgeContentCreateRequest creates the PurgeContent request. -func (client *AFDEndpointsClient) purgeContentCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contents AfdPurgeParameters, options *AFDEndpointsClientBeginPurgeContentOptions) (*policy.Request, error) { +func (client *AFDEndpointsClient) purgeContentCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contents AfdPurgeParameters, _ *AFDEndpointsClientBeginPurgeContentOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/purge" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -505,7 +496,7 @@ func (client *AFDEndpointsClient) purgeContentCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, contents); err != nil { @@ -520,10 +511,9 @@ func (client *AFDEndpointsClient) purgeContentCreateRequest(ctx context.Context, // domains, use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - endpointUpdateProperties - Endpoint update properties // - options - AFDEndpointsClientBeginUpdateOptions contains the optional parameters for the AFDEndpointsClient.BeginUpdate @@ -552,7 +542,7 @@ func (client *AFDEndpointsClient) BeginUpdate(ctx context.Context, resourceGroup // domains, use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDEndpointsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties AFDEndpointUpdateParameters, options *AFDEndpointsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AFDEndpointsClient.BeginUpdate" @@ -575,7 +565,7 @@ func (client *AFDEndpointsClient) update(ctx context.Context, resourceGroupName } // updateCreateRequest creates the Update request. -func (client *AFDEndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties AFDEndpointUpdateParameters, options *AFDEndpointsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AFDEndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties AFDEndpointUpdateParameters, _ *AFDEndpointsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -598,7 +588,7 @@ func (client *AFDEndpointsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, endpointUpdateProperties); err != nil { @@ -611,10 +601,9 @@ func (client *AFDEndpointsClient) updateCreateRequest(ctx context.Context, resou // DNS. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - customDomainProperties - Custom domain to be validated. // - options - AFDEndpointsClientValidateCustomDomainOptions contains the optional parameters for the AFDEndpointsClient.ValidateCustomDomain @@ -642,7 +631,7 @@ func (client *AFDEndpointsClient) ValidateCustomDomain(ctx context.Context, reso } // validateCustomDomainCreateRequest creates the ValidateCustomDomain request. -func (client *AFDEndpointsClient) validateCustomDomainCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput, options *AFDEndpointsClientValidateCustomDomainOptions) (*policy.Request, error) { +func (client *AFDEndpointsClient) validateCustomDomainCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput, _ *AFDEndpointsClientValidateCustomDomainOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/validateCustomDomain" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -665,7 +654,7 @@ func (client *AFDEndpointsClient) validateCustomDomainCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, customDomainProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/afdendpoints_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client_example_test.go deleted file mode 100644 index 2b108315b38b..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/afdendpoints_client_example_test.go +++ /dev/null @@ -1,297 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDEndpoints_ListByProfile.json -func ExampleAFDEndpointsClient_NewListByProfilePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAFDEndpointsClient().NewListByProfilePager("RG", "profile1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AFDEndpointListResult = armcdn.AFDEndpointListResult{ - // Value: []*armcdn.AFDEndpoint{ - // { - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/afdendpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Properties: &armcdn.AFDEndpointProperties{ - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcdn.AutoGeneratedDomainNameLabelScopeTenantReuse), - // HostName: to.Ptr("endpoint1-abcdefghijklmnop.z01.azurefd.net"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDEndpoints_Get.json -func ExampleAFDEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAFDEndpointsClient().Get(ctx, "RG", "profile1", "endpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDEndpoint = armcdn.AFDEndpoint{ - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/afdendpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Properties: &armcdn.AFDEndpointProperties{ - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcdn.AutoGeneratedDomainNameLabelScopeTenantReuse), - // HostName: to.Ptr("endpoint1-abcdefghijklmnop.z01.azurefd.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDEndpoints_Create.json -func ExampleAFDEndpointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDEndpointsClient().BeginCreate(ctx, "RG", "profile1", "endpoint1", armcdn.AFDEndpoint{ - Location: to.Ptr("global"), - Tags: map[string]*string{}, - Properties: &armcdn.AFDEndpointProperties{ - EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - AutoGeneratedDomainNameLabelScope: to.Ptr(armcdn.AutoGeneratedDomainNameLabelScopeTenantReuse), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDEndpoint = armcdn.AFDEndpoint{ - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/afdendpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Properties: &armcdn.AFDEndpointProperties{ - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcdn.AutoGeneratedDomainNameLabelScopeTenantReuse), - // HostName: to.Ptr("endpoint1-abcdefghijklmnop.z01.azurefd.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDEndpoints_Update.json -func ExampleAFDEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDEndpointsClient().BeginUpdate(ctx, "RG", "profile1", "endpoint1", armcdn.AFDEndpointUpdateParameters{ - Properties: &armcdn.AFDEndpointPropertiesUpdateParameters{ - EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - }, - Tags: map[string]*string{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDEndpoint = armcdn.AFDEndpoint{ - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/afdendpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Properties: &armcdn.AFDEndpointProperties{ - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcdn.AutoGeneratedDomainNameLabelScopeTenantReuse), - // HostName: to.Ptr("endpoint1-ezh7ddcmguaeajfu.z01.azureedge.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDEndpoints_Delete.json -func ExampleAFDEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDEndpointsClient().BeginDelete(ctx, "RG", "profile1", "endpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDEndpoints_PurgeContent.json -func ExampleAFDEndpointsClient_BeginPurgeContent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDEndpointsClient().BeginPurgeContent(ctx, "RG", "profile1", "endpoint1", armcdn.AfdPurgeParameters{ - ContentPaths: []*string{ - to.Ptr("/folder1")}, - Domains: []*string{ - to.Ptr("endpoint1-abcdefghijklmnop.z01.azurefd.net")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDEndpoints_ListResourceUsage.json -func ExampleAFDEndpointsClient_NewListResourceUsagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAFDEndpointsClient().NewListResourceUsagePager("RG", "profile1", "endpoint1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UsagesListResult = armcdn.UsagesListResult{ - // Value: []*armcdn.Usage{ - // { - // Name: &armcdn.UsageName{ - // LocalizedValue: to.Ptr("route"), - // Value: to.Ptr("route"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1/routes/route1"), - // Limit: to.Ptr[int64](25), - // Unit: to.Ptr(armcdn.UsageUnitCount), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDEndpoints_ValidateCustomDomain.json -func ExampleAFDEndpointsClient_ValidateCustomDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAFDEndpointsClient().ValidateCustomDomain(ctx, "RG", "profile1", "endpoint1", armcdn.ValidateCustomDomainInput{ - HostName: to.Ptr("www.someDomain.com"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateCustomDomainOutput = armcdn.ValidateCustomDomainOutput{ - // CustomDomainValidated: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go index a965cd61ea57..9f17081bed15 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,10 +43,9 @@ func NewAFDOriginGroupsClient(subscriptionID string, credential azcore.TokenCred // BeginCreate - Creates a new origin group within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the endpoint. // - originGroup - Origin group properties // - options - AFDOriginGroupsClientBeginCreateOptions contains the optional parameters for the AFDOriginGroupsClient.BeginCreate @@ -75,7 +71,7 @@ func (client *AFDOriginGroupsClient) BeginCreate(ctx context.Context, resourceGr // Create - Creates a new origin group within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDOriginGroupsClient) create(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroup AFDOriginGroup, options *AFDOriginGroupsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "AFDOriginGroupsClient.BeginCreate" @@ -98,7 +94,7 @@ func (client *AFDOriginGroupsClient) create(ctx context.Context, resourceGroupNa } // createCreateRequest creates the Create request. -func (client *AFDOriginGroupsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroup AFDOriginGroup, options *AFDOriginGroupsClientBeginCreateOptions) (*policy.Request, error) { +func (client *AFDOriginGroupsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroup AFDOriginGroup, _ *AFDOriginGroupsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +117,7 @@ func (client *AFDOriginGroupsClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, originGroup); err != nil { @@ -133,10 +129,9 @@ func (client *AFDOriginGroupsClient) createCreateRequest(ctx context.Context, re // BeginDelete - Deletes an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the profile. // - options - AFDOriginGroupsClientBeginDeleteOptions contains the optional parameters for the AFDOriginGroupsClient.BeginDelete // method. @@ -161,7 +156,7 @@ func (client *AFDOriginGroupsClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDOriginGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, options *AFDOriginGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AFDOriginGroupsClient.BeginDelete" @@ -184,7 +179,7 @@ func (client *AFDOriginGroupsClient) deleteOperation(ctx context.Context, resour } // deleteCreateRequest creates the Delete request. -func (client *AFDOriginGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, options *AFDOriginGroupsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *AFDOriginGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, _ *AFDOriginGroupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -207,7 +202,7 @@ func (client *AFDOriginGroupsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,10 +211,9 @@ func (client *AFDOriginGroupsClient) deleteCreateRequest(ctx context.Context, re // Get - Gets an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the endpoint. // - options - AFDOriginGroupsClientGetOptions contains the optional parameters for the AFDOriginGroupsClient.Get method. func (client *AFDOriginGroupsClient) Get(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, options *AFDOriginGroupsClientGetOptions) (AFDOriginGroupsClientGetResponse, error) { @@ -245,7 +239,7 @@ func (client *AFDOriginGroupsClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *AFDOriginGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, options *AFDOriginGroupsClientGetOptions) (*policy.Request, error) { +func (client *AFDOriginGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, _ *AFDOriginGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -268,7 +262,7 @@ func (client *AFDOriginGroupsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,10 +279,9 @@ func (client *AFDOriginGroupsClient) getHandleResponse(resp *http.Response) (AFD // NewListByProfilePager - Lists all of the existing origin groups within a profile. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - options - AFDOriginGroupsClientListByProfileOptions contains the optional parameters for the AFDOriginGroupsClient.NewListByProfilePager // method. func (client *AFDOriginGroupsClient) NewListByProfilePager(resourceGroupName string, profileName string, options *AFDOriginGroupsClientListByProfileOptions) *runtime.Pager[AFDOriginGroupsClientListByProfileResponse] { @@ -315,7 +308,7 @@ func (client *AFDOriginGroupsClient) NewListByProfilePager(resourceGroupName str } // listByProfileCreateRequest creates the ListByProfile request. -func (client *AFDOriginGroupsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *AFDOriginGroupsClientListByProfileOptions) (*policy.Request, error) { +func (client *AFDOriginGroupsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *AFDOriginGroupsClientListByProfileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -334,7 +327,7 @@ func (client *AFDOriginGroupsClient) listByProfileCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,10 +344,9 @@ func (client *AFDOriginGroupsClient) listByProfileHandleResponse(resp *http.Resp // NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the endpoint. // - options - AFDOriginGroupsClientListResourceUsageOptions contains the optional parameters for the AFDOriginGroupsClient.NewListResourceUsagePager // method. @@ -382,7 +374,7 @@ func (client *AFDOriginGroupsClient) NewListResourceUsagePager(resourceGroupName } // listResourceUsageCreateRequest creates the ListResourceUsage request. -func (client *AFDOriginGroupsClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, options *AFDOriginGroupsClientListResourceUsageOptions) (*policy.Request, error) { +func (client *AFDOriginGroupsClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, _ *AFDOriginGroupsClientListResourceUsageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/usages" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -405,7 +397,7 @@ func (client *AFDOriginGroupsClient) listResourceUsageCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -423,10 +415,9 @@ func (client *AFDOriginGroupsClient) listResourceUsageHandleResponse(resp *http. // BeginUpdate - Updates an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the profile. // - originGroupUpdateProperties - Origin group properties // - options - AFDOriginGroupsClientBeginUpdateOptions contains the optional parameters for the AFDOriginGroupsClient.BeginUpdate @@ -452,7 +443,7 @@ func (client *AFDOriginGroupsClient) BeginUpdate(ctx context.Context, resourceGr // Update - Updates an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDOriginGroupsClient) update(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroupUpdateProperties AFDOriginGroupUpdateParameters, options *AFDOriginGroupsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AFDOriginGroupsClient.BeginUpdate" @@ -475,7 +466,7 @@ func (client *AFDOriginGroupsClient) update(ctx context.Context, resourceGroupNa } // updateCreateRequest creates the Update request. -func (client *AFDOriginGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroupUpdateProperties AFDOriginGroupUpdateParameters, options *AFDOriginGroupsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AFDOriginGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroupUpdateProperties AFDOriginGroupUpdateParameters, _ *AFDOriginGroupsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -498,7 +489,7 @@ func (client *AFDOriginGroupsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, originGroupUpdateProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client_example_test.go deleted file mode 100644 index f84bd50a5e29..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client_example_test.go +++ /dev/null @@ -1,288 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOriginGroups_ListByProfile.json -func ExampleAFDOriginGroupsClient_NewListByProfilePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAFDOriginGroupsClient().NewListByProfilePager("RG", "profile1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AFDOriginGroupListResult = armcdn.AFDOriginGroupListResult{ - // Value: []*armcdn.AFDOriginGroup{ - // { - // Name: to.Ptr("origingroup1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/origingroups"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/origingroups/origingroup1"), - // Properties: &armcdn.AFDOriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](10), - // ProbePath: to.Ptr("/path1"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeHEAD), - // }, - // LoadBalancingSettings: &armcdn.LoadBalancingSettingsParameters{ - // AdditionalLatencyInMilliseconds: to.Ptr[int32](1000), - // SampleSize: to.Ptr[int32](3), - // SuccessfulSamplesRequired: to.Ptr[int32](3), - // }, - // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes: to.Ptr[int32](5), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOriginGroups_Get.json -func ExampleAFDOriginGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAFDOriginGroupsClient().Get(ctx, "RG", "profile1", "origingroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDOriginGroup = armcdn.AFDOriginGroup{ - // Name: to.Ptr("origingroup1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/origingroups"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/origingroups/origingroup1"), - // Properties: &armcdn.AFDOriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](10), - // ProbePath: to.Ptr("/path1"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeHEAD), - // }, - // LoadBalancingSettings: &armcdn.LoadBalancingSettingsParameters{ - // AdditionalLatencyInMilliseconds: to.Ptr[int32](1000), - // SampleSize: to.Ptr[int32](3), - // SuccessfulSamplesRequired: to.Ptr[int32](3), - // }, - // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes: to.Ptr[int32](5), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOriginGroups_Create.json -func ExampleAFDOriginGroupsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDOriginGroupsClient().BeginCreate(ctx, "RG", "profile1", "origingroup1", armcdn.AFDOriginGroup{ - Properties: &armcdn.AFDOriginGroupProperties{ - HealthProbeSettings: &armcdn.HealthProbeParameters{ - ProbeIntervalInSeconds: to.Ptr[int32](10), - ProbePath: to.Ptr("/path2"), - ProbeProtocol: to.Ptr(armcdn.ProbeProtocolNotSet), - ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeNotSet), - }, - LoadBalancingSettings: &armcdn.LoadBalancingSettingsParameters{ - AdditionalLatencyInMilliseconds: to.Ptr[int32](1000), - SampleSize: to.Ptr[int32](3), - SuccessfulSamplesRequired: to.Ptr[int32](3), - }, - TrafficRestorationTimeToHealedOrNewEndpointsInMinutes: to.Ptr[int32](5), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDOriginGroup = armcdn.AFDOriginGroup{ - // Name: to.Ptr("origingroup1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/origingroups"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/origingroups/origingroup1"), - // Properties: &armcdn.AFDOriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](10), - // ProbePath: to.Ptr("/path1"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeHEAD), - // }, - // LoadBalancingSettings: &armcdn.LoadBalancingSettingsParameters{ - // AdditionalLatencyInMilliseconds: to.Ptr[int32](1000), - // SampleSize: to.Ptr[int32](3), - // SuccessfulSamplesRequired: to.Ptr[int32](3), - // }, - // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes: to.Ptr[int32](5), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOriginGroups_Update.json -func ExampleAFDOriginGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDOriginGroupsClient().BeginUpdate(ctx, "RG", "profile1", "origingroup1", armcdn.AFDOriginGroupUpdateParameters{ - Properties: &armcdn.AFDOriginGroupUpdatePropertiesParameters{ - HealthProbeSettings: &armcdn.HealthProbeParameters{ - ProbeIntervalInSeconds: to.Ptr[int32](10), - ProbePath: to.Ptr("/path2"), - ProbeProtocol: to.Ptr(armcdn.ProbeProtocolNotSet), - ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeNotSet), - }, - LoadBalancingSettings: &armcdn.LoadBalancingSettingsParameters{ - AdditionalLatencyInMilliseconds: to.Ptr[int32](1000), - SampleSize: to.Ptr[int32](3), - SuccessfulSamplesRequired: to.Ptr[int32](3), - }, - TrafficRestorationTimeToHealedOrNewEndpointsInMinutes: to.Ptr[int32](5), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDOriginGroup = armcdn.AFDOriginGroup{ - // Name: to.Ptr("origingroup1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/origingroups"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/origingroups/origingroup1"), - // Properties: &armcdn.AFDOriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](10), - // ProbePath: to.Ptr("/path1"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeHEAD), - // }, - // LoadBalancingSettings: &armcdn.LoadBalancingSettingsParameters{ - // AdditionalLatencyInMilliseconds: to.Ptr[int32](1000), - // SampleSize: to.Ptr[int32](3), - // SuccessfulSamplesRequired: to.Ptr[int32](3), - // }, - // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes: to.Ptr[int32](5), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOriginGroups_Delete.json -func ExampleAFDOriginGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDOriginGroupsClient().BeginDelete(ctx, "RG", "profile1", "origingroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOriginGroups_ListResourceUsage.json -func ExampleAFDOriginGroupsClient_NewListResourceUsagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAFDOriginGroupsClient().NewListResourceUsagePager("RG", "profile1", "origingroup1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UsagesListResult = armcdn.UsagesListResult{ - // Value: []*armcdn.Usage{ - // { - // Name: &armcdn.UsageName{ - // LocalizedValue: to.Ptr("origin"), - // Value: to.Ptr("origin"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/origingroups/origingroup1/origins/origin1"), - // Limit: to.Ptr[int64](25), - // Unit: to.Ptr(armcdn.UsageUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go b/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go index 53257efe05ae..374955ea18b7 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,10 +43,9 @@ func NewAFDOriginsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Creates a new origin within the specified origin group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the profile. // - originName - Name of the origin that is unique within the profile. // - origin - Origin properties @@ -75,7 +71,7 @@ func (client *AFDOriginsClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Creates a new origin within the specified origin group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDOriginsClient) create(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, origin AFDOrigin, options *AFDOriginsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "AFDOriginsClient.BeginCreate" @@ -98,7 +94,7 @@ func (client *AFDOriginsClient) create(ctx context.Context, resourceGroupName st } // createCreateRequest creates the Create request. -func (client *AFDOriginsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, origin AFDOrigin, options *AFDOriginsClientBeginCreateOptions) (*policy.Request, error) { +func (client *AFDOriginsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, origin AFDOrigin, _ *AFDOriginsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -125,7 +121,7 @@ func (client *AFDOriginsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, origin); err != nil { @@ -137,10 +133,9 @@ func (client *AFDOriginsClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Deletes an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the profile. // - originName - Name of the origin which is unique within the profile. // - options - AFDOriginsClientBeginDeleteOptions contains the optional parameters for the AFDOriginsClient.BeginDelete method. @@ -165,7 +160,7 @@ func (client *AFDOriginsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDOriginsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, options *AFDOriginsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AFDOriginsClient.BeginDelete" @@ -188,7 +183,7 @@ func (client *AFDOriginsClient) deleteOperation(ctx context.Context, resourceGro } // deleteCreateRequest creates the Delete request. -func (client *AFDOriginsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, options *AFDOriginsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *AFDOriginsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, _ *AFDOriginsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -215,7 +210,7 @@ func (client *AFDOriginsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,10 +219,9 @@ func (client *AFDOriginsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the profile. // - originName - Name of the origin which is unique within the profile. // - options - AFDOriginsClientGetOptions contains the optional parameters for the AFDOriginsClient.Get method. @@ -254,7 +248,7 @@ func (client *AFDOriginsClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *AFDOriginsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, options *AFDOriginsClientGetOptions) (*policy.Request, error) { +func (client *AFDOriginsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, _ *AFDOriginsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -281,7 +275,7 @@ func (client *AFDOriginsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,10 +292,9 @@ func (client *AFDOriginsClient) getHandleResponse(resp *http.Response) (AFDOrigi // NewListByOriginGroupPager - Lists all of the existing origins within an origin group. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the profile. // - options - AFDOriginsClientListByOriginGroupOptions contains the optional parameters for the AFDOriginsClient.NewListByOriginGroupPager // method. @@ -329,7 +322,7 @@ func (client *AFDOriginsClient) NewListByOriginGroupPager(resourceGroupName stri } // listByOriginGroupCreateRequest creates the ListByOriginGroup request. -func (client *AFDOriginsClient) listByOriginGroupCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, options *AFDOriginsClientListByOriginGroupOptions) (*policy.Request, error) { +func (client *AFDOriginsClient) listByOriginGroupCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, _ *AFDOriginsClientListByOriginGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -352,7 +345,7 @@ func (client *AFDOriginsClient) listByOriginGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,10 +363,9 @@ func (client *AFDOriginsClient) listByOriginGroupHandleResponse(resp *http.Respo // BeginUpdate - Updates an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - originGroupName - Name of the origin group which is unique within the profile. // - originName - Name of the origin which is unique within the profile. // - originUpdateProperties - Origin properties @@ -399,7 +391,7 @@ func (client *AFDOriginsClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDOriginsClient) update(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, originUpdateProperties AFDOriginUpdateParameters, options *AFDOriginsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AFDOriginsClient.BeginUpdate" @@ -422,7 +414,7 @@ func (client *AFDOriginsClient) update(ctx context.Context, resourceGroupName st } // updateCreateRequest creates the Update request. -func (client *AFDOriginsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, originUpdateProperties AFDOriginUpdateParameters, options *AFDOriginsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AFDOriginsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, originUpdateProperties AFDOriginUpdateParameters, _ *AFDOriginsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}/origins/{originName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -449,7 +441,7 @@ func (client *AFDOriginsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, originUpdateProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/afdorigins_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdorigins_client_example_test.go deleted file mode 100644 index d3a97d2e296e..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/afdorigins_client_example_test.go +++ /dev/null @@ -1,215 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOrigins_ListByOriginGroup.json -func ExampleAFDOriginsClient_NewListByOriginGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAFDOriginsClient().NewListByOriginGroupPager("RG", "profile1", "origingroup1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AFDOriginListResult = armcdn.AFDOriginListResult{ - // Value: []*armcdn.AFDOrigin{ - // { - // Name: to.Ptr("origin1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/origingroups/origins"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/origingroups/origingroup1/origins/origin1"), - // Properties: &armcdn.AFDOriginProperties{ - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // EnforceCertificateNameCheck: to.Ptr(true), - // HostName: to.Ptr("host1.blob.core.windows.net"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginGroupName: to.Ptr("origingroup1"), - // OriginHostHeader: to.Ptr("host1.foo.com"), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOrigins_Get.json -func ExampleAFDOriginsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAFDOriginsClient().Get(ctx, "RG", "profile1", "origingroup1", "origin1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDOrigin = armcdn.AFDOrigin{ - // Name: to.Ptr("origin1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/origingroups/origins"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/origingroups/origingroup1/origins/origin1"), - // Properties: &armcdn.AFDOriginProperties{ - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // EnforceCertificateNameCheck: to.Ptr(true), - // HostName: to.Ptr("host1.blob.core.windows.net"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginGroupName: to.Ptr("origingroup1"), - // OriginHostHeader: to.Ptr("host1.foo.com"), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOrigins_Create.json -func ExampleAFDOriginsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDOriginsClient().BeginCreate(ctx, "RG", "profile1", "origingroup1", "origin1", armcdn.AFDOrigin{ - Properties: &armcdn.AFDOriginProperties{ - EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - HostName: to.Ptr("host1.blob.core.windows.net"), - HTTPPort: to.Ptr[int32](80), - HTTPSPort: to.Ptr[int32](443), - OriginHostHeader: to.Ptr("host1.foo.com"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDOrigin = armcdn.AFDOrigin{ - // Name: to.Ptr("origin1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/origingroups/origins"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/origingroups/origingroup1/origins/origin1"), - // Properties: &armcdn.AFDOriginProperties{ - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // EnforceCertificateNameCheck: to.Ptr(true), - // HostName: to.Ptr("host1.blob.core.windows.net"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginGroupName: to.Ptr("origingroup1"), - // OriginHostHeader: to.Ptr("host1.foo.com"), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOrigins_Update.json -func ExampleAFDOriginsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDOriginsClient().BeginUpdate(ctx, "RG", "profile1", "origingroup1", "origin1", armcdn.AFDOriginUpdateParameters{ - Properties: &armcdn.AFDOriginUpdatePropertiesParameters{ - EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - HostName: to.Ptr("host1.blob.core.windows.net"), - HTTPPort: to.Ptr[int32](80), - HTTPSPort: to.Ptr[int32](443), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AFDOrigin = armcdn.AFDOrigin{ - // Name: to.Ptr("origin1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/origingroups/origins"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/origingroups/origingroup1/origins/origin1"), - // Properties: &armcdn.AFDOriginProperties{ - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // EnforceCertificateNameCheck: to.Ptr(true), - // HostName: to.Ptr("host1.blob.core.windows.net"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginGroupName: to.Ptr("origingroup1"), - // OriginHostHeader: to.Ptr("host1.foo.com"), - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDOrigins_Delete.json -func ExampleAFDOriginsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDOriginsClient().BeginDelete(ctx, "RG", "profile1", "origingroup1", "origin1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go index 1ea3057580b3..a907ec633506 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewAFDProfilesClient(subscriptionID string, credential azcore.TokenCredenti // host name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - checkEndpointNameAvailabilityInput - Input to check. @@ -76,7 +73,7 @@ func (client *AFDProfilesClient) CheckEndpointNameAvailability(ctx context.Conte } // checkEndpointNameAvailabilityCreateRequest creates the CheckEndpointNameAvailability request. -func (client *AFDProfilesClient) checkEndpointNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, profileName string, checkEndpointNameAvailabilityInput CheckEndpointNameAvailabilityInput, options *AFDProfilesClientCheckEndpointNameAvailabilityOptions) (*policy.Request, error) { +func (client *AFDProfilesClient) checkEndpointNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, profileName string, checkEndpointNameAvailabilityInput CheckEndpointNameAvailabilityInput, _ *AFDProfilesClientCheckEndpointNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkEndpointNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -95,7 +92,7 @@ func (client *AFDProfilesClient) checkEndpointNameAvailabilityCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkEndpointNameAvailabilityInput); err != nil { @@ -117,10 +114,9 @@ func (client *AFDProfilesClient) checkEndpointNameAvailabilityHandleResponse(res // in DNS. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - checkHostNameAvailabilityInput - Custom domain to be validated. // - options - AFDProfilesClientCheckHostNameAvailabilityOptions contains the optional parameters for the AFDProfilesClient.CheckHostNameAvailability // method. @@ -147,7 +143,7 @@ func (client *AFDProfilesClient) CheckHostNameAvailability(ctx context.Context, } // checkHostNameAvailabilityCreateRequest creates the CheckHostNameAvailability request. -func (client *AFDProfilesClient) checkHostNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, profileName string, checkHostNameAvailabilityInput CheckHostNameAvailabilityInput, options *AFDProfilesClientCheckHostNameAvailabilityOptions) (*policy.Request, error) { +func (client *AFDProfilesClient) checkHostNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, profileName string, checkHostNameAvailabilityInput CheckHostNameAvailabilityInput, _ *AFDProfilesClientCheckHostNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkHostNameAvailability" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -166,7 +162,7 @@ func (client *AFDProfilesClient) checkHostNameAvailabilityCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkHostNameAvailabilityInput); err != nil { @@ -186,10 +182,9 @@ func (client *AFDProfilesClient) checkHostNameAvailabilityHandleResponse(resp *h // NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - options - AFDProfilesClientListResourceUsageOptions contains the optional parameters for the AFDProfilesClient.NewListResourceUsagePager // method. func (client *AFDProfilesClient) NewListResourceUsagePager(resourceGroupName string, profileName string, options *AFDProfilesClientListResourceUsageOptions) *runtime.Pager[AFDProfilesClientListResourceUsageResponse] { @@ -216,7 +211,7 @@ func (client *AFDProfilesClient) NewListResourceUsagePager(resourceGroupName str } // listResourceUsageCreateRequest creates the ListResourceUsage request. -func (client *AFDProfilesClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *AFDProfilesClientListResourceUsageOptions) (*policy.Request, error) { +func (client *AFDProfilesClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *AFDProfilesClientListResourceUsageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/usages" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -235,7 +230,7 @@ func (client *AFDProfilesClient) listResourceUsageCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +248,7 @@ func (client *AFDProfilesClient) listResourceUsageHandleResponse(resp *http.Resp // BeginUpgrade - Upgrade a profile from StandardAzureFrontDoor to PremiumAzureFrontDoor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - profileUpgradeParameters - Profile upgrade input parameter. @@ -280,7 +275,7 @@ func (client *AFDProfilesClient) BeginUpgrade(ctx context.Context, resourceGroup // Upgrade - Upgrade a profile from StandardAzureFrontDoor to PremiumAzureFrontDoor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *AFDProfilesClient) upgrade(ctx context.Context, resourceGroupName string, profileName string, profileUpgradeParameters ProfileUpgradeParameters, options *AFDProfilesClientBeginUpgradeOptions) (*http.Response, error) { var err error const operationName = "AFDProfilesClient.BeginUpgrade" @@ -303,7 +298,7 @@ func (client *AFDProfilesClient) upgrade(ctx context.Context, resourceGroupName } // upgradeCreateRequest creates the Upgrade request. -func (client *AFDProfilesClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, profileName string, profileUpgradeParameters ProfileUpgradeParameters, options *AFDProfilesClientBeginUpgradeOptions) (*policy.Request, error) { +func (client *AFDProfilesClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, profileName string, profileUpgradeParameters ProfileUpgradeParameters, _ *AFDProfilesClientBeginUpgradeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/upgrade" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -322,7 +317,7 @@ func (client *AFDProfilesClient) upgradeCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, profileUpgradeParameters); err != nil { @@ -334,7 +329,7 @@ func (client *AFDProfilesClient) upgradeCreateRequest(ctx context.Context, resou // ValidateSecret - Validate a Secret in the profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - validateSecretInput - The Secret source. @@ -363,7 +358,7 @@ func (client *AFDProfilesClient) ValidateSecret(ctx context.Context, resourceGro } // validateSecretCreateRequest creates the ValidateSecret request. -func (client *AFDProfilesClient) validateSecretCreateRequest(ctx context.Context, resourceGroupName string, profileName string, validateSecretInput ValidateSecretInput, options *AFDProfilesClientValidateSecretOptions) (*policy.Request, error) { +func (client *AFDProfilesClient) validateSecretCreateRequest(ctx context.Context, resourceGroupName string, profileName string, validateSecretInput ValidateSecretInput, _ *AFDProfilesClientValidateSecretOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/validateSecret" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -382,7 +377,7 @@ func (client *AFDProfilesClient) validateSecretCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, validateSecretInput); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/afdprofiles_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client_example_test.go deleted file mode 100644 index d3c910b75097..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/afdprofiles_client_example_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDProfiles_CheckEndpointNameAvailability.json -func ExampleAFDProfilesClient_CheckEndpointNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAFDProfilesClient().CheckEndpointNameAvailability(ctx, "myResourceGroup", "profile1", armcdn.CheckEndpointNameAvailabilityInput{ - Name: to.Ptr("sampleName"), - Type: to.Ptr(armcdn.ResourceTypeMicrosoftCdnProfilesAfdEndpoints), - AutoGeneratedDomainNameLabelScope: to.Ptr(armcdn.AutoGeneratedDomainNameLabelScopeTenantReuse), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckEndpointNameAvailabilityOutput = armcdn.CheckEndpointNameAvailabilityOutput{ - // AvailableHostname: to.Ptr(""), - // Message: to.Ptr("Name not available"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("Name is already in use"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDProfiles_ListResourceUsage.json -func ExampleAFDProfilesClient_NewListResourceUsagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAFDProfilesClient().NewListResourceUsagePager("RG", "profile1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UsagesListResult = armcdn.UsagesListResult{ - // Value: []*armcdn.Usage{ - // { - // Name: &armcdn.UsageName{ - // LocalizedValue: to.Ptr("afdendpoint"), - // Value: to.Ptr("afdendpoint"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1"), - // Limit: to.Ptr[int64](25), - // Unit: to.Ptr(armcdn.UsageUnitCount), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDProfiles_CheckHostNameAvailability.json -func ExampleAFDProfilesClient_CheckHostNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAFDProfilesClient().CheckHostNameAvailability(ctx, "RG", "profile1", armcdn.CheckHostNameAvailabilityInput{ - HostName: to.Ptr("www.someDomain.net"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityOutput = armcdn.CheckNameAvailabilityOutput{ - // Message: to.Ptr("The hostname 'www.someDomain.net' is already owned by another profile."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("Conflict"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDProfiles_ValidateSecret.json -func ExampleAFDProfilesClient_ValidateSecret() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAFDProfilesClient().ValidateSecret(ctx, "RG", "profile1", armcdn.ValidateSecretInput{ - SecretSource: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/certificate/certName"), - }, - SecretType: to.Ptr(armcdn.SecretTypeCustomerCertificate), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateSecretOutput = armcdn.ValidateSecretOutput{ - // Status: to.Ptr(armcdn.StatusValid), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/AFDProfiles_Upgrade.json -func ExampleAFDProfilesClient_BeginUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAFDProfilesClient().BeginUpgrade(ctx, "RG", "profile1", armcdn.ProfileUpgradeParameters{ - WafMappingList: []*armcdn.ProfileChangeSKUWafMapping{ - { - ChangeToWafPolicy: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/waf2"), - }, - SecurityPolicyName: to.Ptr("securityPolicy1"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Profile = armcdn.Profile{ - // Name: to.Ptr("profile1"), - // Type: to.Ptr("Microsoft.Cdn/profiles"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"), - // Location: to.Ptr("Global"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr("frontdoor"), - // Properties: &armcdn.ProfileProperties{ - // ExtendedProperties: map[string]*string{ - // }, - // FrontDoorID: to.Ptr("id"), - // OriginResponseTimeoutSeconds: to.Ptr[int32](60), - // ProvisioningState: to.Ptr(armcdn.ProfileProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.ProfileResourceState("Enabled")), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNameStandardAzureFrontDoor), - // }, - // } -} diff --git a/sdk/resourcemanager/cdn/armcdn/afdx_live_test.go b/sdk/resourcemanager/cdn/armcdn/afdx_live_test.go index 842031b0553f..ab939782d53e 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdx_live_test.go +++ b/sdk/resourcemanager/cdn/armcdn/afdx_live_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cdn/armcdn/autorest.md b/sdk/resourcemanager/cdn/armcdn/autorest.md index 925bd17e8ab0..5ebbf9d083ba 100644 --- a/sdk/resourcemanager/cdn/armcdn/autorest.md +++ b/sdk/resourcemanager/cdn/armcdn/autorest.md @@ -5,11 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cdn/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cdn/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.2.0 +module-version: 3.0.0 modelerfour: lenient-model-deduplication: true -tag: package-2024-02 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/cdn/armcdn/cdn_live_test.go b/sdk/resourcemanager/cdn/armcdn/cdn_live_test.go index fee71e1d9bfa..8f64afc39410 100644 --- a/sdk/resourcemanager/cdn/armcdn/cdn_live_test.go +++ b/sdk/resourcemanager/cdn/armcdn/cdn_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cdn/armcdn/client_factory.go b/sdk/resourcemanager/cdn/armcdn/client_factory.go index 92c97e31ae59..b2a5d2ff3722 100644 --- a/sdk/resourcemanager/cdn/armcdn/client_factory.go +++ b/sdk/resourcemanager/cdn/armcdn/client_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/sdk/resourcemanager/cdn/armcdn/constants.go b/sdk/resourcemanager/cdn/armcdn/constants.go index 9373b83d0cb1..769e2f957643 100644 --- a/sdk/resourcemanager/cdn/armcdn/constants.go +++ b/sdk/resourcemanager/cdn/armcdn/constants.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,7 +7,7 @@ package armcdn const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" - moduleVersion = "v2.2.0" + moduleVersion = "v3.0.0" ) // AFDEndpointProtocols - Supported protocols for the customer's endpoint. @@ -67,12 +64,71 @@ func PossibleAfdCertificateTypeValues() []AfdCertificateType { } } -// AfdMinimumTLSVersion - TLS protocol version that will be used for Https +// AfdCipherSuiteSetType - cipher suite set type that will be used for Https +type AfdCipherSuiteSetType string + +const ( + AfdCipherSuiteSetTypeCustomized AfdCipherSuiteSetType = "Customized" + AfdCipherSuiteSetTypeTLS102019 AfdCipherSuiteSetType = "TLS10_2019" + AfdCipherSuiteSetTypeTLS122022 AfdCipherSuiteSetType = "TLS12_2022" + AfdCipherSuiteSetTypeTLS122023 AfdCipherSuiteSetType = "TLS12_2023" +) + +// PossibleAfdCipherSuiteSetTypeValues returns the possible values for the AfdCipherSuiteSetType const type. +func PossibleAfdCipherSuiteSetTypeValues() []AfdCipherSuiteSetType { + return []AfdCipherSuiteSetType{ + AfdCipherSuiteSetTypeCustomized, + AfdCipherSuiteSetTypeTLS102019, + AfdCipherSuiteSetTypeTLS122022, + AfdCipherSuiteSetTypeTLS122023, + } +} + +type AfdCustomizedCipherSuiteForTls12 string + +const ( + AfdCustomizedCipherSuiteForTls12DHERSAAES128GCMSHA256 AfdCustomizedCipherSuiteForTls12 = "DHE_RSA_AES128_GCM_SHA256" + AfdCustomizedCipherSuiteForTls12DHERSAAES256GCMSHA384 AfdCustomizedCipherSuiteForTls12 = "DHE_RSA_AES256_GCM_SHA384" + AfdCustomizedCipherSuiteForTls12ECDHERSAAES128GCMSHA256 AfdCustomizedCipherSuiteForTls12 = "ECDHE_RSA_AES128_GCM_SHA256" + AfdCustomizedCipherSuiteForTls12ECDHERSAAES128SHA256 AfdCustomizedCipherSuiteForTls12 = "ECDHE_RSA_AES128_SHA256" + AfdCustomizedCipherSuiteForTls12ECDHERSAAES256GCMSHA384 AfdCustomizedCipherSuiteForTls12 = "ECDHE_RSA_AES256_GCM_SHA384" + AfdCustomizedCipherSuiteForTls12ECDHERSAAES256SHA384 AfdCustomizedCipherSuiteForTls12 = "ECDHE_RSA_AES256_SHA384" +) + +// PossibleAfdCustomizedCipherSuiteForTls12Values returns the possible values for the AfdCustomizedCipherSuiteForTls12 const type. +func PossibleAfdCustomizedCipherSuiteForTls12Values() []AfdCustomizedCipherSuiteForTls12 { + return []AfdCustomizedCipherSuiteForTls12{ + AfdCustomizedCipherSuiteForTls12DHERSAAES128GCMSHA256, + AfdCustomizedCipherSuiteForTls12DHERSAAES256GCMSHA384, + AfdCustomizedCipherSuiteForTls12ECDHERSAAES128GCMSHA256, + AfdCustomizedCipherSuiteForTls12ECDHERSAAES128SHA256, + AfdCustomizedCipherSuiteForTls12ECDHERSAAES256GCMSHA384, + AfdCustomizedCipherSuiteForTls12ECDHERSAAES256SHA384, + } +} + +type AfdCustomizedCipherSuiteForTls13 string + +const ( + AfdCustomizedCipherSuiteForTls13TLSAES128GCMSHA256 AfdCustomizedCipherSuiteForTls13 = "TLS_AES_128_GCM_SHA256" + AfdCustomizedCipherSuiteForTls13TLSAES256GCMSHA384 AfdCustomizedCipherSuiteForTls13 = "TLS_AES_256_GCM_SHA384" +) + +// PossibleAfdCustomizedCipherSuiteForTls13Values returns the possible values for the AfdCustomizedCipherSuiteForTls13 const type. +func PossibleAfdCustomizedCipherSuiteForTls13Values() []AfdCustomizedCipherSuiteForTls13 { + return []AfdCustomizedCipherSuiteForTls13{ + AfdCustomizedCipherSuiteForTls13TLSAES128GCMSHA256, + AfdCustomizedCipherSuiteForTls13TLSAES256GCMSHA384, + } +} + +// AfdMinimumTLSVersion - TLS protocol version that will be used for Https when cipherSuiteSetType is Customized. type AfdMinimumTLSVersion string const ( AfdMinimumTLSVersionTLS10 AfdMinimumTLSVersion = "TLS10" AfdMinimumTLSVersionTLS12 AfdMinimumTLSVersion = "TLS12" + AfdMinimumTLSVersionTLS13 AfdMinimumTLSVersion = "TLS13" ) // PossibleAfdMinimumTLSVersionValues returns the possible values for the AfdMinimumTLSVersion const type. @@ -80,6 +136,7 @@ func PossibleAfdMinimumTLSVersionValues() []AfdMinimumTLSVersion { return []AfdMinimumTLSVersion{ AfdMinimumTLSVersionTLS10, AfdMinimumTLSVersionTLS12, + AfdMinimumTLSVersionTLS13, } } @@ -179,32 +236,6 @@ func PossibleCacheBehaviorValues() []CacheBehavior { } } -type CacheExpirationActionParametersTypeName string - -const ( - CacheExpirationActionParametersTypeNameDeliveryRuleCacheExpirationActionParameters CacheExpirationActionParametersTypeName = "DeliveryRuleCacheExpirationActionParameters" -) - -// PossibleCacheExpirationActionParametersTypeNameValues returns the possible values for the CacheExpirationActionParametersTypeName const type. -func PossibleCacheExpirationActionParametersTypeNameValues() []CacheExpirationActionParametersTypeName { - return []CacheExpirationActionParametersTypeName{ - CacheExpirationActionParametersTypeNameDeliveryRuleCacheExpirationActionParameters, - } -} - -type CacheKeyQueryStringActionParametersTypeName string - -const ( - CacheKeyQueryStringActionParametersTypeNameDeliveryRuleCacheKeyQueryStringBehaviorActionParameters CacheKeyQueryStringActionParametersTypeName = "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" -) - -// PossibleCacheKeyQueryStringActionParametersTypeNameValues returns the possible values for the CacheKeyQueryStringActionParametersTypeName const type. -func PossibleCacheKeyQueryStringActionParametersTypeNameValues() []CacheKeyQueryStringActionParametersTypeName { - return []CacheKeyQueryStringActionParametersTypeName{ - CacheKeyQueryStringActionParametersTypeNameDeliveryRuleCacheKeyQueryStringBehaviorActionParameters, - } -} - // CacheType - The level at which the content needs to be cached. type CacheType string @@ -235,19 +266,6 @@ func PossibleCanMigrateDefaultSKUValues() []CanMigrateDefaultSKU { } } -type CdnCertificateSourceParametersTypeName string - -const ( - CdnCertificateSourceParametersTypeNameCdnCertificateSourceParameters CdnCertificateSourceParametersTypeName = "CdnCertificateSourceParameters" -) - -// PossibleCdnCertificateSourceParametersTypeNameValues returns the possible values for the CdnCertificateSourceParametersTypeName const type. -func PossibleCdnCertificateSourceParametersTypeNameValues() []CdnCertificateSourceParametersTypeName { - return []CdnCertificateSourceParametersTypeName{ - CdnCertificateSourceParametersTypeNameCdnCertificateSourceParameters, - } -} - // CertificateSource - Defines the source of the SSL certificate. type CertificateSource string @@ -264,6 +282,21 @@ func PossibleCertificateSourceValues() []CertificateSource { } } +type CertificateSourceParametersType string + +const ( + CertificateSourceParametersTypeCdnCertificateSourceParameters CertificateSourceParametersType = "CdnCertificateSourceParameters" + CertificateSourceParametersTypeKeyVaultCertificateSourceParameters CertificateSourceParametersType = "KeyVaultCertificateSourceParameters" +) + +// PossibleCertificateSourceParametersTypeValues returns the possible values for the CertificateSourceParametersType const type. +func PossibleCertificateSourceParametersTypeValues() []CertificateSourceParametersType { + return []CertificateSourceParametersType{ + CertificateSourceParametersTypeCdnCertificateSourceParameters, + CertificateSourceParametersTypeKeyVaultCertificateSourceParameters, + } +} + // CertificateType - Type of certificate used type CertificateType string @@ -280,19 +313,6 @@ func PossibleCertificateTypeValues() []CertificateType { } } -type ClientPortMatchConditionParametersTypeName string - -const ( - ClientPortMatchConditionParametersTypeNameDeliveryRuleClientPortConditionParameters ClientPortMatchConditionParametersTypeName = "DeliveryRuleClientPortConditionParameters" -) - -// PossibleClientPortMatchConditionParametersTypeNameValues returns the possible values for the ClientPortMatchConditionParametersTypeName const type. -func PossibleClientPortMatchConditionParametersTypeNameValues() []ClientPortMatchConditionParametersTypeName { - return []ClientPortMatchConditionParametersTypeName{ - ClientPortMatchConditionParametersTypeNameDeliveryRuleClientPortConditionParameters, - } -} - // ClientPortOperator - Describes operator to be matched type ClientPortOperator string @@ -325,19 +345,6 @@ func PossibleClientPortOperatorValues() []ClientPortOperator { } } -type CookiesMatchConditionParametersTypeName string - -const ( - CookiesMatchConditionParametersTypeNameDeliveryRuleCookiesConditionParameters CookiesMatchConditionParametersTypeName = "DeliveryRuleCookiesConditionParameters" -) - -// PossibleCookiesMatchConditionParametersTypeNameValues returns the possible values for the CookiesMatchConditionParametersTypeName const type. -func PossibleCookiesMatchConditionParametersTypeNameValues() []CookiesMatchConditionParametersTypeName { - return []CookiesMatchConditionParametersTypeName{ - CookiesMatchConditionParametersTypeNameDeliveryRuleCookiesConditionParameters, - } -} - // CookiesOperator - Describes operator to be matched type CookiesOperator string @@ -473,33 +480,109 @@ func PossibleDeleteRuleValues() []DeleteRule { } } -// DeliveryRuleAction - The name of the action for the delivery rule. -type DeliveryRuleAction string - -const ( - DeliveryRuleActionCacheExpiration DeliveryRuleAction = "CacheExpiration" - DeliveryRuleActionCacheKeyQueryString DeliveryRuleAction = "CacheKeyQueryString" - DeliveryRuleActionModifyRequestHeader DeliveryRuleAction = "ModifyRequestHeader" - DeliveryRuleActionModifyResponseHeader DeliveryRuleAction = "ModifyResponseHeader" - DeliveryRuleActionOriginGroupOverride DeliveryRuleAction = "OriginGroupOverride" - DeliveryRuleActionRouteConfigurationOverride DeliveryRuleAction = "RouteConfigurationOverride" - DeliveryRuleActionURLRedirect DeliveryRuleAction = "UrlRedirect" - DeliveryRuleActionURLRewrite DeliveryRuleAction = "UrlRewrite" - DeliveryRuleActionURLSigning DeliveryRuleAction = "UrlSigning" -) - -// PossibleDeliveryRuleActionValues returns the possible values for the DeliveryRuleAction const type. -func PossibleDeliveryRuleActionValues() []DeliveryRuleAction { - return []DeliveryRuleAction{ - DeliveryRuleActionCacheExpiration, - DeliveryRuleActionCacheKeyQueryString, - DeliveryRuleActionModifyRequestHeader, - DeliveryRuleActionModifyResponseHeader, - DeliveryRuleActionOriginGroupOverride, - DeliveryRuleActionRouteConfigurationOverride, - DeliveryRuleActionURLRedirect, - DeliveryRuleActionURLRewrite, - DeliveryRuleActionURLSigning, +// DeliveryRuleActionName - The name of the action for the delivery rule. +type DeliveryRuleActionName string + +const ( + DeliveryRuleActionNameCacheExpiration DeliveryRuleActionName = "CacheExpiration" + DeliveryRuleActionNameCacheKeyQueryString DeliveryRuleActionName = "CacheKeyQueryString" + DeliveryRuleActionNameModifyRequestHeader DeliveryRuleActionName = "ModifyRequestHeader" + DeliveryRuleActionNameModifyResponseHeader DeliveryRuleActionName = "ModifyResponseHeader" + DeliveryRuleActionNameOriginGroupOverride DeliveryRuleActionName = "OriginGroupOverride" + DeliveryRuleActionNameRouteConfigurationOverride DeliveryRuleActionName = "RouteConfigurationOverride" + DeliveryRuleActionNameURLRedirect DeliveryRuleActionName = "UrlRedirect" + DeliveryRuleActionNameURLRewrite DeliveryRuleActionName = "UrlRewrite" + DeliveryRuleActionNameURLSigning DeliveryRuleActionName = "UrlSigning" +) + +// PossibleDeliveryRuleActionNameValues returns the possible values for the DeliveryRuleActionName const type. +func PossibleDeliveryRuleActionNameValues() []DeliveryRuleActionName { + return []DeliveryRuleActionName{ + DeliveryRuleActionNameCacheExpiration, + DeliveryRuleActionNameCacheKeyQueryString, + DeliveryRuleActionNameModifyRequestHeader, + DeliveryRuleActionNameModifyResponseHeader, + DeliveryRuleActionNameOriginGroupOverride, + DeliveryRuleActionNameRouteConfigurationOverride, + DeliveryRuleActionNameURLRedirect, + DeliveryRuleActionNameURLRewrite, + DeliveryRuleActionNameURLSigning, + } +} + +type DeliveryRuleActionParametersType string + +const ( + DeliveryRuleActionParametersTypeDeliveryRuleCacheExpirationActionParameters DeliveryRuleActionParametersType = "DeliveryRuleCacheExpirationActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleCacheKeyQueryStringBehaviorActionParameters DeliveryRuleActionParametersType = "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters DeliveryRuleActionParametersType = "DeliveryRuleHeaderActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters DeliveryRuleActionParametersType = "DeliveryRuleOriginGroupOverrideActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters DeliveryRuleActionParametersType = "DeliveryRuleRouteConfigurationOverrideActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRedirectActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRewriteActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlSigningActionParameters" +) + +// PossibleDeliveryRuleActionParametersTypeValues returns the possible values for the DeliveryRuleActionParametersType const type. +func PossibleDeliveryRuleActionParametersTypeValues() []DeliveryRuleActionParametersType { + return []DeliveryRuleActionParametersType{ + DeliveryRuleActionParametersTypeDeliveryRuleCacheExpirationActionParameters, + DeliveryRuleActionParametersTypeDeliveryRuleCacheKeyQueryStringBehaviorActionParameters, + DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters, + DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters, + DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters, + DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters, + DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters, + DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters, + } +} + +type DeliveryRuleConditionParametersType string + +const ( + DeliveryRuleConditionParametersTypeDeliveryRuleClientPortConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleClientPortConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleCookiesConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleCookiesConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleHTTPVersionConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleHttpVersionConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleHostNameConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleHostNameConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleIsDeviceConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleIsDeviceConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRulePostArgsConditionParameters DeliveryRuleConditionParametersType = "DeliveryRulePostArgsConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleQueryStringConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleQueryStringConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleRemoteAddressConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleRemoteAddressConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleRequestBodyConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleRequestBodyConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleRequestHeaderConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleRequestHeaderConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleRequestMethodConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleRequestMethodConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleRequestSchemeConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleRequestSchemeConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleRequestURIConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleRequestUriConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleSSLProtocolConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleSslProtocolConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleServerPortConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleSocketAddrConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFileExtensionMatchConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFilenameConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlPathMatchConditionParameters" +) + +// PossibleDeliveryRuleConditionParametersTypeValues returns the possible values for the DeliveryRuleConditionParametersType const type. +func PossibleDeliveryRuleConditionParametersTypeValues() []DeliveryRuleConditionParametersType { + return []DeliveryRuleConditionParametersType{ + DeliveryRuleConditionParametersTypeDeliveryRuleClientPortConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleCookiesConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleHTTPVersionConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleHostNameConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleIsDeviceConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRulePostArgsConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleQueryStringConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleRemoteAddressConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleRequestBodyConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleRequestHeaderConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleRequestMethodConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleRequestSchemeConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleRequestURIConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleSSLProtocolConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters, + DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters, } } @@ -684,19 +767,6 @@ func PossibleHTTPSRedirectValues() []HTTPSRedirect { } } -type HTTPVersionMatchConditionParametersTypeName string - -const ( - HTTPVersionMatchConditionParametersTypeNameDeliveryRuleHTTPVersionConditionParameters HTTPVersionMatchConditionParametersTypeName = "DeliveryRuleHttpVersionConditionParameters" -) - -// PossibleHTTPVersionMatchConditionParametersTypeNameValues returns the possible values for the HTTPVersionMatchConditionParametersTypeName const type. -func PossibleHTTPVersionMatchConditionParametersTypeNameValues() []HTTPVersionMatchConditionParametersTypeName { - return []HTTPVersionMatchConditionParametersTypeName{ - HTTPVersionMatchConditionParametersTypeNameDeliveryRuleHTTPVersionConditionParameters, - } -} - // HTTPVersionOperator - Describes operator to be matched type HTTPVersionOperator string @@ -729,19 +799,6 @@ func PossibleHeaderActionValues() []HeaderAction { } } -type HeaderActionParametersTypeName string - -const ( - HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters HeaderActionParametersTypeName = "DeliveryRuleHeaderActionParameters" -) - -// PossibleHeaderActionParametersTypeNameValues returns the possible values for the HeaderActionParametersTypeName const type. -func PossibleHeaderActionParametersTypeNameValues() []HeaderActionParametersTypeName { - return []HeaderActionParametersTypeName{ - HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters, - } -} - // HealthProbeRequestType - The type of health probe request that is made. type HealthProbeRequestType string @@ -760,19 +817,6 @@ func PossibleHealthProbeRequestTypeValues() []HealthProbeRequestType { } } -type HostNameMatchConditionParametersTypeName string - -const ( - HostNameMatchConditionParametersTypeNameDeliveryRuleHostNameConditionParameters HostNameMatchConditionParametersTypeName = "DeliveryRuleHostNameConditionParameters" -) - -// PossibleHostNameMatchConditionParametersTypeNameValues returns the possible values for the HostNameMatchConditionParametersTypeName const type. -func PossibleHostNameMatchConditionParametersTypeNameValues() []HostNameMatchConditionParametersTypeName { - return []HostNameMatchConditionParametersTypeName{ - HostNameMatchConditionParametersTypeNameDeliveryRuleHostNameConditionParameters, - } -} - // HostNameOperator - Describes operator to be matched type HostNameOperator string @@ -825,31 +869,18 @@ func PossibleIdentityTypeValues() []IdentityType { } } -type IsDeviceMatchConditionParametersMatchValuesItem string +type IsDeviceMatchValue string const ( - IsDeviceMatchConditionParametersMatchValuesItemDesktop IsDeviceMatchConditionParametersMatchValuesItem = "Desktop" - IsDeviceMatchConditionParametersMatchValuesItemMobile IsDeviceMatchConditionParametersMatchValuesItem = "Mobile" + IsDeviceMatchValueDesktop IsDeviceMatchValue = "Desktop" + IsDeviceMatchValueMobile IsDeviceMatchValue = "Mobile" ) -// PossibleIsDeviceMatchConditionParametersMatchValuesItemValues returns the possible values for the IsDeviceMatchConditionParametersMatchValuesItem const type. -func PossibleIsDeviceMatchConditionParametersMatchValuesItemValues() []IsDeviceMatchConditionParametersMatchValuesItem { - return []IsDeviceMatchConditionParametersMatchValuesItem{ - IsDeviceMatchConditionParametersMatchValuesItemDesktop, - IsDeviceMatchConditionParametersMatchValuesItemMobile, - } -} - -type IsDeviceMatchConditionParametersTypeName string - -const ( - IsDeviceMatchConditionParametersTypeNameDeliveryRuleIsDeviceConditionParameters IsDeviceMatchConditionParametersTypeName = "DeliveryRuleIsDeviceConditionParameters" -) - -// PossibleIsDeviceMatchConditionParametersTypeNameValues returns the possible values for the IsDeviceMatchConditionParametersTypeName const type. -func PossibleIsDeviceMatchConditionParametersTypeNameValues() []IsDeviceMatchConditionParametersTypeName { - return []IsDeviceMatchConditionParametersTypeName{ - IsDeviceMatchConditionParametersTypeNameDeliveryRuleIsDeviceConditionParameters, +// PossibleIsDeviceMatchValueValues returns the possible values for the IsDeviceMatchValue const type. +func PossibleIsDeviceMatchValueValues() []IsDeviceMatchValue { + return []IsDeviceMatchValue{ + IsDeviceMatchValueDesktop, + IsDeviceMatchValueMobile, } } @@ -867,29 +898,16 @@ func PossibleIsDeviceOperatorValues() []IsDeviceOperator { } } -type KeyVaultCertificateSourceParametersTypeName string +type KeyVaultSigningKeyParametersType string const ( - KeyVaultCertificateSourceParametersTypeNameKeyVaultCertificateSourceParameters KeyVaultCertificateSourceParametersTypeName = "KeyVaultCertificateSourceParameters" + KeyVaultSigningKeyParametersTypeKeyVaultSigningKeyParameters KeyVaultSigningKeyParametersType = "KeyVaultSigningKeyParameters" ) -// PossibleKeyVaultCertificateSourceParametersTypeNameValues returns the possible values for the KeyVaultCertificateSourceParametersTypeName const type. -func PossibleKeyVaultCertificateSourceParametersTypeNameValues() []KeyVaultCertificateSourceParametersTypeName { - return []KeyVaultCertificateSourceParametersTypeName{ - KeyVaultCertificateSourceParametersTypeNameKeyVaultCertificateSourceParameters, - } -} - -type KeyVaultSigningKeyParametersTypeName string - -const ( - KeyVaultSigningKeyParametersTypeNameKeyVaultSigningKeyParameters KeyVaultSigningKeyParametersTypeName = "KeyVaultSigningKeyParameters" -) - -// PossibleKeyVaultSigningKeyParametersTypeNameValues returns the possible values for the KeyVaultSigningKeyParametersTypeName const type. -func PossibleKeyVaultSigningKeyParametersTypeNameValues() []KeyVaultSigningKeyParametersTypeName { - return []KeyVaultSigningKeyParametersTypeName{ - KeyVaultSigningKeyParametersTypeNameKeyVaultSigningKeyParameters, +// PossibleKeyVaultSigningKeyParametersTypeValues returns the possible values for the KeyVaultSigningKeyParametersType const type. +func PossibleKeyVaultSigningKeyParametersTypeValues() []KeyVaultSigningKeyParametersType { + return []KeyVaultSigningKeyParametersType{ + KeyVaultSigningKeyParametersTypeKeyVaultSigningKeyParameters, } } @@ -1230,19 +1248,6 @@ func PossibleOptimizationTypeValues() []OptimizationType { } } -type OriginGroupOverrideActionParametersTypeName string - -const ( - OriginGroupOverrideActionParametersTypeNameDeliveryRuleOriginGroupOverrideActionParameters OriginGroupOverrideActionParametersTypeName = "DeliveryRuleOriginGroupOverrideActionParameters" -) - -// PossibleOriginGroupOverrideActionParametersTypeNameValues returns the possible values for the OriginGroupOverrideActionParametersTypeName const type. -func PossibleOriginGroupOverrideActionParametersTypeNameValues() []OriginGroupOverrideActionParametersTypeName { - return []OriginGroupOverrideActionParametersTypeName{ - OriginGroupOverrideActionParametersTypeNameDeliveryRuleOriginGroupOverrideActionParameters, - } -} - // OriginGroupProvisioningState - Provisioning status of the origin group. type OriginGroupProvisioningState string @@ -1420,19 +1425,6 @@ func PossiblePolicySettingsDefaultCustomBlockResponseStatusCodeValues() []Policy } } -type PostArgsMatchConditionParametersTypeName string - -const ( - PostArgsMatchConditionParametersTypeNameDeliveryRulePostArgsConditionParameters PostArgsMatchConditionParametersTypeName = "DeliveryRulePostArgsConditionParameters" -) - -// PossiblePostArgsMatchConditionParametersTypeNameValues returns the possible values for the PostArgsMatchConditionParametersTypeName const type. -func PossiblePostArgsMatchConditionParametersTypeNameValues() []PostArgsMatchConditionParametersTypeName { - return []PostArgsMatchConditionParametersTypeName{ - PostArgsMatchConditionParametersTypeNameDeliveryRulePostArgsConditionParameters, - } -} - // PostArgsOperator - Describes operator to be matched type PostArgsOperator string @@ -1649,19 +1641,6 @@ func PossibleQueryStringCachingBehaviorValues() []QueryStringCachingBehavior { } } -type QueryStringMatchConditionParametersTypeName string - -const ( - QueryStringMatchConditionParametersTypeNameDeliveryRuleQueryStringConditionParameters QueryStringMatchConditionParametersTypeName = "DeliveryRuleQueryStringConditionParameters" -) - -// PossibleQueryStringMatchConditionParametersTypeNameValues returns the possible values for the QueryStringMatchConditionParametersTypeName const type. -func PossibleQueryStringMatchConditionParametersTypeNameValues() []QueryStringMatchConditionParametersTypeName { - return []QueryStringMatchConditionParametersTypeName{ - QueryStringMatchConditionParametersTypeNameDeliveryRuleQueryStringConditionParameters, - } -} - // QueryStringOperator - Describes operator to be matched type QueryStringOperator string @@ -1714,19 +1693,6 @@ func PossibleRedirectTypeValues() []RedirectType { } } -type RemoteAddressMatchConditionParametersTypeName string - -const ( - RemoteAddressMatchConditionParametersTypeNameDeliveryRuleRemoteAddressConditionParameters RemoteAddressMatchConditionParametersTypeName = "DeliveryRuleRemoteAddressConditionParameters" -) - -// PossibleRemoteAddressMatchConditionParametersTypeNameValues returns the possible values for the RemoteAddressMatchConditionParametersTypeName const type. -func PossibleRemoteAddressMatchConditionParametersTypeNameValues() []RemoteAddressMatchConditionParametersTypeName { - return []RemoteAddressMatchConditionParametersTypeName{ - RemoteAddressMatchConditionParametersTypeNameDeliveryRuleRemoteAddressConditionParameters, - } -} - // RemoteAddressOperator - Describes operator to be matched type RemoteAddressOperator string @@ -1745,19 +1711,6 @@ func PossibleRemoteAddressOperatorValues() []RemoteAddressOperator { } } -type RequestBodyMatchConditionParametersTypeName string - -const ( - RequestBodyMatchConditionParametersTypeNameDeliveryRuleRequestBodyConditionParameters RequestBodyMatchConditionParametersTypeName = "DeliveryRuleRequestBodyConditionParameters" -) - -// PossibleRequestBodyMatchConditionParametersTypeNameValues returns the possible values for the RequestBodyMatchConditionParametersTypeName const type. -func PossibleRequestBodyMatchConditionParametersTypeNameValues() []RequestBodyMatchConditionParametersTypeName { - return []RequestBodyMatchConditionParametersTypeName{ - RequestBodyMatchConditionParametersTypeNameDeliveryRuleRequestBodyConditionParameters, - } -} - // RequestBodyOperator - Describes operator to be matched type RequestBodyOperator string @@ -1790,19 +1743,6 @@ func PossibleRequestBodyOperatorValues() []RequestBodyOperator { } } -type RequestHeaderMatchConditionParametersTypeName string - -const ( - RequestHeaderMatchConditionParametersTypeNameDeliveryRuleRequestHeaderConditionParameters RequestHeaderMatchConditionParametersTypeName = "DeliveryRuleRequestHeaderConditionParameters" -) - -// PossibleRequestHeaderMatchConditionParametersTypeNameValues returns the possible values for the RequestHeaderMatchConditionParametersTypeName const type. -func PossibleRequestHeaderMatchConditionParametersTypeNameValues() []RequestHeaderMatchConditionParametersTypeName { - return []RequestHeaderMatchConditionParametersTypeName{ - RequestHeaderMatchConditionParametersTypeNameDeliveryRuleRequestHeaderConditionParameters, - } -} - // RequestHeaderOperator - Describes operator to be matched type RequestHeaderOperator string @@ -1835,41 +1775,28 @@ func PossibleRequestHeaderOperatorValues() []RequestHeaderOperator { } } -type RequestMethodMatchConditionParametersMatchValuesItem string +type RequestMethodMatchValue string const ( - RequestMethodMatchConditionParametersMatchValuesItemDELETE RequestMethodMatchConditionParametersMatchValuesItem = "DELETE" - RequestMethodMatchConditionParametersMatchValuesItemGET RequestMethodMatchConditionParametersMatchValuesItem = "GET" - RequestMethodMatchConditionParametersMatchValuesItemHEAD RequestMethodMatchConditionParametersMatchValuesItem = "HEAD" - RequestMethodMatchConditionParametersMatchValuesItemOPTIONS RequestMethodMatchConditionParametersMatchValuesItem = "OPTIONS" - RequestMethodMatchConditionParametersMatchValuesItemPOST RequestMethodMatchConditionParametersMatchValuesItem = "POST" - RequestMethodMatchConditionParametersMatchValuesItemPUT RequestMethodMatchConditionParametersMatchValuesItem = "PUT" - RequestMethodMatchConditionParametersMatchValuesItemTRACE RequestMethodMatchConditionParametersMatchValuesItem = "TRACE" + RequestMethodMatchValueDELETE RequestMethodMatchValue = "DELETE" + RequestMethodMatchValueGET RequestMethodMatchValue = "GET" + RequestMethodMatchValueHEAD RequestMethodMatchValue = "HEAD" + RequestMethodMatchValueOPTIONS RequestMethodMatchValue = "OPTIONS" + RequestMethodMatchValuePOST RequestMethodMatchValue = "POST" + RequestMethodMatchValuePUT RequestMethodMatchValue = "PUT" + RequestMethodMatchValueTRACE RequestMethodMatchValue = "TRACE" ) -// PossibleRequestMethodMatchConditionParametersMatchValuesItemValues returns the possible values for the RequestMethodMatchConditionParametersMatchValuesItem const type. -func PossibleRequestMethodMatchConditionParametersMatchValuesItemValues() []RequestMethodMatchConditionParametersMatchValuesItem { - return []RequestMethodMatchConditionParametersMatchValuesItem{ - RequestMethodMatchConditionParametersMatchValuesItemDELETE, - RequestMethodMatchConditionParametersMatchValuesItemGET, - RequestMethodMatchConditionParametersMatchValuesItemHEAD, - RequestMethodMatchConditionParametersMatchValuesItemOPTIONS, - RequestMethodMatchConditionParametersMatchValuesItemPOST, - RequestMethodMatchConditionParametersMatchValuesItemPUT, - RequestMethodMatchConditionParametersMatchValuesItemTRACE, - } -} - -type RequestMethodMatchConditionParametersTypeName string - -const ( - RequestMethodMatchConditionParametersTypeNameDeliveryRuleRequestMethodConditionParameters RequestMethodMatchConditionParametersTypeName = "DeliveryRuleRequestMethodConditionParameters" -) - -// PossibleRequestMethodMatchConditionParametersTypeNameValues returns the possible values for the RequestMethodMatchConditionParametersTypeName const type. -func PossibleRequestMethodMatchConditionParametersTypeNameValues() []RequestMethodMatchConditionParametersTypeName { - return []RequestMethodMatchConditionParametersTypeName{ - RequestMethodMatchConditionParametersTypeNameDeliveryRuleRequestMethodConditionParameters, +// PossibleRequestMethodMatchValueValues returns the possible values for the RequestMethodMatchValue const type. +func PossibleRequestMethodMatchValueValues() []RequestMethodMatchValue { + return []RequestMethodMatchValue{ + RequestMethodMatchValueDELETE, + RequestMethodMatchValueGET, + RequestMethodMatchValueHEAD, + RequestMethodMatchValueOPTIONS, + RequestMethodMatchValuePOST, + RequestMethodMatchValuePUT, + RequestMethodMatchValueTRACE, } } @@ -1887,21 +1814,6 @@ func PossibleRequestMethodOperatorValues() []RequestMethodOperator { } } -type RequestSchemeMatchConditionParametersMatchValuesItem string - -const ( - RequestSchemeMatchConditionParametersMatchValuesItemHTTP RequestSchemeMatchConditionParametersMatchValuesItem = "HTTP" - RequestSchemeMatchConditionParametersMatchValuesItemHTTPS RequestSchemeMatchConditionParametersMatchValuesItem = "HTTPS" -) - -// PossibleRequestSchemeMatchConditionParametersMatchValuesItemValues returns the possible values for the RequestSchemeMatchConditionParametersMatchValuesItem const type. -func PossibleRequestSchemeMatchConditionParametersMatchValuesItemValues() []RequestSchemeMatchConditionParametersMatchValuesItem { - return []RequestSchemeMatchConditionParametersMatchValuesItem{ - RequestSchemeMatchConditionParametersMatchValuesItemHTTP, - RequestSchemeMatchConditionParametersMatchValuesItemHTTPS, - } -} - // RequestSchemeMatchConditionParametersOperator - Describes operator to be matched type RequestSchemeMatchConditionParametersOperator string @@ -1916,29 +1828,18 @@ func PossibleRequestSchemeMatchConditionParametersOperatorValues() []RequestSche } } -type RequestSchemeMatchConditionParametersTypeName string +type RequestSchemeMatchValue string const ( - RequestSchemeMatchConditionParametersTypeNameDeliveryRuleRequestSchemeConditionParameters RequestSchemeMatchConditionParametersTypeName = "DeliveryRuleRequestSchemeConditionParameters" + RequestSchemeMatchValueHTTP RequestSchemeMatchValue = "HTTP" + RequestSchemeMatchValueHTTPS RequestSchemeMatchValue = "HTTPS" ) -// PossibleRequestSchemeMatchConditionParametersTypeNameValues returns the possible values for the RequestSchemeMatchConditionParametersTypeName const type. -func PossibleRequestSchemeMatchConditionParametersTypeNameValues() []RequestSchemeMatchConditionParametersTypeName { - return []RequestSchemeMatchConditionParametersTypeName{ - RequestSchemeMatchConditionParametersTypeNameDeliveryRuleRequestSchemeConditionParameters, - } -} - -type RequestURIMatchConditionParametersTypeName string - -const ( - RequestURIMatchConditionParametersTypeNameDeliveryRuleRequestURIConditionParameters RequestURIMatchConditionParametersTypeName = "DeliveryRuleRequestUriConditionParameters" -) - -// PossibleRequestURIMatchConditionParametersTypeNameValues returns the possible values for the RequestURIMatchConditionParametersTypeName const type. -func PossibleRequestURIMatchConditionParametersTypeNameValues() []RequestURIMatchConditionParametersTypeName { - return []RequestURIMatchConditionParametersTypeName{ - RequestURIMatchConditionParametersTypeNameDeliveryRuleRequestURIConditionParameters, +// PossibleRequestSchemeMatchValueValues returns the possible values for the RequestSchemeMatchValue const type. +func PossibleRequestSchemeMatchValueValues() []RequestSchemeMatchValue { + return []RequestSchemeMatchValue{ + RequestSchemeMatchValueHTTP, + RequestSchemeMatchValueHTTPS, } } @@ -2022,19 +1923,6 @@ func PossibleResponseBasedDetectedErrorTypesValues() []ResponseBasedDetectedErro } } -type RouteConfigurationOverrideActionParametersTypeName string - -const ( - RouteConfigurationOverrideActionParametersTypeNameDeliveryRuleRouteConfigurationOverrideActionParameters RouteConfigurationOverrideActionParametersTypeName = "DeliveryRuleRouteConfigurationOverrideActionParameters" -) - -// PossibleRouteConfigurationOverrideActionParametersTypeNameValues returns the possible values for the RouteConfigurationOverrideActionParametersTypeName const type. -func PossibleRouteConfigurationOverrideActionParametersTypeNameValues() []RouteConfigurationOverrideActionParametersTypeName { - return []RouteConfigurationOverrideActionParametersTypeName{ - RouteConfigurationOverrideActionParametersTypeNameDeliveryRuleRouteConfigurationOverrideActionParameters, - } -} - // RuleCacheBehavior - Caching behavior for the requests type RuleCacheBehavior string @@ -2149,19 +2037,6 @@ func PossibleSSLProtocolValues() []SSLProtocol { } } -type SSLProtocolMatchConditionParametersTypeName string - -const ( - SSLProtocolMatchConditionParametersTypeNameDeliveryRuleSSLProtocolConditionParameters SSLProtocolMatchConditionParametersTypeName = "DeliveryRuleSslProtocolConditionParameters" -) - -// PossibleSSLProtocolMatchConditionParametersTypeNameValues returns the possible values for the SSLProtocolMatchConditionParametersTypeName const type. -func PossibleSSLProtocolMatchConditionParametersTypeNameValues() []SSLProtocolMatchConditionParametersTypeName { - return []SSLProtocolMatchConditionParametersTypeName{ - SSLProtocolMatchConditionParametersTypeNameDeliveryRuleSSLProtocolConditionParameters, - } -} - // SSLProtocolOperator - Describes operator to be matched type SSLProtocolOperator string @@ -2259,19 +2134,6 @@ func PossibleSecurityPolicyTypeValues() []SecurityPolicyType { } } -type ServerPortMatchConditionParametersTypeName string - -const ( - ServerPortMatchConditionParametersTypeNameDeliveryRuleServerPortConditionParameters ServerPortMatchConditionParametersTypeName = "DeliveryRuleServerPortConditionParameters" -) - -// PossibleServerPortMatchConditionParametersTypeNameValues returns the possible values for the ServerPortMatchConditionParametersTypeName const type. -func PossibleServerPortMatchConditionParametersTypeNameValues() []ServerPortMatchConditionParametersTypeName { - return []ServerPortMatchConditionParametersTypeName{ - ServerPortMatchConditionParametersTypeNameDeliveryRuleServerPortConditionParameters, - } -} - // ServerPortOperator - Describes operator to be matched type ServerPortOperator string @@ -2327,19 +2189,6 @@ func PossibleSharedPrivateLinkResourceStatusValues() []SharedPrivateLinkResource } } -type SocketAddrMatchConditionParametersTypeName string - -const ( - SocketAddrMatchConditionParametersTypeNameDeliveryRuleSocketAddrConditionParameters SocketAddrMatchConditionParametersTypeName = "DeliveryRuleSocketAddrConditionParameters" -) - -// PossibleSocketAddrMatchConditionParametersTypeNameValues returns the possible values for the SocketAddrMatchConditionParametersTypeName const type. -func PossibleSocketAddrMatchConditionParametersTypeNameValues() []SocketAddrMatchConditionParametersTypeName { - return []SocketAddrMatchConditionParametersTypeName{ - SocketAddrMatchConditionParametersTypeNameDeliveryRuleSocketAddrConditionParameters, - } -} - // SocketAddrOperator - Describes operator to be matched type SocketAddrOperator string @@ -2424,19 +2273,6 @@ func PossibleTransformTypeValues() []TransformType { } } -type URLFileExtensionMatchConditionParametersTypeName string - -const ( - URLFileExtensionMatchConditionParametersTypeNameDeliveryRuleURLFileExtensionMatchConditionParameters URLFileExtensionMatchConditionParametersTypeName = "DeliveryRuleUrlFileExtensionMatchConditionParameters" -) - -// PossibleURLFileExtensionMatchConditionParametersTypeNameValues returns the possible values for the URLFileExtensionMatchConditionParametersTypeName const type. -func PossibleURLFileExtensionMatchConditionParametersTypeNameValues() []URLFileExtensionMatchConditionParametersTypeName { - return []URLFileExtensionMatchConditionParametersTypeName{ - URLFileExtensionMatchConditionParametersTypeNameDeliveryRuleURLFileExtensionMatchConditionParameters, - } -} - // URLFileExtensionOperator - Describes operator to be matched type URLFileExtensionOperator string @@ -2469,19 +2305,6 @@ func PossibleURLFileExtensionOperatorValues() []URLFileExtensionOperator { } } -type URLFileNameMatchConditionParametersTypeName string - -const ( - URLFileNameMatchConditionParametersTypeNameDeliveryRuleURLFilenameConditionParameters URLFileNameMatchConditionParametersTypeName = "DeliveryRuleUrlFilenameConditionParameters" -) - -// PossibleURLFileNameMatchConditionParametersTypeNameValues returns the possible values for the URLFileNameMatchConditionParametersTypeName const type. -func PossibleURLFileNameMatchConditionParametersTypeNameValues() []URLFileNameMatchConditionParametersTypeName { - return []URLFileNameMatchConditionParametersTypeName{ - URLFileNameMatchConditionParametersTypeNameDeliveryRuleURLFilenameConditionParameters, - } -} - // URLFileNameOperator - Describes operator to be matched type URLFileNameOperator string @@ -2514,19 +2337,6 @@ func PossibleURLFileNameOperatorValues() []URLFileNameOperator { } } -type URLPathMatchConditionParametersTypeName string - -const ( - URLPathMatchConditionParametersTypeNameDeliveryRuleURLPathMatchConditionParameters URLPathMatchConditionParametersTypeName = "DeliveryRuleUrlPathMatchConditionParameters" -) - -// PossibleURLPathMatchConditionParametersTypeNameValues returns the possible values for the URLPathMatchConditionParametersTypeName const type. -func PossibleURLPathMatchConditionParametersTypeNameValues() []URLPathMatchConditionParametersTypeName { - return []URLPathMatchConditionParametersTypeName{ - URLPathMatchConditionParametersTypeNameDeliveryRuleURLPathMatchConditionParameters, - } -} - // URLPathOperator - Describes operator to be matched type URLPathOperator string @@ -2561,45 +2371,6 @@ func PossibleURLPathOperatorValues() []URLPathOperator { } } -type URLRedirectActionParametersTypeName string - -const ( - URLRedirectActionParametersTypeNameDeliveryRuleURLRedirectActionParameters URLRedirectActionParametersTypeName = "DeliveryRuleUrlRedirectActionParameters" -) - -// PossibleURLRedirectActionParametersTypeNameValues returns the possible values for the URLRedirectActionParametersTypeName const type. -func PossibleURLRedirectActionParametersTypeNameValues() []URLRedirectActionParametersTypeName { - return []URLRedirectActionParametersTypeName{ - URLRedirectActionParametersTypeNameDeliveryRuleURLRedirectActionParameters, - } -} - -type URLRewriteActionParametersTypeName string - -const ( - URLRewriteActionParametersTypeNameDeliveryRuleURLRewriteActionParameters URLRewriteActionParametersTypeName = "DeliveryRuleUrlRewriteActionParameters" -) - -// PossibleURLRewriteActionParametersTypeNameValues returns the possible values for the URLRewriteActionParametersTypeName const type. -func PossibleURLRewriteActionParametersTypeNameValues() []URLRewriteActionParametersTypeName { - return []URLRewriteActionParametersTypeName{ - URLRewriteActionParametersTypeNameDeliveryRuleURLRewriteActionParameters, - } -} - -type URLSigningActionParametersTypeName string - -const ( - URLSigningActionParametersTypeNameDeliveryRuleURLSigningActionParameters URLSigningActionParametersTypeName = "DeliveryRuleUrlSigningActionParameters" -) - -// PossibleURLSigningActionParametersTypeNameValues returns the possible values for the URLSigningActionParametersTypeName const type. -func PossibleURLSigningActionParametersTypeNameValues() []URLSigningActionParametersTypeName { - return []URLSigningActionParametersTypeName{ - URLSigningActionParametersTypeNameDeliveryRuleURLSigningActionParameters, - } -} - // UpdateRule - Describes the action that shall be taken when the certificate is updated in Key Vault. type UpdateRule string diff --git a/sdk/resourcemanager/cdn/armcdn/customdomains_client.go b/sdk/resourcemanager/cdn/armcdn/customdomains_client.go index 618133525942..b79bf49e4b6e 100644 --- a/sdk/resourcemanager/cdn/armcdn/customdomains_client.go +++ b/sdk/resourcemanager/cdn/armcdn/customdomains_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewCustomDomainsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreate - Creates a new custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -74,7 +71,7 @@ func (client *CustomDomainsClient) BeginCreate(ctx context.Context, resourceGrou // Create - Creates a new custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *CustomDomainsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters, options *CustomDomainsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "CustomDomainsClient.BeginCreate" @@ -97,7 +94,7 @@ func (client *CustomDomainsClient) create(ctx context.Context, resourceGroupName } // createCreateRequest creates the Create request. -func (client *CustomDomainsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters, options *CustomDomainsClientBeginCreateOptions) (*policy.Request, error) { +func (client *CustomDomainsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters, _ *CustomDomainsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -124,7 +121,7 @@ func (client *CustomDomainsClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, customDomainProperties); err != nil { @@ -136,7 +133,7 @@ func (client *CustomDomainsClient) createCreateRequest(ctx context.Context, reso // BeginDelete - Deletes an existing custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -163,7 +160,7 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes an existing custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CustomDomainsClient.BeginDelete" @@ -186,7 +183,7 @@ func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resource } // deleteCreateRequest creates the Delete request. -func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, _ *CustomDomainsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -213,7 +210,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -222,7 +219,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso // BeginDisableCustomHTTPS - Disable https delivery of the custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -249,7 +246,7 @@ func (client *CustomDomainsClient) BeginDisableCustomHTTPS(ctx context.Context, // DisableCustomHTTPS - Disable https delivery of the custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *CustomDomainsClient) disableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDisableCustomHTTPSOptions) (*http.Response, error) { var err error const operationName = "CustomDomainsClient.BeginDisableCustomHTTPS" @@ -272,7 +269,7 @@ func (client *CustomDomainsClient) disableCustomHTTPS(ctx context.Context, resou } // disableCustomHTTPSCreateRequest creates the DisableCustomHTTPS request. -func (client *CustomDomainsClient) disableCustomHTTPSCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDisableCustomHTTPSOptions) (*policy.Request, error) { +func (client *CustomDomainsClient) disableCustomHTTPSCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, _ *CustomDomainsClientBeginDisableCustomHTTPSOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -299,7 +296,7 @@ func (client *CustomDomainsClient) disableCustomHTTPSCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,7 +305,7 @@ func (client *CustomDomainsClient) disableCustomHTTPSCreateRequest(ctx context.C // BeginEnableCustomHTTPS - Enable https delivery of the custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -335,7 +332,7 @@ func (client *CustomDomainsClient) BeginEnableCustomHTTPS(ctx context.Context, r // EnableCustomHTTPS - Enable https delivery of the custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *CustomDomainsClient) enableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginEnableCustomHTTPSOptions) (*http.Response, error) { var err error const operationName = "CustomDomainsClient.BeginEnableCustomHTTPS" @@ -385,7 +382,7 @@ func (client *CustomDomainsClient) enableCustomHTTPSCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CustomDomainHTTPSParameters != nil { @@ -400,7 +397,7 @@ func (client *CustomDomainsClient) enableCustomHTTPSCreateRequest(ctx context.Co // Get - Gets an existing custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -429,7 +426,7 @@ func (client *CustomDomainsClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientGetOptions) (*policy.Request, error) { +func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, _ *CustomDomainsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -456,7 +453,7 @@ func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -473,7 +470,7 @@ func (client *CustomDomainsClient) getHandleResponse(resp *http.Response) (Custo // NewListByEndpointPager - Lists all of the existing custom domains within an endpoint. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -503,7 +500,7 @@ func (client *CustomDomainsClient) NewListByEndpointPager(resourceGroupName stri } // listByEndpointCreateRequest creates the ListByEndpoint request. -func (client *CustomDomainsClient) listByEndpointCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *CustomDomainsClientListByEndpointOptions) (*policy.Request, error) { +func (client *CustomDomainsClient) listByEndpointCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *CustomDomainsClientListByEndpointOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -526,7 +523,7 @@ func (client *CustomDomainsClient) listByEndpointCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/customdomains_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/customdomains_client_example_test.go deleted file mode 100644 index 47bbbe34b1a2..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/customdomains_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_ListByEndpoint.json -func ExampleCustomDomainsClient_NewListByEndpointPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomDomainsClient().NewListByEndpointPager("RG", "profile1", "endpoint1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomDomainListResult = armcdn.CustomDomainListResult{ - // Value: []*armcdn.CustomDomain{ - // { - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"), - // Properties: &armcdn.CustomDomainProperties{ - // CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateDisabled), - // CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstate("None")), - // HostName: to.Ptr("www.someDomain.net"), - // ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")), - // ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_Get.json -func ExampleCustomDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomDomainsClient().Get(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomain = armcdn.CustomDomain{ - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"), - // Properties: &armcdn.CustomDomainProperties{ - // CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateDisabled), - // CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstate("None")), - // HostName: to.Ptr("www.someDomain.net"), - // ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")), - // ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_Create.json -func ExampleCustomDomainsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginCreate(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", armcdn.CustomDomainParameters{ - Properties: &armcdn.CustomDomainPropertiesParameters{ - HostName: to.Ptr("www.someDomain.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomain = armcdn.CustomDomain{ - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"), - // Properties: &armcdn.CustomDomainProperties{ - // CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateEnabling), - // CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstatePendingDomainControlValidationREquestApproval), - // HostName: to.Ptr("www.someDomain.net"), - // ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")), - // ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_Delete.json -func ExampleCustomDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginDelete(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_DisableCustomHttps.json -func ExampleCustomDomainsClient_BeginDisableCustomHTTPS() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginDisableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomain = armcdn.CustomDomain{ - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"), - // Properties: &armcdn.CustomDomainProperties{ - // CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateDisabled), - // CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstateCertificateDeleted), - // HostName: to.Ptr("www.someDomain.net"), - // ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")), - // ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json -func ExampleCustomDomainsClient_BeginEnableCustomHTTPS_customDomainsEnableCustomHttpsUsingCdnManagedCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginEnableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", &armcdn.CustomDomainsClientBeginEnableCustomHTTPSOptions{CustomDomainHTTPSParameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomain = armcdn.CustomDomain{ - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"), - // Properties: &armcdn.CustomDomainProperties{ - // CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateEnabled), - // CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstateCertificateDeployed), - // HostName: to.Ptr("www.someDomain.net"), - // ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")), - // ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive), - // ValidationData: to.Ptr("validationdata"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CustomDomains_EnableCustomHttpsUsingBYOC.json -func ExampleCustomDomainsClient_BeginEnableCustomHTTPS_customDomainsEnableCustomHttpsUsingYourOwnCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginEnableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", &armcdn.CustomDomainsClientBeginEnableCustomHTTPSOptions{CustomDomainHTTPSParameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomain = armcdn.CustomDomain{ - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"), - // Properties: &armcdn.CustomDomainProperties{ - // CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateEnabled), - // CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstateCertificateDeployed), - // HostName: to.Ptr("www.someDomain.net"), - // ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")), - // ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive), - // ValidationData: to.Ptr("validationdata"), - // }, - // } -} diff --git a/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go b/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go index bc0f7e6d505c..f3751b817e88 100644 --- a/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go +++ b/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -39,7 +36,7 @@ func NewEdgeNodesClient(credential azcore.TokenCredential, options *arm.ClientOp // NewListPager - Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - options - EdgeNodesClientListOptions contains the optional parameters for the EdgeNodesClient.NewListPager method. func (client *EdgeNodesClient) NewListPager(options *EdgeNodesClientListOptions) *runtime.Pager[EdgeNodesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[EdgeNodesClientListResponse]{ @@ -65,14 +62,14 @@ func (client *EdgeNodesClient) NewListPager(options *EdgeNodesClientListOptions) } // listCreateRequest creates the List request. -func (client *EdgeNodesClient) listCreateRequest(ctx context.Context, options *EdgeNodesClientListOptions) (*policy.Request, error) { +func (client *EdgeNodesClient) listCreateRequest(ctx context.Context, _ *EdgeNodesClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Cdn/edgenodes" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/edgenodes_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/edgenodes_client_example_test.go deleted file mode 100644 index 68f2ecd5cef6..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/edgenodes_client_example_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/EdgeNodes_List.json -func ExampleEdgeNodesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEdgeNodesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EdgenodeResult = armcdn.EdgenodeResult{ - // Value: []*armcdn.EdgeNode{ - // { - // Name: to.Ptr("Standard_Verizon"), - // Type: to.Ptr("Microsoft.Cdn/edgenodes"), - // ID: to.Ptr("/providers/Microsoft.Cdn/edgenodes/Standard_Verizon"), - // Properties: &armcdn.EdgeNodeProperties{ - // IPAddressGroups: []*armcdn.IPAddressGroup{ - // { - // DeliveryRegion: to.Ptr("All"), - // IPv4Addresses: []*armcdn.CidrIPAddress{ - // { - // BaseIPAddress: to.Ptr("192.229.176.0"), - // PrefixLength: to.Ptr[int32](24), - // }, - // { - // BaseIPAddress: to.Ptr("180.240.184.128"), - // PrefixLength: to.Ptr[int32](25), - // }, - // { - // BaseIPAddress: to.Ptr("152.195.27.0"), - // PrefixLength: to.Ptr[int32](24), - // }}, - // IPv6Addresses: []*armcdn.CidrIPAddress{ - // { - // BaseIPAddress: to.Ptr("2606:2800:60f2::"), - // PrefixLength: to.Ptr[int32](48), - // }, - // { - // BaseIPAddress: to.Ptr("2606:2800:700c::"), - // PrefixLength: to.Ptr[int32](48), - // }}, - // }}, - // }, - // }, - // { - // Name: to.Ptr("Premium_Verizon"), - // Type: to.Ptr("Microsoft.Cdn/edgenodes"), - // ID: to.Ptr("/providers/Microsoft.Cdn/edgenodes/Premium_Verizon"), - // Properties: &armcdn.EdgeNodeProperties{ - // IPAddressGroups: []*armcdn.IPAddressGroup{ - // { - // DeliveryRegion: to.Ptr("All"), - // IPv4Addresses: []*armcdn.CidrIPAddress{ - // { - // BaseIPAddress: to.Ptr("192.229.176.0"), - // PrefixLength: to.Ptr[int32](24), - // }, - // { - // BaseIPAddress: to.Ptr("152.195.27.0"), - // PrefixLength: to.Ptr[int32](24), - // }}, - // IPv6Addresses: []*armcdn.CidrIPAddress{ - // { - // BaseIPAddress: to.Ptr("2606:2800:60f2::"), - // PrefixLength: to.Ptr[int32](48), - // }, - // { - // BaseIPAddress: to.Ptr("2606:2800:700c::"), - // PrefixLength: to.Ptr[int32](48), - // }}, - // }}, - // }, - // }, - // { - // Name: to.Ptr("Custom_Verizon"), - // Type: to.Ptr("Microsoft.Cdn/edgenodes"), - // ID: to.Ptr("/providers/Microsoft.Cdn/edgenodes/Custom_Verizon"), - // Properties: &armcdn.EdgeNodeProperties{ - // IPAddressGroups: []*armcdn.IPAddressGroup{ - // { - // DeliveryRegion: to.Ptr("All"), - // IPv4Addresses: []*armcdn.CidrIPAddress{ - // { - // BaseIPAddress: to.Ptr("192.229.176.0"), - // PrefixLength: to.Ptr[int32](24), - // }, - // { - // BaseIPAddress: to.Ptr("2606:2800:420b::"), - // PrefixLength: to.Ptr[int32](48), - // }, - // { - // BaseIPAddress: to.Ptr("2606:2800:700c::"), - // PrefixLength: to.Ptr[int32](48), - // }}, - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/endpoints_client.go b/sdk/resourcemanager/cdn/armcdn/endpoints_client.go index a7b227fc7395..03a987fd9229 100644 --- a/sdk/resourcemanager/cdn/armcdn/endpoints_client.go +++ b/sdk/resourcemanager/cdn/armcdn/endpoints_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewEndpointsClient(subscriptionID string, credential azcore.TokenCredential // and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -74,7 +71,7 @@ func (client *EndpointsClient) BeginCreate(ctx context.Context, resourceGroupNam // profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *EndpointsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint Endpoint, options *EndpointsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "EndpointsClient.BeginCreate" @@ -97,7 +94,7 @@ func (client *EndpointsClient) create(ctx context.Context, resourceGroupName str } // createCreateRequest creates the Create request. -func (client *EndpointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint Endpoint, options *EndpointsClientBeginCreateOptions) (*policy.Request, error) { +func (client *EndpointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint Endpoint, _ *EndpointsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -120,7 +117,7 @@ func (client *EndpointsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, endpoint); err != nil { @@ -133,7 +130,7 @@ func (client *EndpointsClient) createCreateRequest(ctx context.Context, resource // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -159,7 +156,7 @@ func (client *EndpointsClient) BeginDelete(ctx context.Context, resourceGroupNam // and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *EndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "EndpointsClient.BeginDelete" @@ -182,7 +179,7 @@ func (client *EndpointsClient) deleteOperation(ctx context.Context, resourceGrou } // deleteCreateRequest creates the Delete request. -func (client *EndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *EndpointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *EndpointsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -205,7 +202,7 @@ func (client *EndpointsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +212,7 @@ func (client *EndpointsClient) deleteCreateRequest(ctx context.Context, resource // profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -243,7 +240,7 @@ func (client *EndpointsClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *EndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientGetOptions) (*policy.Request, error) { +func (client *EndpointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *EndpointsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -266,7 +263,7 @@ func (client *EndpointsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +280,7 @@ func (client *EndpointsClient) getHandleResponse(resp *http.Response) (Endpoints // NewListByProfilePager - Lists existing CDN endpoints. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - options - EndpointsClientListByProfileOptions contains the optional parameters for the EndpointsClient.NewListByProfilePager @@ -312,7 +309,7 @@ func (client *EndpointsClient) NewListByProfilePager(resourceGroupName string, p } // listByProfileCreateRequest creates the ListByProfile request. -func (client *EndpointsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *EndpointsClientListByProfileOptions) (*policy.Request, error) { +func (client *EndpointsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *EndpointsClientListByProfileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -331,7 +328,7 @@ func (client *EndpointsClient) listByProfileCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +345,7 @@ func (client *EndpointsClient) listByProfileHandleResponse(resp *http.Response) // NewListResourceUsagePager - Checks the quota and usage of geo filters and custom domains under the given endpoint. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -378,7 +375,7 @@ func (client *EndpointsClient) NewListResourceUsagePager(resourceGroupName strin } // listResourceUsageCreateRequest creates the ListResourceUsage request. -func (client *EndpointsClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientListResourceUsageOptions) (*policy.Request, error) { +func (client *EndpointsClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *EndpointsClientListResourceUsageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/checkResourceUsage" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -401,7 +398,7 @@ func (client *EndpointsClient) listResourceUsageCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -419,7 +416,7 @@ func (client *EndpointsClient) listResourceUsageHandleResponse(resp *http.Respon // BeginLoadContent - Pre-loads a content to CDN. Available for Verizon Profiles. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -447,7 +444,7 @@ func (client *EndpointsClient) BeginLoadContent(ctx context.Context, resourceGro // LoadContent - Pre-loads a content to CDN. Available for Verizon Profiles. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *EndpointsClient) loadContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters, options *EndpointsClientBeginLoadContentOptions) (*http.Response, error) { var err error const operationName = "EndpointsClient.BeginLoadContent" @@ -470,7 +467,7 @@ func (client *EndpointsClient) loadContent(ctx context.Context, resourceGroupNam } // loadContentCreateRequest creates the LoadContent request. -func (client *EndpointsClient) loadContentCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters, options *EndpointsClientBeginLoadContentOptions) (*policy.Request, error) { +func (client *EndpointsClient) loadContentCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters, _ *EndpointsClientBeginLoadContentOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -493,7 +490,7 @@ func (client *EndpointsClient) loadContentCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, contentFilePaths); err != nil { @@ -505,7 +502,7 @@ func (client *EndpointsClient) loadContentCreateRequest(ctx context.Context, res // BeginPurgeContent - Removes a content from CDN. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -534,7 +531,7 @@ func (client *EndpointsClient) BeginPurgeContent(ctx context.Context, resourceGr // PurgeContent - Removes a content from CDN. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *EndpointsClient) purgeContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters, options *EndpointsClientBeginPurgeContentOptions) (*http.Response, error) { var err error const operationName = "EndpointsClient.BeginPurgeContent" @@ -557,7 +554,7 @@ func (client *EndpointsClient) purgeContent(ctx context.Context, resourceGroupNa } // purgeContentCreateRequest creates the PurgeContent request. -func (client *EndpointsClient) purgeContentCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters, options *EndpointsClientBeginPurgeContentOptions) (*policy.Request, error) { +func (client *EndpointsClient) purgeContentCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters, _ *EndpointsClientBeginPurgeContentOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -580,7 +577,7 @@ func (client *EndpointsClient) purgeContentCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, contentFilePaths); err != nil { @@ -592,7 +589,7 @@ func (client *EndpointsClient) purgeContentCreateRequest(ctx context.Context, re // BeginStart - Starts an existing CDN endpoint that is on a stopped state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -617,7 +614,7 @@ func (client *EndpointsClient) BeginStart(ctx context.Context, resourceGroupName // Start - Starts an existing CDN endpoint that is on a stopped state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *EndpointsClient) start(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "EndpointsClient.BeginStart" @@ -640,7 +637,7 @@ func (client *EndpointsClient) start(ctx context.Context, resourceGroupName stri } // startCreateRequest creates the Start request. -func (client *EndpointsClient) startCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginStartOptions) (*policy.Request, error) { +func (client *EndpointsClient) startCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *EndpointsClientBeginStartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -663,7 +660,7 @@ func (client *EndpointsClient) startCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -672,7 +669,7 @@ func (client *EndpointsClient) startCreateRequest(ctx context.Context, resourceG // BeginStop - Stops an existing running CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -697,7 +694,7 @@ func (client *EndpointsClient) BeginStop(ctx context.Context, resourceGroupName // Stop - Stops an existing running CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *EndpointsClient) stop(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "EndpointsClient.BeginStop" @@ -720,7 +717,7 @@ func (client *EndpointsClient) stop(ctx context.Context, resourceGroupName strin } // stopCreateRequest creates the Stop request. -func (client *EndpointsClient) stopCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginStopOptions) (*policy.Request, error) { +func (client *EndpointsClient) stopCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *EndpointsClientBeginStopOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -743,7 +740,7 @@ func (client *EndpointsClient) stopCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -755,7 +752,7 @@ func (client *EndpointsClient) stopCreateRequest(ctx context.Context, resourceGr // use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -784,7 +781,7 @@ func (client *EndpointsClient) BeginUpdate(ctx context.Context, resourceGroupNam // use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *EndpointsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters, options *EndpointsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "EndpointsClient.BeginUpdate" @@ -807,7 +804,7 @@ func (client *EndpointsClient) update(ctx context.Context, resourceGroupName str } // updateCreateRequest creates the Update request. -func (client *EndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters, options *EndpointsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *EndpointsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters, _ *EndpointsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -830,7 +827,7 @@ func (client *EndpointsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, endpointUpdateProperties); err != nil { @@ -842,7 +839,7 @@ func (client *EndpointsClient) updateCreateRequest(ctx context.Context, resource // ValidateCustomDomain - Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -872,7 +869,7 @@ func (client *EndpointsClient) ValidateCustomDomain(ctx context.Context, resourc } // validateCustomDomainCreateRequest creates the ValidateCustomDomain request. -func (client *EndpointsClient) validateCustomDomainCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput, options *EndpointsClientValidateCustomDomainOptions) (*policy.Request, error) { +func (client *EndpointsClient) validateCustomDomainCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput, _ *EndpointsClientValidateCustomDomainOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -895,7 +892,7 @@ func (client *EndpointsClient) validateCustomDomainCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, customDomainProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/endpoints_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/endpoints_client_example_test.go deleted file mode 100644 index 14f1537e747c..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/endpoints_client_example_test.go +++ /dev/null @@ -1,794 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_ListByProfile.json -func ExampleEndpointsClient_NewListByProfilePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEndpointsClient().NewListByProfilePager("RG", "profile1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EndpointListResult = armcdn.EndpointListResult{ - // Value: []*armcdn.Endpoint{ - // { - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1"), - // Location: to.Ptr("CentralUs"), - // Tags: map[string]*string{ - // }, - // Properties: &armcdn.EndpointProperties{ - // ContentTypesToCompress: []*string{ - // }, - // DefaultOriginGroup: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1"), - // }, - // GeoFilters: []*armcdn.GeoFilter{ - // }, - // IsCompressionEnabled: to.Ptr(false), - // IsHTTPAllowed: to.Ptr(true), - // IsHTTPSAllowed: to.Ptr(true), - // OptimizationType: to.Ptr(armcdn.OptimizationTypeDynamicSiteAcceleration), - // OriginHostHeader: to.Ptr("www.bing.com"), - // ProbePath: to.Ptr("/image"), - // QueryStringCachingBehavior: to.Ptr(armcdn.QueryStringCachingBehaviorNotSet), - // CustomDomains: []*armcdn.DeepCreatedCustomDomain{ - // { - // Name: to.Ptr("www-someDomain-net"), - // Properties: &armcdn.DeepCreatedCustomDomainProperties{ - // HostName: to.Ptr("www.someDomain.Net"), - // }, - // }}, - // HostName: to.Ptr("endpoint1.azureedge.net"), - // OriginGroups: []*armcdn.DeepCreatedOriginGroup{ - // { - // Name: to.Ptr("originGroup1"), - // Properties: &armcdn.DeepCreatedOriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](120), - // ProbePath: to.Ptr("/health.aspx"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - // }, - // Origins: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/www-bing-com"), - // }}, - // ResponseBasedOriginErrorDetectionSettings: &armcdn.ResponseBasedOriginErrorDetectionParameters{ - // ResponseBasedDetectedErrorTypes: to.Ptr(armcdn.ResponseBasedDetectedErrorTypesTCPErrorsOnly), - // ResponseBasedFailoverThresholdPercentage: to.Ptr[int32](10), - // }, - // }, - // }}, - // Origins: []*armcdn.DeepCreatedOrigin{ - // { - // Name: to.Ptr("www-bing-com"), - // Properties: &armcdn.DeepCreatedOriginProperties{ - // Enabled: to.Ptr(true), - // HostName: to.Ptr("www.bing.com"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginHostHeader: to.Ptr("www.someDomain2.net"), - // Priority: to.Ptr[int32](2), - // Weight: to.Ptr[int32](50), - // }, - // }}, - // ProvisioningState: to.Ptr(armcdn.EndpointProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.EndpointResourceStateRunning), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_Get.json -func ExampleEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEndpointsClient().Get(ctx, "RG", "profile1", "endpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Endpoint = armcdn.Endpoint{ - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1"), - // Location: to.Ptr("CentralUs"), - // Tags: map[string]*string{ - // }, - // Properties: &armcdn.EndpointProperties{ - // ContentTypesToCompress: []*string{ - // }, - // DefaultOriginGroup: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1"), - // }, - // GeoFilters: []*armcdn.GeoFilter{ - // }, - // IsCompressionEnabled: to.Ptr(false), - // IsHTTPAllowed: to.Ptr(true), - // IsHTTPSAllowed: to.Ptr(true), - // OptimizationType: to.Ptr(armcdn.OptimizationTypeDynamicSiteAcceleration), - // OriginHostHeader: to.Ptr("www.bing.com"), - // ProbePath: to.Ptr("/image"), - // QueryStringCachingBehavior: to.Ptr(armcdn.QueryStringCachingBehaviorNotSet), - // CustomDomains: []*armcdn.DeepCreatedCustomDomain{ - // { - // Name: to.Ptr("www-someDomain-net"), - // Properties: &armcdn.DeepCreatedCustomDomainProperties{ - // HostName: to.Ptr("www.someDomain.Net"), - // }, - // }}, - // HostName: to.Ptr("endpoint1.azureedge.net"), - // OriginGroups: []*armcdn.DeepCreatedOriginGroup{ - // { - // Name: to.Ptr("originGroup1"), - // Properties: &armcdn.DeepCreatedOriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](120), - // ProbePath: to.Ptr("/health.aspx"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - // }, - // Origins: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/www-bing-com"), - // }}, - // }, - // }}, - // Origins: []*armcdn.DeepCreatedOrigin{ - // { - // Name: to.Ptr("www-bing-com"), - // Properties: &armcdn.DeepCreatedOriginProperties{ - // Enabled: to.Ptr(true), - // HostName: to.Ptr("www.bing.com"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginHostHeader: to.Ptr("www.someDomain2.net"), - // Priority: to.Ptr[int32](2), - // Weight: to.Ptr[int32](50), - // }, - // }}, - // ProvisioningState: to.Ptr(armcdn.EndpointProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.EndpointResourceStateRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_Create.json -func ExampleEndpointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEndpointsClient().BeginCreate(ctx, "RG", "profile1", "endpoint1", armcdn.Endpoint{ - Location: to.Ptr("WestUs"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armcdn.EndpointProperties{ - ContentTypesToCompress: []*string{ - to.Ptr("text/html"), - to.Ptr("application/octet-stream")}, - DefaultOriginGroup: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1"), - }, - DeliveryPolicy: &armcdn.EndpointPropertiesUpdateParametersDeliveryPolicy{ - Description: to.Ptr("Test description for a policy."), - Rules: []*armcdn.DeliveryRule{ - { - Name: to.Ptr("rule1"), - Actions: []armcdn.DeliveryRuleActionAutoGeneratedClassification{ - &armcdn.DeliveryRuleCacheExpirationAction{ - Name: to.Ptr(armcdn.DeliveryRuleActionCacheExpiration), - Parameters: &armcdn.CacheExpirationActionParameters{ - CacheBehavior: to.Ptr(armcdn.CacheBehaviorOverride), - CacheDuration: to.Ptr("10:10:09"), - CacheType: to.Ptr(armcdn.CacheTypeAll), - TypeName: to.Ptr(armcdn.CacheExpirationActionParametersTypeNameDeliveryRuleCacheExpirationActionParameters), - }, - }, - &armcdn.DeliveryRuleResponseHeaderAction{ - Name: to.Ptr(armcdn.DeliveryRuleActionModifyResponseHeader), - Parameters: &armcdn.HeaderActionParameters{ - HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - HeaderName: to.Ptr("Access-Control-Allow-Origin"), - TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - Value: to.Ptr("*"), - }, - }, - &armcdn.DeliveryRuleRequestHeaderAction{ - Name: to.Ptr(armcdn.DeliveryRuleActionModifyRequestHeader), - Parameters: &armcdn.HeaderActionParameters{ - HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - HeaderName: to.Ptr("Accept-Encoding"), - TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - Value: to.Ptr("gzip"), - }, - }}, - Conditions: []armcdn.DeliveryRuleConditionClassification{ - &armcdn.DeliveryRuleRemoteAddressCondition{ - Name: to.Ptr(armcdn.MatchVariableRemoteAddress), - Parameters: &armcdn.RemoteAddressMatchConditionParameters{ - MatchValues: []*string{ - to.Ptr("192.168.1.0/24"), - to.Ptr("10.0.0.0/24")}, - NegateCondition: to.Ptr(true), - Operator: to.Ptr(armcdn.RemoteAddressOperatorIPMatch), - TypeName: to.Ptr(armcdn.RemoteAddressMatchConditionParametersTypeNameDeliveryRuleRemoteAddressConditionParameters), - }, - }}, - Order: to.Ptr[int32](1), - }}, - }, - IsCompressionEnabled: to.Ptr(true), - IsHTTPAllowed: to.Ptr(true), - IsHTTPSAllowed: to.Ptr(true), - OriginHostHeader: to.Ptr("www.bing.com"), - OriginPath: to.Ptr("/photos"), - QueryStringCachingBehavior: to.Ptr(armcdn.QueryStringCachingBehaviorBypassCaching), - OriginGroups: []*armcdn.DeepCreatedOriginGroup{ - { - Name: to.Ptr("originGroup1"), - Properties: &armcdn.DeepCreatedOriginGroupProperties{ - HealthProbeSettings: &armcdn.HealthProbeParameters{ - ProbeIntervalInSeconds: to.Ptr[int32](120), - ProbePath: to.Ptr("/health.aspx"), - ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - }, - Origins: []*armcdn.ResourceReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2"), - }}, - ResponseBasedOriginErrorDetectionSettings: &armcdn.ResponseBasedOriginErrorDetectionParameters{ - ResponseBasedDetectedErrorTypes: to.Ptr(armcdn.ResponseBasedDetectedErrorTypesTCPErrorsOnly), - ResponseBasedFailoverThresholdPercentage: to.Ptr[int32](10), - }, - }, - }}, - Origins: []*armcdn.DeepCreatedOrigin{ - { - Name: to.Ptr("origin1"), - Properties: &armcdn.DeepCreatedOriginProperties{ - Enabled: to.Ptr(true), - HostName: to.Ptr("www.someDomain1.net"), - HTTPPort: to.Ptr[int32](80), - HTTPSPort: to.Ptr[int32](443), - OriginHostHeader: to.Ptr("www.someDomain1.net"), - Priority: to.Ptr[int32](1), - Weight: to.Ptr[int32](50), - }, - }, - { - Name: to.Ptr("origin2"), - Properties: &armcdn.DeepCreatedOriginProperties{ - Enabled: to.Ptr(true), - HostName: to.Ptr("www.someDomain2.net"), - HTTPPort: to.Ptr[int32](80), - HTTPSPort: to.Ptr[int32](443), - OriginHostHeader: to.Ptr("www.someDomain2.net"), - Priority: to.Ptr[int32](2), - Weight: to.Ptr[int32](50), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Endpoint = armcdn.Endpoint{ - // Name: to.Ptr("endpoint4899"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "kay1": to.Ptr("value1"), - // }, - // Properties: &armcdn.EndpointProperties{ - // ContentTypesToCompress: []*string{ - // to.Ptr("text/html"), - // to.Ptr("application/octet-stream")}, - // DefaultOriginGroup: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1"), - // }, - // DeliveryPolicy: &armcdn.EndpointPropertiesUpdateParametersDeliveryPolicy{ - // Description: to.Ptr("Test description for a policy."), - // Rules: []*armcdn.DeliveryRule{ - // { - // Name: to.Ptr("rule1"), - // Actions: []armcdn.DeliveryRuleActionAutoGeneratedClassification{ - // &armcdn.DeliveryRuleCacheExpirationAction{ - // Name: to.Ptr(armcdn.DeliveryRuleActionCacheExpiration), - // Parameters: &armcdn.CacheExpirationActionParameters{ - // CacheBehavior: to.Ptr(armcdn.CacheBehaviorOverride), - // CacheDuration: to.Ptr("10:10:09"), - // CacheType: to.Ptr(armcdn.CacheTypeAll), - // TypeName: to.Ptr(armcdn.CacheExpirationActionParametersTypeNameDeliveryRuleCacheExpirationActionParameters), - // }, - // }, - // &armcdn.DeliveryRuleResponseHeaderAction{ - // Name: to.Ptr(armcdn.DeliveryRuleActionModifyResponseHeader), - // Parameters: &armcdn.HeaderActionParameters{ - // HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - // HeaderName: to.Ptr("Access-Control-Allow-Origin"), - // TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - // Value: to.Ptr("*"), - // }, - // }, - // &armcdn.DeliveryRuleRequestHeaderAction{ - // Name: to.Ptr(armcdn.DeliveryRuleActionModifyRequestHeader), - // Parameters: &armcdn.HeaderActionParameters{ - // HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - // HeaderName: to.Ptr("Accept-Encoding"), - // TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - // Value: to.Ptr("gzip"), - // }, - // }}, - // Conditions: []armcdn.DeliveryRuleConditionClassification{ - // &armcdn.DeliveryRuleRemoteAddressCondition{ - // Name: to.Ptr(armcdn.MatchVariableRemoteAddress), - // Parameters: &armcdn.RemoteAddressMatchConditionParameters{ - // MatchValues: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // NegateCondition: to.Ptr(true), - // Operator: to.Ptr(armcdn.RemoteAddressOperatorIPMatch), - // Transforms: []*armcdn.Transform{ - // }, - // TypeName: to.Ptr(armcdn.RemoteAddressMatchConditionParametersTypeNameDeliveryRuleRemoteAddressConditionParameters), - // }, - // }}, - // Order: to.Ptr[int32](1), - // }}, - // }, - // GeoFilters: []*armcdn.GeoFilter{ - // }, - // IsCompressionEnabled: to.Ptr(true), - // IsHTTPAllowed: to.Ptr(true), - // IsHTTPSAllowed: to.Ptr(true), - // OriginHostHeader: to.Ptr("www.bing.com"), - // OriginPath: to.Ptr("/photos"), - // QueryStringCachingBehavior: to.Ptr(armcdn.QueryStringCachingBehaviorBypassCaching), - // HostName: to.Ptr("endpoint4899.azureedge-test.net"), - // OriginGroups: []*armcdn.DeepCreatedOriginGroup{ - // { - // Name: to.Ptr("originGroup1"), - // Properties: &armcdn.DeepCreatedOriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](120), - // ProbePath: to.Ptr("/health.aspx"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - // }, - // Origins: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2"), - // }}, - // ResponseBasedOriginErrorDetectionSettings: &armcdn.ResponseBasedOriginErrorDetectionParameters{ - // ResponseBasedDetectedErrorTypes: to.Ptr(armcdn.ResponseBasedDetectedErrorTypesTCPErrorsOnly), - // ResponseBasedFailoverThresholdPercentage: to.Ptr[int32](10), - // }, - // }, - // }}, - // Origins: []*armcdn.DeepCreatedOrigin{ - // { - // Name: to.Ptr("origin1"), - // Properties: &armcdn.DeepCreatedOriginProperties{ - // Enabled: to.Ptr(true), - // HostName: to.Ptr("www.someDomain1.net"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginHostHeader: to.Ptr("www.someDomain1.net"), - // Priority: to.Ptr[int32](1), - // Weight: to.Ptr[int32](50), - // }, - // }, - // { - // Name: to.Ptr("origin2"), - // Properties: &armcdn.DeepCreatedOriginProperties{ - // Enabled: to.Ptr(true), - // HostName: to.Ptr("www.someDomain2.net"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginHostHeader: to.Ptr("www.someDomain2.net"), - // Priority: to.Ptr[int32](2), - // Weight: to.Ptr[int32](50), - // }, - // }}, - // ProvisioningState: to.Ptr(armcdn.EndpointProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.EndpointResourceStateCreating), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_Update.json -func ExampleEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEndpointsClient().BeginUpdate(ctx, "RG", "profile1", "endpoint1", armcdn.EndpointUpdateParameters{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("Tag1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Endpoint = armcdn.Endpoint{ - // Name: to.Ptr("endpoint1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1"), - // Location: to.Ptr("WestCentralUs"), - // Tags: map[string]*string{ - // "additionalProperties": to.Ptr("Tag1"), - // }, - // Properties: &armcdn.EndpointProperties{ - // ContentTypesToCompress: []*string{ - // }, - // DefaultOriginGroup: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1"), - // }, - // GeoFilters: []*armcdn.GeoFilter{ - // }, - // IsCompressionEnabled: to.Ptr(false), - // IsHTTPAllowed: to.Ptr(true), - // IsHTTPSAllowed: to.Ptr(true), - // QueryStringCachingBehavior: to.Ptr(armcdn.QueryStringCachingBehaviorIgnoreQueryString), - // HostName: to.Ptr("endpoint1.azureedge.net"), - // OriginGroups: []*armcdn.DeepCreatedOriginGroup{ - // { - // Name: to.Ptr("originGroup1"), - // Properties: &armcdn.DeepCreatedOriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](120), - // ProbePath: to.Ptr("/health.aspx"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - // }, - // Origins: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/www-bing-com"), - // }}, - // }, - // }}, - // Origins: []*armcdn.DeepCreatedOrigin{ - // { - // Name: to.Ptr("www-bing-com"), - // Properties: &armcdn.DeepCreatedOriginProperties{ - // Enabled: to.Ptr(true), - // HostName: to.Ptr("www.bing.com"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginHostHeader: to.Ptr("www.someDomain2.net"), - // Priority: to.Ptr[int32](2), - // Weight: to.Ptr[int32](50), - // }, - // }}, - // ProvisioningState: to.Ptr(armcdn.EndpointProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.EndpointResourceStateCreating), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_Delete.json -func ExampleEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEndpointsClient().BeginDelete(ctx, "RG", "profile1", "endpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_Start.json -func ExampleEndpointsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEndpointsClient().BeginStart(ctx, "RG", "profile1", "endpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Endpoint = armcdn.Endpoint{ - // Name: to.Ptr("endpoint4899"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "kay1": to.Ptr("value1"), - // }, - // Properties: &armcdn.EndpointProperties{ - // ContentTypesToCompress: []*string{ - // }, - // GeoFilters: []*armcdn.GeoFilter{ - // }, - // IsCompressionEnabled: to.Ptr(false), - // IsHTTPAllowed: to.Ptr(true), - // IsHTTPSAllowed: to.Ptr(true), - // OptimizationType: to.Ptr(armcdn.OptimizationTypeDynamicSiteAcceleration), - // OriginHostHeader: to.Ptr("www.bing.com"), - // ProbePath: to.Ptr("/image"), - // QueryStringCachingBehavior: to.Ptr(armcdn.QueryStringCachingBehaviorNotSet), - // HostName: to.Ptr("endpoint1.azureedge.net"), - // Origins: []*armcdn.DeepCreatedOrigin{ - // { - // Name: to.Ptr("www-bing-com"), - // Properties: &armcdn.DeepCreatedOriginProperties{ - // HostName: to.Ptr("www.bing.com"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // }, - // }}, - // ProvisioningState: to.Ptr(armcdn.EndpointProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.EndpointResourceStateStarting), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_Stop.json -func ExampleEndpointsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEndpointsClient().BeginStop(ctx, "RG", "profile1", "endpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Endpoint = armcdn.Endpoint{ - // Name: to.Ptr("endpoint4899"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "kay1": to.Ptr("value1"), - // }, - // Properties: &armcdn.EndpointProperties{ - // ContentTypesToCompress: []*string{ - // }, - // GeoFilters: []*armcdn.GeoFilter{ - // }, - // IsCompressionEnabled: to.Ptr(false), - // IsHTTPAllowed: to.Ptr(true), - // IsHTTPSAllowed: to.Ptr(true), - // OptimizationType: to.Ptr(armcdn.OptimizationTypeDynamicSiteAcceleration), - // OriginHostHeader: to.Ptr("www.bing.com"), - // ProbePath: to.Ptr("/image"), - // QueryStringCachingBehavior: to.Ptr(armcdn.QueryStringCachingBehaviorNotSet), - // HostName: to.Ptr("endpoint1.azureedge.net"), - // Origins: []*armcdn.DeepCreatedOrigin{ - // { - // Name: to.Ptr("www-bing-com"), - // Properties: &armcdn.DeepCreatedOriginProperties{ - // HostName: to.Ptr("www.bing.com"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // }, - // }}, - // ProvisioningState: to.Ptr(armcdn.EndpointProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.EndpointResourceStateStopping), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_PurgeContent.json -func ExampleEndpointsClient_BeginPurgeContent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEndpointsClient().BeginPurgeContent(ctx, "RG", "profile1", "endpoint1", armcdn.PurgeParameters{ - ContentPaths: []*string{ - to.Ptr("/folder1")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_LoadContent.json -func ExampleEndpointsClient_BeginLoadContent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewEndpointsClient().BeginLoadContent(ctx, "RG", "profile1", "endpoint1", armcdn.LoadParameters{ - ContentPaths: []*string{ - to.Ptr("/folder1")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_ValidateCustomDomain.json -func ExampleEndpointsClient_ValidateCustomDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEndpointsClient().ValidateCustomDomain(ctx, "RG", "profile1", "endpoint1", armcdn.ValidateCustomDomainInput{ - HostName: to.Ptr("www.someDomain.com"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateCustomDomainOutput = armcdn.ValidateCustomDomainOutput{ - // CustomDomainValidated: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Endpoints_ListResourceUsage.json -func ExampleEndpointsClient_NewListResourceUsagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEndpointsClient().NewListResourceUsagePager("RG", "profile1", "endpoint1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceUsageListResult = armcdn.ResourceUsageListResult{ - // Value: []*armcdn.ResourceUsage{ - // { - // CurrentValue: to.Ptr[int32](1), - // Limit: to.Ptr[int32](20), - // ResourceType: to.Ptr("customdomain"), - // Unit: to.Ptr(armcdn.ResourceUsageUnitCount), - // }, - // { - // CurrentValue: to.Ptr[int32](0), - // Limit: to.Ptr[int32](25), - // ResourceType: to.Ptr("geofilter"), - // Unit: to.Ptr(armcdn.ResourceUsageUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/afdcustomdomains_server.go b/sdk/resourcemanager/cdn/armcdn/fake/afdcustomdomains_server.go index 5cca8cf8d0e5..b496e4235e55 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdcustomdomains_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdcustomdomains_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -41,7 +38,7 @@ type AFDCustomDomainsServer struct { NewListByProfilePager func(resourceGroupName string, profileName string, options *armcdn.AFDCustomDomainsClientListByProfileOptions) (resp azfake.PagerResponder[armcdn.AFDCustomDomainsClientListByProfileResponse]) // BeginRefreshValidationToken is the fake for method AFDCustomDomainsClient.BeginRefreshValidationToken - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRefreshValidationToken func(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *armcdn.AFDCustomDomainsClientBeginRefreshValidationTokenOptions) (resp azfake.PollerResponder[armcdn.AFDCustomDomainsClientRefreshValidationTokenResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method AFDCustomDomainsClient.BeginUpdate @@ -82,31 +79,50 @@ func (a *AFDCustomDomainsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AFDCustomDomainsClient.BeginCreate": - resp, err = a.dispatchBeginCreate(req) - case "AFDCustomDomainsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AFDCustomDomainsClient.Get": - resp, err = a.dispatchGet(req) - case "AFDCustomDomainsClient.NewListByProfilePager": - resp, err = a.dispatchNewListByProfilePager(req) - case "AFDCustomDomainsClient.BeginRefreshValidationToken": - resp, err = a.dispatchBeginRefreshValidationToken(req) - case "AFDCustomDomainsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AFDCustomDomainsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if afdCustomDomainsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = afdCustomDomainsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AFDCustomDomainsClient.BeginCreate": + res.resp, res.err = a.dispatchBeginCreate(req) + case "AFDCustomDomainsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AFDCustomDomainsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AFDCustomDomainsClient.NewListByProfilePager": + res.resp, res.err = a.dispatchNewListByProfilePager(req) + case "AFDCustomDomainsClient.BeginRefreshValidationToken": + res.resp, res.err = a.dispatchBeginRefreshValidationToken(req) + case "AFDCustomDomainsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AFDCustomDomainsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -324,9 +340,9 @@ func (a *AFDCustomDomainsServerTransport) dispatchBeginRefreshValidationToken(re return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginRefreshValidationToken.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRefreshValidationToken) { a.beginRefreshValidationToken.remove(req) @@ -386,3 +402,9 @@ func (a *AFDCustomDomainsServerTransport) dispatchBeginUpdate(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to AFDCustomDomainsServerTransport +var afdCustomDomainsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/afdendpoints_server.go b/sdk/resourcemanager/cdn/armcdn/fake/afdendpoints_server.go index 0d41a8e7e868..95ea9c9e1c8d 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdendpoints_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdendpoints_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -45,7 +42,7 @@ type AFDEndpointsServer struct { NewListResourceUsagePager func(resourceGroupName string, profileName string, endpointName string, options *armcdn.AFDEndpointsClientListResourceUsageOptions) (resp azfake.PagerResponder[armcdn.AFDEndpointsClientListResourceUsageResponse]) // BeginPurgeContent is the fake for method AFDEndpointsClient.BeginPurgeContent - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPurgeContent func(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contents armcdn.AfdPurgeParameters, options *armcdn.AFDEndpointsClientBeginPurgeContentOptions) (resp azfake.PollerResponder[armcdn.AFDEndpointsClientPurgeContentResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method AFDEndpointsClient.BeginUpdate @@ -92,35 +89,54 @@ func (a *AFDEndpointsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "AFDEndpointsClient.BeginCreate": - resp, err = a.dispatchBeginCreate(req) - case "AFDEndpointsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AFDEndpointsClient.Get": - resp, err = a.dispatchGet(req) - case "AFDEndpointsClient.NewListByProfilePager": - resp, err = a.dispatchNewListByProfilePager(req) - case "AFDEndpointsClient.NewListResourceUsagePager": - resp, err = a.dispatchNewListResourceUsagePager(req) - case "AFDEndpointsClient.BeginPurgeContent": - resp, err = a.dispatchBeginPurgeContent(req) - case "AFDEndpointsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - case "AFDEndpointsClient.ValidateCustomDomain": - resp, err = a.dispatchValidateCustomDomain(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return a.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (a *AFDEndpointsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if afdEndpointsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = afdEndpointsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AFDEndpointsClient.BeginCreate": + res.resp, res.err = a.dispatchBeginCreate(req) + case "AFDEndpointsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AFDEndpointsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AFDEndpointsClient.NewListByProfilePager": + res.resp, res.err = a.dispatchNewListByProfilePager(req) + case "AFDEndpointsClient.NewListResourceUsagePager": + res.resp, res.err = a.dispatchNewListResourceUsagePager(req) + case "AFDEndpointsClient.BeginPurgeContent": + res.resp, res.err = a.dispatchBeginPurgeContent(req) + case "AFDEndpointsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + case "AFDEndpointsClient.ValidateCustomDomain": + res.resp, res.err = a.dispatchValidateCustomDomain(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AFDEndpointsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -387,9 +403,9 @@ func (a *AFDEndpointsServerTransport) dispatchBeginPurgeContent(req *http.Reques return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginPurgeContent.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPurgeContent) { a.beginPurgeContent.remove(req) @@ -490,3 +506,9 @@ func (a *AFDEndpointsServerTransport) dispatchValidateCustomDomain(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to AFDEndpointsServerTransport +var afdEndpointsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/afdorigingroups_server.go b/sdk/resourcemanager/cdn/armcdn/fake/afdorigingroups_server.go index eb9a62314d84..08636e055e96 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdorigingroups_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdorigingroups_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -82,31 +79,50 @@ func (a *AFDOriginGroupsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AFDOriginGroupsClient.BeginCreate": - resp, err = a.dispatchBeginCreate(req) - case "AFDOriginGroupsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AFDOriginGroupsClient.Get": - resp, err = a.dispatchGet(req) - case "AFDOriginGroupsClient.NewListByProfilePager": - resp, err = a.dispatchNewListByProfilePager(req) - case "AFDOriginGroupsClient.NewListResourceUsagePager": - resp, err = a.dispatchNewListResourceUsagePager(req) - case "AFDOriginGroupsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AFDOriginGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if afdOriginGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = afdOriginGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AFDOriginGroupsClient.BeginCreate": + res.resp, res.err = a.dispatchBeginCreate(req) + case "AFDOriginGroupsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AFDOriginGroupsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AFDOriginGroupsClient.NewListByProfilePager": + res.resp, res.err = a.dispatchNewListByProfilePager(req) + case "AFDOriginGroupsClient.NewListResourceUsagePager": + res.resp, res.err = a.dispatchNewListResourceUsagePager(req) + case "AFDOriginGroupsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AFDOriginGroupsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -383,3 +399,9 @@ func (a *AFDOriginGroupsServerTransport) dispatchBeginUpdate(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to AFDOriginGroupsServerTransport +var afdOriginGroupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/afdorigins_server.go b/sdk/resourcemanager/cdn/armcdn/fake/afdorigins_server.go index 0f078e43ba36..2f70b112ce06 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdorigins_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdorigins_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -76,29 +73,48 @@ func (a *AFDOriginsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AFDOriginsClient.BeginCreate": - resp, err = a.dispatchBeginCreate(req) - case "AFDOriginsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AFDOriginsClient.Get": - resp, err = a.dispatchGet(req) - case "AFDOriginsClient.NewListByOriginGroupPager": - resp, err = a.dispatchNewListByOriginGroupPager(req) - case "AFDOriginsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AFDOriginsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if afdOriginsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = afdOriginsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AFDOriginsClient.BeginCreate": + res.resp, res.err = a.dispatchBeginCreate(req) + case "AFDOriginsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AFDOriginsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AFDOriginsClient.NewListByOriginGroupPager": + res.resp, res.err = a.dispatchNewListByOriginGroupPager(req) + case "AFDOriginsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AFDOriginsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (a *AFDOriginsServerTransport) dispatchBeginUpdate(req *http.Request) (*htt return resp, nil } + +// set this to conditionally intercept incoming requests to AFDOriginsServerTransport +var afdOriginsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/afdprofiles_server.go b/sdk/resourcemanager/cdn/armcdn/fake/afdprofiles_server.go index 2705d16fd7d0..3d7f582c6592 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdprofiles_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdprofiles_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -72,29 +69,48 @@ func (a *AFDProfilesServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AFDProfilesClient.CheckEndpointNameAvailability": - resp, err = a.dispatchCheckEndpointNameAvailability(req) - case "AFDProfilesClient.CheckHostNameAvailability": - resp, err = a.dispatchCheckHostNameAvailability(req) - case "AFDProfilesClient.NewListResourceUsagePager": - resp, err = a.dispatchNewListResourceUsagePager(req) - case "AFDProfilesClient.BeginUpgrade": - resp, err = a.dispatchBeginUpgrade(req) - case "AFDProfilesClient.ValidateSecret": - resp, err = a.dispatchValidateSecret(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AFDProfilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if afdProfilesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = afdProfilesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AFDProfilesClient.CheckEndpointNameAvailability": + res.resp, res.err = a.dispatchCheckEndpointNameAvailability(req) + case "AFDProfilesClient.CheckHostNameAvailability": + res.resp, res.err = a.dispatchCheckHostNameAvailability(req) + case "AFDProfilesClient.NewListResourceUsagePager": + res.resp, res.err = a.dispatchNewListResourceUsagePager(req) + case "AFDProfilesClient.BeginUpgrade": + res.resp, res.err = a.dispatchBeginUpgrade(req) + case "AFDProfilesClient.ValidateSecret": + res.resp, res.err = a.dispatchValidateSecret(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AFDProfilesServerTransport) dispatchCheckEndpointNameAvailability(req *http.Request) (*http.Response, error) { @@ -296,3 +312,9 @@ func (a *AFDProfilesServerTransport) dispatchValidateSecret(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to AFDProfilesServerTransport +var afdProfilesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/customdomains_server.go b/sdk/resourcemanager/cdn/armcdn/fake/customdomains_server.go index c527697fda24..45258083ca60 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/customdomains_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/customdomains_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "reflect" @@ -83,31 +80,50 @@ func (c *CustomDomainsServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CustomDomainsClient.BeginCreate": - resp, err = c.dispatchBeginCreate(req) - case "CustomDomainsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "CustomDomainsClient.BeginDisableCustomHTTPS": - resp, err = c.dispatchBeginDisableCustomHTTPS(req) - case "CustomDomainsClient.BeginEnableCustomHTTPS": - resp, err = c.dispatchBeginEnableCustomHTTPS(req) - case "CustomDomainsClient.Get": - resp, err = c.dispatchGet(req) - case "CustomDomainsClient.NewListByEndpointPager": - resp, err = c.dispatchNewListByEndpointPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CustomDomainsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if customDomainsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = customDomainsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CustomDomainsClient.BeginCreate": + res.resp, res.err = c.dispatchBeginCreate(req) + case "CustomDomainsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "CustomDomainsClient.BeginDisableCustomHTTPS": + res.resp, res.err = c.dispatchBeginDisableCustomHTTPS(req) + case "CustomDomainsClient.BeginEnableCustomHTTPS": + res.resp, res.err = c.dispatchBeginEnableCustomHTTPS(req) + case "CustomDomainsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CustomDomainsClient.NewListByEndpointPager": + res.resp, res.err = c.dispatchNewListByEndpointPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - if err != nil { - return nil, err - } + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - return resp, nil + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CustomDomainsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -421,3 +437,9 @@ func (c *CustomDomainsServerTransport) dispatchNewListByEndpointPager(req *http. } return resp, nil } + +// set this to conditionally intercept incoming requests to CustomDomainsServerTransport +var customDomainsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/edgenodes_server.go b/sdk/resourcemanager/cdn/armcdn/fake/edgenodes_server.go index 74ab17437ce1..73809a3234cc 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/edgenodes_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/edgenodes_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" ) @@ -51,21 +48,40 @@ func (e *EdgeNodesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "EdgeNodesClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *EdgeNodesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if edgeNodesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = edgeNodesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "EdgeNodesClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *EdgeNodesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (e *EdgeNodesServerTransport) dispatchNewListPager(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to EdgeNodesServerTransport +var edgeNodesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/endpoints_server.go b/sdk/resourcemanager/cdn/armcdn/fake/endpoints_server.go index ba0342c7f429..d486288283c3 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/endpoints_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/endpoints_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -45,11 +42,11 @@ type EndpointsServer struct { NewListResourceUsagePager func(resourceGroupName string, profileName string, endpointName string, options *armcdn.EndpointsClientListResourceUsageOptions) (resp azfake.PagerResponder[armcdn.EndpointsClientListResourceUsageResponse]) // BeginLoadContent is the fake for method EndpointsClient.BeginLoadContent - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginLoadContent func(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths armcdn.LoadParameters, options *armcdn.EndpointsClientBeginLoadContentOptions) (resp azfake.PollerResponder[armcdn.EndpointsClientLoadContentResponse], errResp azfake.ErrorResponder) // BeginPurgeContent is the fake for method EndpointsClient.BeginPurgeContent - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginPurgeContent func(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths armcdn.PurgeParameters, options *armcdn.EndpointsClientBeginPurgeContentOptions) (resp azfake.PollerResponder[armcdn.EndpointsClientPurgeContentResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method EndpointsClient.BeginStart @@ -110,41 +107,60 @@ func (e *EndpointsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "EndpointsClient.BeginCreate": - resp, err = e.dispatchBeginCreate(req) - case "EndpointsClient.BeginDelete": - resp, err = e.dispatchBeginDelete(req) - case "EndpointsClient.Get": - resp, err = e.dispatchGet(req) - case "EndpointsClient.NewListByProfilePager": - resp, err = e.dispatchNewListByProfilePager(req) - case "EndpointsClient.NewListResourceUsagePager": - resp, err = e.dispatchNewListResourceUsagePager(req) - case "EndpointsClient.BeginLoadContent": - resp, err = e.dispatchBeginLoadContent(req) - case "EndpointsClient.BeginPurgeContent": - resp, err = e.dispatchBeginPurgeContent(req) - case "EndpointsClient.BeginStart": - resp, err = e.dispatchBeginStart(req) - case "EndpointsClient.BeginStop": - resp, err = e.dispatchBeginStop(req) - case "EndpointsClient.BeginUpdate": - resp, err = e.dispatchBeginUpdate(req) - case "EndpointsClient.ValidateCustomDomain": - resp, err = e.dispatchValidateCustomDomain(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return e.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (e *EndpointsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if endpointsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = endpointsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "EndpointsClient.BeginCreate": + res.resp, res.err = e.dispatchBeginCreate(req) + case "EndpointsClient.BeginDelete": + res.resp, res.err = e.dispatchBeginDelete(req) + case "EndpointsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "EndpointsClient.NewListByProfilePager": + res.resp, res.err = e.dispatchNewListByProfilePager(req) + case "EndpointsClient.NewListResourceUsagePager": + res.resp, res.err = e.dispatchNewListResourceUsagePager(req) + case "EndpointsClient.BeginLoadContent": + res.resp, res.err = e.dispatchBeginLoadContent(req) + case "EndpointsClient.BeginPurgeContent": + res.resp, res.err = e.dispatchBeginPurgeContent(req) + case "EndpointsClient.BeginStart": + res.resp, res.err = e.dispatchBeginStart(req) + case "EndpointsClient.BeginStop": + res.resp, res.err = e.dispatchBeginStop(req) + case "EndpointsClient.BeginUpdate": + res.resp, res.err = e.dispatchBeginUpdate(req) + case "EndpointsClient.ValidateCustomDomain": + res.resp, res.err = e.dispatchValidateCustomDomain(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (e *EndpointsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -411,9 +427,9 @@ func (e *EndpointsServerTransport) dispatchBeginLoadContent(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginLoadContent.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginLoadContent) { e.beginLoadContent.remove(req) @@ -463,9 +479,9 @@ func (e *EndpointsServerTransport) dispatchBeginPurgeContent(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { e.beginPurgeContent.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginPurgeContent) { e.beginPurgeContent.remove(req) @@ -662,3 +678,9 @@ func (e *EndpointsServerTransport) dispatchValidateCustomDomain(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to EndpointsServerTransport +var endpointsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/internal.go b/sdk/resourcemanager/cdn/armcdn/fake/internal.go index 51c60fb49a12..fecd3b1294ea 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/internal.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/internal.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,6 +12,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/cdn/armcdn/fake/loganalytics_server.go b/sdk/resourcemanager/cdn/armcdn/fake/loganalytics_server.go index 9348004032ae..0cb48c8102e6 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/loganalytics_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/loganalytics_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -71,31 +68,50 @@ func (l *LogAnalyticsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LogAnalyticsClient.GetLogAnalyticsLocations": - resp, err = l.dispatchGetLogAnalyticsLocations(req) - case "LogAnalyticsClient.GetLogAnalyticsMetrics": - resp, err = l.dispatchGetLogAnalyticsMetrics(req) - case "LogAnalyticsClient.GetLogAnalyticsRankings": - resp, err = l.dispatchGetLogAnalyticsRankings(req) - case "LogAnalyticsClient.GetLogAnalyticsResources": - resp, err = l.dispatchGetLogAnalyticsResources(req) - case "LogAnalyticsClient.GetWafLogAnalyticsMetrics": - resp, err = l.dispatchGetWafLogAnalyticsMetrics(req) - case "LogAnalyticsClient.GetWafLogAnalyticsRankings": - resp, err = l.dispatchGetWafLogAnalyticsRankings(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LogAnalyticsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if logAnalyticsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = logAnalyticsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LogAnalyticsClient.GetLogAnalyticsLocations": + res.resp, res.err = l.dispatchGetLogAnalyticsLocations(req) + case "LogAnalyticsClient.GetLogAnalyticsMetrics": + res.resp, res.err = l.dispatchGetLogAnalyticsMetrics(req) + case "LogAnalyticsClient.GetLogAnalyticsRankings": + res.resp, res.err = l.dispatchGetLogAnalyticsRankings(req) + case "LogAnalyticsClient.GetLogAnalyticsResources": + res.resp, res.err = l.dispatchGetLogAnalyticsResources(req) + case "LogAnalyticsClient.GetWafLogAnalyticsMetrics": + res.resp, res.err = l.dispatchGetWafLogAnalyticsMetrics(req) + case "LogAnalyticsClient.GetWafLogAnalyticsRankings": + res.resp, res.err = l.dispatchGetWafLogAnalyticsRankings(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LogAnalyticsServerTransport) dispatchGetLogAnalyticsLocations(req *http.Request) (*http.Response, error) { @@ -641,3 +657,9 @@ func (l *LogAnalyticsServerTransport) dispatchGetWafLogAnalyticsRankings(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to LogAnalyticsServerTransport +var logAnalyticsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/managedrulesets_server.go b/sdk/resourcemanager/cdn/armcdn/fake/managedrulesets_server.go index 8c589742a302..6a75bd46425c 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/managedrulesets_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/managedrulesets_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "regexp" ) @@ -52,21 +49,40 @@ func (m *ManagedRuleSetsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagedRuleSetsClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagedRuleSetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managedRuleSetsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedRuleSetsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedRuleSetsClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedRuleSetsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -101,3 +117,9 @@ func (m *ManagedRuleSetsServerTransport) dispatchNewListPager(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedRuleSetsServerTransport +var managedRuleSetsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/management_server.go b/sdk/resourcemanager/cdn/armcdn/fake/management_server.go index d57afe006f70..0ab59492c6f1 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/management_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/management_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -61,27 +58,46 @@ func (m *ManagementServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ManagementClient.CheckEndpointNameAvailability": - resp, err = m.dispatchCheckEndpointNameAvailability(req) - case "ManagementClient.CheckNameAvailability": - resp, err = m.dispatchCheckNameAvailability(req) - case "ManagementClient.CheckNameAvailabilityWithSubscription": - resp, err = m.dispatchCheckNameAvailabilityWithSubscription(req) - case "ManagementClient.ValidateProbe": - resp, err = m.dispatchValidateProbe(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return m.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (m *ManagementServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if managementServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managementServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagementClient.CheckEndpointNameAvailability": + res.resp, res.err = m.dispatchCheckEndpointNameAvailability(req) + case "ManagementClient.CheckNameAvailability": + res.resp, res.err = m.dispatchCheckNameAvailability(req) + case "ManagementClient.CheckNameAvailabilityWithSubscription": + res.resp, res.err = m.dispatchCheckNameAvailabilityWithSubscription(req) + case "ManagementClient.ValidateProbe": + res.resp, res.err = m.dispatchValidateProbe(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (m *ManagementServerTransport) dispatchCheckEndpointNameAvailability(req *http.Request) (*http.Response, error) { @@ -197,3 +213,9 @@ func (m *ManagementServerTransport) dispatchValidateProbe(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagementServerTransport +var managementServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/operations_server.go b/sdk/resourcemanager/cdn/armcdn/fake/operations_server.go index f4de089ed641..67cfc25fe1a2 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/operations_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/operations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" ) @@ -51,21 +48,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/origingroups_server.go b/sdk/resourcemanager/cdn/armcdn/fake/origingroups_server.go index ac27d5136716..8263273a5860 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/origingroups_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/origingroups_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -76,29 +73,48 @@ func (o *OriginGroupsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OriginGroupsClient.BeginCreate": - resp, err = o.dispatchBeginCreate(req) - case "OriginGroupsClient.BeginDelete": - resp, err = o.dispatchBeginDelete(req) - case "OriginGroupsClient.Get": - resp, err = o.dispatchGet(req) - case "OriginGroupsClient.NewListByEndpointPager": - resp, err = o.dispatchNewListByEndpointPager(req) - case "OriginGroupsClient.BeginUpdate": - resp, err = o.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OriginGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if originGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = originGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OriginGroupsClient.BeginCreate": + res.resp, res.err = o.dispatchBeginCreate(req) + case "OriginGroupsClient.BeginDelete": + res.resp, res.err = o.dispatchBeginDelete(req) + case "OriginGroupsClient.Get": + res.resp, res.err = o.dispatchGet(req) + case "OriginGroupsClient.NewListByEndpointPager": + res.resp, res.err = o.dispatchNewListByEndpointPager(req) + case "OriginGroupsClient.BeginUpdate": + res.resp, res.err = o.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OriginGroupsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (o *OriginGroupsServerTransport) dispatchBeginUpdate(req *http.Request) (*h return resp, nil } + +// set this to conditionally intercept incoming requests to OriginGroupsServerTransport +var originGroupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/origins_server.go b/sdk/resourcemanager/cdn/armcdn/fake/origins_server.go index 57b03b604561..bf3bf9f792cc 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/origins_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/origins_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -76,29 +73,48 @@ func (o *OriginsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OriginsClient.BeginCreate": - resp, err = o.dispatchBeginCreate(req) - case "OriginsClient.BeginDelete": - resp, err = o.dispatchBeginDelete(req) - case "OriginsClient.Get": - resp, err = o.dispatchGet(req) - case "OriginsClient.NewListByEndpointPager": - resp, err = o.dispatchNewListByEndpointPager(req) - case "OriginsClient.BeginUpdate": - resp, err = o.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OriginsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if originsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = originsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OriginsClient.BeginCreate": + res.resp, res.err = o.dispatchBeginCreate(req) + case "OriginsClient.BeginDelete": + res.resp, res.err = o.dispatchBeginDelete(req) + case "OriginsClient.Get": + res.resp, res.err = o.dispatchGet(req) + case "OriginsClient.NewListByEndpointPager": + res.resp, res.err = o.dispatchNewListByEndpointPager(req) + case "OriginsClient.BeginUpdate": + res.resp, res.err = o.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OriginsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (o *OriginsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.R return resp, nil } + +// set this to conditionally intercept incoming requests to OriginsServerTransport +var originsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/policies_server.go b/sdk/resourcemanager/cdn/armcdn/fake/policies_server.go index 167722882268..9ea9fed6312d 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/policies_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/policies_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -74,29 +71,48 @@ func (p *PoliciesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PoliciesClient.BeginCreateOrUpdate": - resp, err = p.dispatchBeginCreateOrUpdate(req) - case "PoliciesClient.Delete": - resp, err = p.dispatchDelete(req) - case "PoliciesClient.Get": - resp, err = p.dispatchGet(req) - case "PoliciesClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - case "PoliciesClient.BeginUpdate": - resp, err = p.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if policiesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = policiesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PoliciesClient.BeginCreateOrUpdate": + res.resp, res.err = p.dispatchBeginCreateOrUpdate(req) + case "PoliciesClient.Delete": + res.resp, res.err = p.dispatchDelete(req) + case "PoliciesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PoliciesClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + case "PoliciesClient.BeginUpdate": + res.resp, res.err = p.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PoliciesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -297,3 +313,9 @@ func (p *PoliciesServerTransport) dispatchBeginUpdate(req *http.Request) (*http. return resp, nil } + +// set this to conditionally intercept incoming requests to PoliciesServerTransport +var policiesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/polymorphic_helpers.go b/sdk/resourcemanager/cdn/armcdn/fake/polymorphic_helpers.go index 61a3ae012697..3868c8f1187b 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/polymorphic_helpers.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,7 +7,7 @@ package fake import ( "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" ) func unmarshalCustomDomainHTTPSParametersClassification(rawMsg json.RawMessage) (armcdn.CustomDomainHTTPSParametersClassification, error) { diff --git a/sdk/resourcemanager/cdn/armcdn/fake/profiles_server.go b/sdk/resourcemanager/cdn/armcdn/fake/profiles_server.go index 7a160e4d6972..c8cdcb541b49 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/profiles_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/profiles_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -28,6 +25,14 @@ type ProfilesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginCanMigrate func(ctx context.Context, resourceGroupName string, canMigrateParameters armcdn.CanMigrateParameters, options *armcdn.ProfilesClientBeginCanMigrateOptions) (resp azfake.PollerResponder[armcdn.ProfilesClientCanMigrateResponse], errResp azfake.ErrorResponder) + // BeginCdnCanMigrateToAfd is the fake for method ProfilesClient.BeginCdnCanMigrateToAfd + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCdnCanMigrateToAfd func(ctx context.Context, resourceGroupName string, profileName string, options *armcdn.ProfilesClientBeginCdnCanMigrateToAfdOptions) (resp azfake.PollerResponder[armcdn.ProfilesClientCdnCanMigrateToAfdResponse], errResp azfake.ErrorResponder) + + // BeginCdnMigrateToAfd is the fake for method ProfilesClient.BeginCdnMigrateToAfd + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCdnMigrateToAfd func(ctx context.Context, resourceGroupName string, profileName string, migrationParameters armcdn.MigrationToAfdParameters, options *armcdn.ProfilesClientBeginCdnMigrateToAfdOptions) (resp azfake.PollerResponder[armcdn.ProfilesClientCdnMigrateToAfdResponse], errResp azfake.ErrorResponder) + // BeginCreate is the fake for method ProfilesClient.BeginCreate // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted BeginCreate func(ctx context.Context, resourceGroupName string, profileName string, profile armcdn.Profile, options *armcdn.ProfilesClientBeginCreateOptions) (resp azfake.PollerResponder[armcdn.ProfilesClientCreateResponse], errResp azfake.ErrorResponder) @@ -64,8 +69,12 @@ type ProfilesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginMigrate func(ctx context.Context, resourceGroupName string, migrationParameters armcdn.MigrationParameters, options *armcdn.ProfilesClientBeginMigrateOptions) (resp azfake.PollerResponder[armcdn.ProfilesClientMigrateResponse], errResp azfake.ErrorResponder) + // BeginMigrationAbort is the fake for method ProfilesClient.BeginMigrationAbort + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginMigrationAbort func(ctx context.Context, resourceGroupName string, profileName string, options *armcdn.ProfilesClientBeginMigrationAbortOptions) (resp azfake.PollerResponder[armcdn.ProfilesClientMigrationAbortResponse], errResp azfake.ErrorResponder) + // BeginMigrationCommit is the fake for method ProfilesClient.BeginMigrationCommit - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginMigrationCommit func(ctx context.Context, resourceGroupName string, profileName string, options *armcdn.ProfilesClientBeginMigrationCommitOptions) (resp azfake.PollerResponder[armcdn.ProfilesClientMigrationCommitResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method ProfilesClient.BeginUpdate @@ -80,12 +89,15 @@ func NewProfilesServerTransport(srv *ProfilesServer) *ProfilesServerTransport { return &ProfilesServerTransport{ srv: srv, beginCanMigrate: newTracker[azfake.PollerResponder[armcdn.ProfilesClientCanMigrateResponse]](), + beginCdnCanMigrateToAfd: newTracker[azfake.PollerResponder[armcdn.ProfilesClientCdnCanMigrateToAfdResponse]](), + beginCdnMigrateToAfd: newTracker[azfake.PollerResponder[armcdn.ProfilesClientCdnMigrateToAfdResponse]](), beginCreate: newTracker[azfake.PollerResponder[armcdn.ProfilesClientCreateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armcdn.ProfilesClientDeleteResponse]](), newListPager: newTracker[azfake.PagerResponder[armcdn.ProfilesClientListResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcdn.ProfilesClientListByResourceGroupResponse]](), newListResourceUsagePager: newTracker[azfake.PagerResponder[armcdn.ProfilesClientListResourceUsageResponse]](), beginMigrate: newTracker[azfake.PollerResponder[armcdn.ProfilesClientMigrateResponse]](), + beginMigrationAbort: newTracker[azfake.PollerResponder[armcdn.ProfilesClientMigrationAbortResponse]](), beginMigrationCommit: newTracker[azfake.PollerResponder[armcdn.ProfilesClientMigrationCommitResponse]](), beginUpdate: newTracker[azfake.PollerResponder[armcdn.ProfilesClientUpdateResponse]](), } @@ -96,12 +108,15 @@ func NewProfilesServerTransport(srv *ProfilesServer) *ProfilesServerTransport { type ProfilesServerTransport struct { srv *ProfilesServer beginCanMigrate *tracker[azfake.PollerResponder[armcdn.ProfilesClientCanMigrateResponse]] + beginCdnCanMigrateToAfd *tracker[azfake.PollerResponder[armcdn.ProfilesClientCdnCanMigrateToAfdResponse]] + beginCdnMigrateToAfd *tracker[azfake.PollerResponder[armcdn.ProfilesClientCdnMigrateToAfdResponse]] beginCreate *tracker[azfake.PollerResponder[armcdn.ProfilesClientCreateResponse]] beginDelete *tracker[azfake.PollerResponder[armcdn.ProfilesClientDeleteResponse]] newListPager *tracker[azfake.PagerResponder[armcdn.ProfilesClientListResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armcdn.ProfilesClientListByResourceGroupResponse]] newListResourceUsagePager *tracker[azfake.PagerResponder[armcdn.ProfilesClientListResourceUsageResponse]] beginMigrate *tracker[azfake.PollerResponder[armcdn.ProfilesClientMigrateResponse]] + beginMigrationAbort *tracker[azfake.PollerResponder[armcdn.ProfilesClientMigrationAbortResponse]] beginMigrationCommit *tracker[azfake.PollerResponder[armcdn.ProfilesClientMigrationCommitResponse]] beginUpdate *tracker[azfake.PollerResponder[armcdn.ProfilesClientUpdateResponse]] } @@ -114,43 +129,68 @@ func (p *ProfilesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ProfilesClient.BeginCanMigrate": - resp, err = p.dispatchBeginCanMigrate(req) - case "ProfilesClient.BeginCreate": - resp, err = p.dispatchBeginCreate(req) - case "ProfilesClient.BeginDelete": - resp, err = p.dispatchBeginDelete(req) - case "ProfilesClient.GenerateSsoURI": - resp, err = p.dispatchGenerateSsoURI(req) - case "ProfilesClient.Get": - resp, err = p.dispatchGet(req) - case "ProfilesClient.NewListPager": - resp, err = p.dispatchNewListPager(req) - case "ProfilesClient.NewListByResourceGroupPager": - resp, err = p.dispatchNewListByResourceGroupPager(req) - case "ProfilesClient.NewListResourceUsagePager": - resp, err = p.dispatchNewListResourceUsagePager(req) - case "ProfilesClient.ListSupportedOptimizationTypes": - resp, err = p.dispatchListSupportedOptimizationTypes(req) - case "ProfilesClient.BeginMigrate": - resp, err = p.dispatchBeginMigrate(req) - case "ProfilesClient.BeginMigrationCommit": - resp, err = p.dispatchBeginMigrationCommit(req) - case "ProfilesClient.BeginUpdate": - resp, err = p.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return p.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (p *ProfilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if profilesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = profilesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ProfilesClient.BeginCanMigrate": + res.resp, res.err = p.dispatchBeginCanMigrate(req) + case "ProfilesClient.BeginCdnCanMigrateToAfd": + res.resp, res.err = p.dispatchBeginCdnCanMigrateToAfd(req) + case "ProfilesClient.BeginCdnMigrateToAfd": + res.resp, res.err = p.dispatchBeginCdnMigrateToAfd(req) + case "ProfilesClient.BeginCreate": + res.resp, res.err = p.dispatchBeginCreate(req) + case "ProfilesClient.BeginDelete": + res.resp, res.err = p.dispatchBeginDelete(req) + case "ProfilesClient.GenerateSsoURI": + res.resp, res.err = p.dispatchGenerateSsoURI(req) + case "ProfilesClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "ProfilesClient.NewListPager": + res.resp, res.err = p.dispatchNewListPager(req) + case "ProfilesClient.NewListByResourceGroupPager": + res.resp, res.err = p.dispatchNewListByResourceGroupPager(req) + case "ProfilesClient.NewListResourceUsagePager": + res.resp, res.err = p.dispatchNewListResourceUsagePager(req) + case "ProfilesClient.ListSupportedOptimizationTypes": + res.resp, res.err = p.dispatchListSupportedOptimizationTypes(req) + case "ProfilesClient.BeginMigrate": + res.resp, res.err = p.dispatchBeginMigrate(req) + case "ProfilesClient.BeginMigrationAbort": + res.resp, res.err = p.dispatchBeginMigrationAbort(req) + case "ProfilesClient.BeginMigrationCommit": + res.resp, res.err = p.dispatchBeginMigrationCommit(req) + case "ProfilesClient.BeginUpdate": + res.resp, res.err = p.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (p *ProfilesServerTransport) dispatchBeginCanMigrate(req *http.Request) (*http.Response, error) { @@ -197,6 +237,98 @@ func (p *ProfilesServerTransport) dispatchBeginCanMigrate(req *http.Request) (*h return resp, nil } +func (p *ProfilesServerTransport) dispatchBeginCdnCanMigrateToAfd(req *http.Request) (*http.Response, error) { + if p.srv.BeginCdnCanMigrateToAfd == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCdnCanMigrateToAfd not implemented")} + } + beginCdnCanMigrateToAfd := p.beginCdnCanMigrateToAfd.get(req) + if beginCdnCanMigrateToAfd == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cdn/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cdnCanMigrateToAfd` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginCdnCanMigrateToAfd(req.Context(), resourceGroupNameParam, profileNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCdnCanMigrateToAfd = &respr + p.beginCdnCanMigrateToAfd.add(req, beginCdnCanMigrateToAfd) + } + + resp, err := server.PollerResponderNext(beginCdnCanMigrateToAfd, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + p.beginCdnCanMigrateToAfd.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCdnCanMigrateToAfd) { + p.beginCdnCanMigrateToAfd.remove(req) + } + + return resp, nil +} + +func (p *ProfilesServerTransport) dispatchBeginCdnMigrateToAfd(req *http.Request) (*http.Response, error) { + if p.srv.BeginCdnMigrateToAfd == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCdnMigrateToAfd not implemented")} + } + beginCdnMigrateToAfd := p.beginCdnMigrateToAfd.get(req) + if beginCdnMigrateToAfd == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cdn/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cdnMigrateToAfd` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcdn.MigrationToAfdParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginCdnMigrateToAfd(req.Context(), resourceGroupNameParam, profileNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCdnMigrateToAfd = &respr + p.beginCdnMigrateToAfd.add(req, beginCdnMigrateToAfd) + } + + resp, err := server.PollerResponderNext(beginCdnMigrateToAfd, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + p.beginCdnMigrateToAfd.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCdnMigrateToAfd) { + p.beginCdnMigrateToAfd.remove(req) + } + + return resp, nil +} + func (p *ProfilesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { if p.srv.BeginCreate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} @@ -543,6 +675,50 @@ func (p *ProfilesServerTransport) dispatchBeginMigrate(req *http.Request) (*http return resp, nil } +func (p *ProfilesServerTransport) dispatchBeginMigrationAbort(req *http.Request) (*http.Response, error) { + if p.srv.BeginMigrationAbort == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginMigrationAbort not implemented")} + } + beginMigrationAbort := p.beginMigrationAbort.get(req) + if beginMigrationAbort == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cdn/profiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrationAbort` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + profileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("profileName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginMigrationAbort(req.Context(), resourceGroupNameParam, profileNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginMigrationAbort = &respr + p.beginMigrationAbort.add(req, beginMigrationAbort) + } + + resp, err := server.PollerResponderNext(beginMigrationAbort, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + p.beginMigrationAbort.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginMigrationAbort) { + p.beginMigrationAbort.remove(req) + } + + return resp, nil +} + func (p *ProfilesServerTransport) dispatchBeginMigrationCommit(req *http.Request) (*http.Response, error) { if p.srv.BeginMigrationCommit == nil { return nil, &nonRetriableError{errors.New("fake for method BeginMigrationCommit not implemented")} @@ -576,9 +752,9 @@ func (p *ProfilesServerTransport) dispatchBeginMigrationCommit(req *http.Request return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { p.beginMigrationCommit.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginMigrationCommit) { p.beginMigrationCommit.remove(req) @@ -634,3 +810,9 @@ func (p *ProfilesServerTransport) dispatchBeginUpdate(req *http.Request) (*http. return resp, nil } + +// set this to conditionally intercept incoming requests to ProfilesServerTransport +var profilesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/resourceusage_server.go b/sdk/resourcemanager/cdn/armcdn/fake/resourceusage_server.go index dce9e421eb98..38f5530d39dc 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/resourceusage_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/resourceusage_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "regexp" ) @@ -52,21 +49,40 @@ func (r *ResourceUsageServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "ResourceUsageClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *ResourceUsageServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if resourceUsageServerTransportInterceptor != nil { + res.resp, res.err, intercepted = resourceUsageServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ResourceUsageClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *ResourceUsageServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -101,3 +117,9 @@ func (r *ResourceUsageServerTransport) dispatchNewListPager(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to ResourceUsageServerTransport +var resourceUsageServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/routes_server.go b/sdk/resourcemanager/cdn/armcdn/fake/routes_server.go index 443f17c01649..1d185b02e1ea 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/routes_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/routes_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -76,29 +73,48 @@ func (r *RoutesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RoutesClient.BeginCreate": - resp, err = r.dispatchBeginCreate(req) - case "RoutesClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RoutesClient.Get": - resp, err = r.dispatchGet(req) - case "RoutesClient.NewListByEndpointPager": - resp, err = r.dispatchNewListByEndpointPager(req) - case "RoutesClient.BeginUpdate": - resp, err = r.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RoutesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if routesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = routesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RoutesClient.BeginCreate": + res.resp, res.err = r.dispatchBeginCreate(req) + case "RoutesClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RoutesClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RoutesClient.NewListByEndpointPager": + res.resp, res.err = r.dispatchNewListByEndpointPager(req) + case "RoutesClient.BeginUpdate": + res.resp, res.err = r.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RoutesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (r *RoutesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re return resp, nil } + +// set this to conditionally intercept incoming requests to RoutesServerTransport +var routesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/rules_server.go b/sdk/resourcemanager/cdn/armcdn/fake/rules_server.go index 7f14d5f6d60c..3f25b23da381 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/rules_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/rules_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -76,29 +73,48 @@ func (r *RulesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RulesClient.BeginCreate": - resp, err = r.dispatchBeginCreate(req) - case "RulesClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RulesClient.Get": - resp, err = r.dispatchGet(req) - case "RulesClient.NewListByRuleSetPager": - resp, err = r.dispatchNewListByRuleSetPager(req) - case "RulesClient.BeginUpdate": - resp, err = r.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if rulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = rulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RulesClient.BeginCreate": + res.resp, res.err = r.dispatchBeginCreate(req) + case "RulesClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RulesClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RulesClient.NewListByRuleSetPager": + res.resp, res.err = r.dispatchNewListByRuleSetPager(req) + case "RulesClient.BeginUpdate": + res.resp, res.err = r.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RulesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -350,3 +366,9 @@ func (r *RulesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Res return resp, nil } + +// set this to conditionally intercept incoming requests to RulesServerTransport +var rulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/rulesets_server.go b/sdk/resourcemanager/cdn/armcdn/fake/rulesets_server.go index bd7bcaa7a6d5..48aa68bac6c3 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/rulesets_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/rulesets_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -74,29 +71,48 @@ func (r *RuleSetsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RuleSetsClient.Create": - resp, err = r.dispatchCreate(req) - case "RuleSetsClient.BeginDelete": - resp, err = r.dispatchBeginDelete(req) - case "RuleSetsClient.Get": - resp, err = r.dispatchGet(req) - case "RuleSetsClient.NewListByProfilePager": - resp, err = r.dispatchNewListByProfilePager(req) - case "RuleSetsClient.NewListResourceUsagePager": - resp, err = r.dispatchNewListResourceUsagePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RuleSetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if ruleSetsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = ruleSetsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RuleSetsClient.Create": + res.resp, res.err = r.dispatchCreate(req) + case "RuleSetsClient.BeginDelete": + res.resp, res.err = r.dispatchBeginDelete(req) + case "RuleSetsClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RuleSetsClient.NewListByProfilePager": + res.resp, res.err = r.dispatchNewListByProfilePager(req) + case "RuleSetsClient.NewListResourceUsagePager": + res.resp, res.err = r.dispatchNewListResourceUsagePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RuleSetsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -306,3 +322,9 @@ func (r *RuleSetsServerTransport) dispatchNewListResourceUsagePager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to RuleSetsServerTransport +var ruleSetsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/secrets_server.go b/sdk/resourcemanager/cdn/armcdn/fake/secrets_server.go index 56a948651d93..65b4536a99d1 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/secrets_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/secrets_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -70,27 +67,46 @@ func (s *SecretsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecretsClient.BeginCreate": - resp, err = s.dispatchBeginCreate(req) - case "SecretsClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SecretsClient.Get": - resp, err = s.dispatchGet(req) - case "SecretsClient.NewListByProfilePager": - resp, err = s.dispatchNewListByProfilePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecretsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if secretsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = secretsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecretsClient.BeginCreate": + res.resp, res.err = s.dispatchBeginCreate(req) + case "SecretsClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecretsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecretsClient.NewListByProfilePager": + res.resp, res.err = s.dispatchNewListByProfilePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecretsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -270,3 +286,9 @@ func (s *SecretsServerTransport) dispatchNewListByProfilePager(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to SecretsServerTransport +var secretsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/securitypolicies_server.go b/sdk/resourcemanager/cdn/armcdn/fake/securitypolicies_server.go index d4ce8961895d..6242d0a78a59 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/securitypolicies_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/securitypolicies_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3" "net/http" "net/url" "regexp" @@ -76,29 +73,48 @@ func (s *SecurityPoliciesServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecurityPoliciesClient.BeginCreate": - resp, err = s.dispatchBeginCreate(req) - case "SecurityPoliciesClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SecurityPoliciesClient.Get": - resp, err = s.dispatchGet(req) - case "SecurityPoliciesClient.NewListByProfilePager": - resp, err = s.dispatchNewListByProfilePager(req) - case "SecurityPoliciesClient.BeginPatch": - resp, err = s.dispatchBeginPatch(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecurityPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if securityPoliciesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = securityPoliciesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecurityPoliciesClient.BeginCreate": + res.resp, res.err = s.dispatchBeginCreate(req) + case "SecurityPoliciesClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SecurityPoliciesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecurityPoliciesClient.NewListByProfilePager": + res.resp, res.err = s.dispatchNewListByProfilePager(req) + case "SecurityPoliciesClient.BeginPatch": + res.resp, res.err = s.dispatchBeginPatch(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecurityPoliciesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -330,3 +346,9 @@ func (s *SecurityPoliciesServerTransport) dispatchBeginPatch(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to SecurityPoliciesServerTransport +var securityPoliciesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/server_factory.go b/sdk/resourcemanager/cdn/armcdn/fake/server_factory.go index f73773114d59..13d3da153294 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/server_factory.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/server_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -19,27 +16,70 @@ import ( // ServerFactory is a fake server for instances of the armcdn.ClientFactory type. type ServerFactory struct { + // AFDCustomDomainsServer contains the fakes for client AFDCustomDomainsClient AFDCustomDomainsServer AFDCustomDomainsServer - AFDEndpointsServer AFDEndpointsServer - AFDOriginGroupsServer AFDOriginGroupsServer - AFDOriginsServer AFDOriginsServer - AFDProfilesServer AFDProfilesServer - CustomDomainsServer CustomDomainsServer - EdgeNodesServer EdgeNodesServer - EndpointsServer EndpointsServer - LogAnalyticsServer LogAnalyticsServer - ManagedRuleSetsServer ManagedRuleSetsServer - ManagementServer ManagementServer - OperationsServer OperationsServer - OriginGroupsServer OriginGroupsServer - OriginsServer OriginsServer - PoliciesServer PoliciesServer - ProfilesServer ProfilesServer - ResourceUsageServer ResourceUsageServer - RoutesServer RoutesServer - RuleSetsServer RuleSetsServer - RulesServer RulesServer - SecretsServer SecretsServer + + // AFDEndpointsServer contains the fakes for client AFDEndpointsClient + AFDEndpointsServer AFDEndpointsServer + + // AFDOriginGroupsServer contains the fakes for client AFDOriginGroupsClient + AFDOriginGroupsServer AFDOriginGroupsServer + + // AFDOriginsServer contains the fakes for client AFDOriginsClient + AFDOriginsServer AFDOriginsServer + + // AFDProfilesServer contains the fakes for client AFDProfilesClient + AFDProfilesServer AFDProfilesServer + + // CustomDomainsServer contains the fakes for client CustomDomainsClient + CustomDomainsServer CustomDomainsServer + + // EdgeNodesServer contains the fakes for client EdgeNodesClient + EdgeNodesServer EdgeNodesServer + + // EndpointsServer contains the fakes for client EndpointsClient + EndpointsServer EndpointsServer + + // LogAnalyticsServer contains the fakes for client LogAnalyticsClient + LogAnalyticsServer LogAnalyticsServer + + // ManagedRuleSetsServer contains the fakes for client ManagedRuleSetsClient + ManagedRuleSetsServer ManagedRuleSetsServer + + // ManagementServer contains the fakes for client ManagementClient + ManagementServer ManagementServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // OriginGroupsServer contains the fakes for client OriginGroupsClient + OriginGroupsServer OriginGroupsServer + + // OriginsServer contains the fakes for client OriginsClient + OriginsServer OriginsServer + + // PoliciesServer contains the fakes for client PoliciesClient + PoliciesServer PoliciesServer + + // ProfilesServer contains the fakes for client ProfilesClient + ProfilesServer ProfilesServer + + // ResourceUsageServer contains the fakes for client ResourceUsageClient + ResourceUsageServer ResourceUsageServer + + // RoutesServer contains the fakes for client RoutesClient + RoutesServer RoutesServer + + // RuleSetsServer contains the fakes for client RuleSetsClient + RuleSetsServer RuleSetsServer + + // RulesServer contains the fakes for client RulesClient + RulesServer RulesServer + + // SecretsServer contains the fakes for client SecretsClient + SecretsServer SecretsServer + + // SecurityPoliciesServer contains the fakes for client SecurityPoliciesClient SecurityPoliciesServer SecurityPoliciesServer } diff --git a/sdk/resourcemanager/cdn/armcdn/fake/time_rfc3339.go b/sdk/resourcemanager/cdn/armcdn/fake/time_rfc3339.go deleted file mode 100644 index 81f308b0d343..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/cdn/armcdn/go.mod b/sdk/resourcemanager/cdn/armcdn/go.mod index 83fad7b61b12..d9c051387850 100644 --- a/sdk/resourcemanager/cdn/armcdn/go.mod +++ b/sdk/resourcemanager/cdn/armcdn/go.mod @@ -1,16 +1,16 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v3 go 1.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/stretchr/testify v1.10.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/cdn/armcdn/interfaces.go b/sdk/resourcemanager/cdn/armcdn/interfaces.go index 1c88786ca14a..22071ebf2a8d 100644 --- a/sdk/resourcemanager/cdn/armcdn/interfaces.go +++ b/sdk/resourcemanager/cdn/armcdn/interfaces.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -8,6 +5,15 @@ package armcdn +// CertificateSourceParametersBaseClassification provides polymorphic access to related types. +// Call the interface's GetCertificateSourceParametersBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CertificateSourceParameters, *CertificateSourceParametersBase, *KeyVaultCertificateSourceParameters +type CertificateSourceParametersBaseClassification interface { + // GetCertificateSourceParametersBase returns the CertificateSourceParametersBase content of the underlying type. + GetCertificateSourceParametersBase() *CertificateSourceParametersBase +} + // CustomDomainHTTPSParametersClassification provides polymorphic access to related types. // Call the interface's GetCustomDomainHTTPSParameters() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -17,15 +23,26 @@ type CustomDomainHTTPSParametersClassification interface { GetCustomDomainHTTPSParameters() *CustomDomainHTTPSParameters } -// DeliveryRuleActionAutoGeneratedClassification provides polymorphic access to related types. -// Call the interface's GetDeliveryRuleActionAutoGenerated() method to access the common type. +// DeliveryRuleActionClassification provides polymorphic access to related types. +// Call the interface's GetDeliveryRuleAction() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *DeliveryRuleActionAutoGenerated, *DeliveryRuleCacheExpirationAction, *DeliveryRuleCacheKeyQueryStringAction, *DeliveryRuleRequestHeaderAction, +// - *DeliveryRuleAction, *DeliveryRuleCacheExpirationAction, *DeliveryRuleCacheKeyQueryStringAction, *DeliveryRuleRequestHeaderAction, // - *DeliveryRuleResponseHeaderAction, *DeliveryRuleRouteConfigurationOverrideAction, *OriginGroupOverrideAction, *URLRedirectAction, // - *URLRewriteAction, *URLSigningAction -type DeliveryRuleActionAutoGeneratedClassification interface { - // GetDeliveryRuleActionAutoGenerated returns the DeliveryRuleActionAutoGenerated content of the underlying type. - GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated +type DeliveryRuleActionClassification interface { + // GetDeliveryRuleAction returns the DeliveryRuleAction content of the underlying type. + GetDeliveryRuleAction() *DeliveryRuleAction +} + +// DeliveryRuleActionParametersClassification provides polymorphic access to related types. +// Call the interface's GetDeliveryRuleActionParameters() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CacheExpirationActionParameters, *CacheKeyQueryStringActionParameters, *DeliveryRuleActionParameters, *HeaderActionParameters, +// - *OriginGroupOverrideActionParameters, *RouteConfigurationOverrideActionParameters, *URLRedirectActionParameters, *URLRewriteActionParameters, +// - *URLSigningActionParameters +type DeliveryRuleActionParametersClassification interface { + // GetDeliveryRuleActionParameters returns the DeliveryRuleActionParameters content of the underlying type. + GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters } // DeliveryRuleConditionClassification provides polymorphic access to related types. @@ -41,6 +58,20 @@ type DeliveryRuleConditionClassification interface { GetDeliveryRuleCondition() *DeliveryRuleCondition } +// DeliveryRuleConditionParametersClassification provides polymorphic access to related types. +// Call the interface's GetDeliveryRuleConditionParameters() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ClientPortMatchConditionParameters, *CookiesMatchConditionParameters, *DeliveryRuleConditionParameters, *HTTPVersionMatchConditionParameters, +// - *HostNameMatchConditionParameters, *IsDeviceMatchConditionParameters, *PostArgsMatchConditionParameters, *QueryStringMatchConditionParameters, +// - *RemoteAddressMatchConditionParameters, *RequestBodyMatchConditionParameters, *RequestHeaderMatchConditionParameters, +// - *RequestMethodMatchConditionParameters, *RequestSchemeMatchConditionParameters, *RequestURIMatchConditionParameters, +// - *SSLProtocolMatchConditionParameters, *ServerPortMatchConditionParameters, *SocketAddrMatchConditionParameters, *URLFileExtensionMatchConditionParameters, +// - *URLFileNameMatchConditionParameters, *URLPathMatchConditionParameters +type DeliveryRuleConditionParametersClassification interface { + // GetDeliveryRuleConditionParameters returns the DeliveryRuleConditionParameters content of the underlying type. + GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters +} + // SecretParametersClassification provides polymorphic access to related types. // Call the interface's GetSecretParameters() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: diff --git a/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go b/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go index 844152ffe313..b94b7117e001 100644 --- a/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go +++ b/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ func NewLogAnalyticsClient(subscriptionID string, credential azcore.TokenCredent // GetLogAnalyticsLocations - Get all available location names for AFD log analytics report. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -77,7 +74,7 @@ func (client *LogAnalyticsClient) GetLogAnalyticsLocations(ctx context.Context, } // getLogAnalyticsLocationsCreateRequest creates the GetLogAnalyticsLocations request. -func (client *LogAnalyticsClient) getLogAnalyticsLocationsCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *LogAnalyticsClientGetLogAnalyticsLocationsOptions) (*policy.Request, error) { +func (client *LogAnalyticsClient) getLogAnalyticsLocationsCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *LogAnalyticsClientGetLogAnalyticsLocationsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsLocations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -96,7 +93,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsLocationsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +111,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsLocationsHandleResponse(resp *h // GetLogAnalyticsMetrics - Get log report for AFD profile // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -162,7 +159,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsMetricsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") if options != nil && options.Continents != nil { for _, qv := range options.Continents { reqQP.Add("continents", qv) @@ -207,7 +204,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsMetricsHandleResponse(resp *htt // GetLogAnalyticsRankings - Get log analytics ranking report for AFD profile // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -255,7 +252,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsRankingsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") if options != nil && options.CustomDomains != nil { for _, qv := range options.CustomDomains { reqQP.Add("customDomains", qv) @@ -287,7 +284,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsRankingsHandleResponse(resp *ht // GetLogAnalyticsResources - Get all endpoints and custom domains available for AFD log report // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -316,7 +313,7 @@ func (client *LogAnalyticsClient) GetLogAnalyticsResources(ctx context.Context, } // getLogAnalyticsResourcesCreateRequest creates the GetLogAnalyticsResources request. -func (client *LogAnalyticsClient) getLogAnalyticsResourcesCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *LogAnalyticsClientGetLogAnalyticsResourcesOptions) (*policy.Request, error) { +func (client *LogAnalyticsClient) getLogAnalyticsResourcesCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *LogAnalyticsClientGetLogAnalyticsResourcesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getLogAnalyticsResources" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -335,7 +332,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsResourcesCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,7 +350,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsResourcesHandleResponse(resp *h // GetWafLogAnalyticsMetrics - Get Waf related log analytics report for AFD profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -406,7 +403,7 @@ func (client *LogAnalyticsClient) getWafLogAnalyticsMetricsCreateRequest(ctx con reqQP.Add("actions", string(qv)) } } - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") reqQP.Set("dateTimeBegin", dateTimeBegin.Format(time.RFC3339Nano)) reqQP.Set("dateTimeEnd", dateTimeEnd.Format(time.RFC3339Nano)) reqQP.Set("granularity", string(granularity)) @@ -440,7 +437,7 @@ func (client *LogAnalyticsClient) getWafLogAnalyticsMetricsHandleResponse(resp * // GetWafLogAnalyticsRankings - Get WAF log analytics charts for AFD profile // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -493,7 +490,7 @@ func (client *LogAnalyticsClient) getWafLogAnalyticsRankingsCreateRequest(ctx co reqQP.Add("actions", string(qv)) } } - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") reqQP.Set("dateTimeBegin", dateTimeBegin.Format(time.RFC3339Nano)) reqQP.Set("dateTimeEnd", dateTimeEnd.Format(time.RFC3339Nano)) reqQP.Set("maxRanking", strconv.FormatInt(int64(maxRanking), 10)) diff --git a/sdk/resourcemanager/cdn/armcdn/loganalytics_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/loganalytics_client_example_test.go deleted file mode 100644 index 03a46605d2ef..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/loganalytics_client_example_test.go +++ /dev/null @@ -1,457 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/LogAnalytics_GetLogAnalyticsMetrics.json -func ExampleLogAnalyticsClient_GetLogAnalyticsMetrics() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLogAnalyticsClient().GetLogAnalyticsMetrics(ctx, "RG", "profile1", []armcdn.LogMetric{ - armcdn.LogMetricClientRequestCount}, func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:30:00.000Z"); return t }(), func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T05:00:00.000Z"); return t }(), armcdn.LogMetricsGranularityPT5M, []string{ - "customdomain1.azurecdn.net", - "customdomain2.azurecdn.net"}, []string{ - "https"}, &armcdn.LogAnalyticsClientGetLogAnalyticsMetricsOptions{GroupBy: []armcdn.LogMetricsGroupBy{ - armcdn.LogMetricsGroupByProtocol}, - Continents: []string{}, - CountryOrRegions: []string{}, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MetricsResponse = armcdn.MetricsResponse{ - // DateTimeBegin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:30:27.554Z"); return t}()), - // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T05:00:27.554Z"); return t}()), - // Granularity: to.Ptr(armcdn.MetricsGranularityPT5M), - // Series: []*armcdn.MetricsResponseSeriesItem{ - // { - // Data: []*armcdn.Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems{ - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:35:00.000Z"); return t}()), - // Value: to.Ptr[float32](4250), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:40:00.000Z"); return t}()), - // Value: to.Ptr[float32](3120), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:45:00.000Z"); return t}()), - // Value: to.Ptr[float32](2221), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:50:00.000Z"); return t}()), - // Value: to.Ptr[float32](2466), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:55:00.000Z"); return t}()), - // Value: to.Ptr[float32](2654), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T05:00:00.000Z"); return t}()), - // Value: to.Ptr[float32](3565), - // }}, - // Groups: []*armcdn.MetricsResponseSeriesPropertiesItemsItem{ - // { - // Name: to.Ptr("protocol"), - // Value: to.Ptr("https"), - // }}, - // Metric: to.Ptr("clientRequestCount"), - // Unit: to.Ptr(armcdn.MetricsSeriesUnitCount), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/LogAnalytics_GetLogAnalyticsRankings.json -func ExampleLogAnalyticsClient_GetLogAnalyticsRankings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLogAnalyticsClient().GetLogAnalyticsRankings(ctx, "RG", "profile1", []armcdn.LogRanking{ - armcdn.LogRankingURL}, []armcdn.LogRankingMetric{ - armcdn.LogRankingMetricClientRequestCount}, 5, func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T06:49:27.554Z"); return t }(), func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T09:49:27.554Z"); return t }(), &armcdn.LogAnalyticsClientGetLogAnalyticsRankingsOptions{CustomDomains: []string{}}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RankingsResponse = armcdn.RankingsResponse{ - // DateTimeBegin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T06:49:27.554Z"); return t}()), - // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T09:49:27.554Z"); return t}()), - // Tables: []*armcdn.RankingsResponseTablesItem{ - // { - // Data: []*armcdn.RankingsResponseTablesPropertiesItemsItem{ - // { - // Name: to.Ptr("https://testdomain.com/favicon.png"), - // Metrics: []*armcdn.RankingsResponseTablesPropertiesItemsMetricsItem{ - // { - // Metric: to.Ptr("clientRequestCount"), - // Percentage: to.Ptr[float32](8.28133862733976), - // Value: to.Ptr[int64](2336), - // }}, - // }, - // { - // Name: to.Ptr("https://testdomain.com/js/app.js"), - // Metrics: []*armcdn.RankingsResponseTablesPropertiesItemsMetricsItem{ - // { - // Metric: to.Ptr("clientRequestCount"), - // Percentage: to.Ptr[float32](7.586500283607488), - // Value: to.Ptr[int64](2140), - // }}, - // }, - // { - // Name: to.Ptr("https://testdomain.com/js/lang/en.js"), - // Metrics: []*armcdn.RankingsResponseTablesPropertiesItemsMetricsItem{ - // { - // Metric: to.Ptr("clientRequestCount"), - // Percentage: to.Ptr[float32](5.445263754963131), - // Value: to.Ptr[int64](1536), - // }}, - // }, - // { - // Name: to.Ptr("https://testdomain.com/js/lib.js"), - // Metrics: []*armcdn.RankingsResponseTablesPropertiesItemsMetricsItem{ - // { - // Metric: to.Ptr("clientRequestCount"), - // Percentage: to.Ptr[float32](5.246738513896767), - // Value: to.Ptr[int64](1480), - // }}, - // }, - // { - // Name: to.Ptr("https://cdn.exam.net/css/lib.css"), - // Metrics: []*armcdn.RankingsResponseTablesPropertiesItemsMetricsItem{ - // { - // Metric: to.Ptr("clientRequestCount"), - // Percentage: to.Ptr[float32](5.147475893363584), - // Value: to.Ptr[int64](1452), - // }}, - // }}, - // Ranking: to.Ptr("url"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/LogAnalytics_GetLogAnalyticsLocations.json -func ExampleLogAnalyticsClient_GetLogAnalyticsLocations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLogAnalyticsClient().GetLogAnalyticsLocations(ctx, "RG", "profile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ContinentsResponse = armcdn.ContinentsResponse{ - // Continents: []*armcdn.ContinentsResponseContinentsItem{ - // { - // ID: to.Ptr("africa"), - // }, - // { - // ID: to.Ptr("antarctica"), - // }, - // { - // ID: to.Ptr("asia"), - // }, - // { - // ID: to.Ptr("europe"), - // }, - // { - // ID: to.Ptr("northAmerica"), - // }, - // { - // ID: to.Ptr("oceania"), - // }, - // { - // ID: to.Ptr("southAmerica"), - // }}, - // CountryOrRegions: []*armcdn.ContinentsResponseCountryOrRegionsItem{ - // { - // ContinentID: to.Ptr("africa"), - // ID: to.Ptr("dz"), - // }, - // { - // ContinentID: to.Ptr("africa"), - // ID: to.Ptr("ao"), - // }, - // { - // ContinentID: to.Ptr("africa"), - // ID: to.Ptr("bw"), - // }, - // { - // ContinentID: to.Ptr("africa"), - // ID: to.Ptr("bi"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/LogAnalytics_GetLogAnalyticsResources.json -func ExampleLogAnalyticsClient_GetLogAnalyticsResources() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLogAnalyticsClient().GetLogAnalyticsResources(ctx, "RG", "profile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourcesResponse = armcdn.ResourcesResponse{ - // CustomDomains: []*armcdn.ResourcesResponseCustomDomainsItem{ - // { - // Name: to.Ptr("customdomain1.azurecdn.net"), - // History: to.Ptr(true), - // ID: to.Ptr("customdomain1.azurecdn.net"), - // }, - // { - // Name: to.Ptr("customdomain2.azurecdn.net"), - // History: to.Ptr(true), - // ID: to.Ptr("customdomain2.azurecdn.net"), - // }, - // { - // Name: to.Ptr("customdomain3.azurecdn.net"), - // History: to.Ptr(true), - // ID: to.Ptr("customdomain3.azurecdn.net"), - // }}, - // Endpoints: []*armcdn.ResourcesResponseEndpointsItem{ - // { - // Name: to.Ptr("endpoint1.azureedge.net"), - // CustomDomains: []*armcdn.ResourcesResponseEndpointsPropertiesItemsItem{ - // { - // Name: to.Ptr("customdomain1.azurecdn.net"), - // EndpointID: to.Ptr("enbdpiont1"), - // History: to.Ptr(true), - // ID: to.Ptr("customdomain1.azurecdn.net"), - // }, - // { - // Name: to.Ptr("customdomain2.azurecdn.net"), - // History: to.Ptr(true), - // ID: to.Ptr("customdomain2.azurecdn.net"), - // }}, - // History: to.Ptr(false), - // ID: to.Ptr("endpoint1"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/LogAnalytics_GetWafLogAnalyticsMetrics.json -func ExampleLogAnalyticsClient_GetWafLogAnalyticsMetrics() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLogAnalyticsClient().GetWafLogAnalyticsMetrics(ctx, "RG", "profile1", []armcdn.WafMetric{ - armcdn.WafMetricClientRequestCount}, func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T06:49:27.554Z"); return t }(), func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T09:49:27.554Z"); return t }(), armcdn.WafGranularityPT5M, &armcdn.LogAnalyticsClientGetWafLogAnalyticsMetricsOptions{Actions: []armcdn.WafAction{ - armcdn.WafActionBlock, - armcdn.WafActionLog}, - GroupBy: []armcdn.WafRankingGroupBy{}, - RuleTypes: []armcdn.WafRuleType{}, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WafMetricsResponse = armcdn.WafMetricsResponse{ - // DateTimeBegin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T06:30:27.554Z"); return t}()), - // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T09:00:27.554Z"); return t}()), - // Granularity: to.Ptr(armcdn.WafMetricsGranularityPT5M), - // Series: []*armcdn.WafMetricsResponseSeriesItem{ - // { - // Data: []*armcdn.Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems{ - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:05:00.000Z"); return t}()), - // Value: to.Ptr[float32](2), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:10:00.000Z"); return t}()), - // Value: to.Ptr[float32](32), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:15:00.000Z"); return t}()), - // Value: to.Ptr[float32](31), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:20:00.000Z"); return t}()), - // Value: to.Ptr[float32](63), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:25:00.000Z"); return t}()), - // Value: to.Ptr[float32](50), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:30:00.000Z"); return t}()), - // Value: to.Ptr[float32](12), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:35:00.000Z"); return t}()), - // Value: to.Ptr[float32](8), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:40:00.000Z"); return t}()), - // Value: to.Ptr[float32](21), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:45:00.000Z"); return t}()), - // Value: to.Ptr[float32](30), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:50:00.000Z"); return t}()), - // Value: to.Ptr[float32](18), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:55:00.000Z"); return t}()), - // Value: to.Ptr[float32](28), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:00:00.000Z"); return t}()), - // Value: to.Ptr[float32](3), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:05:00.000Z"); return t}()), - // Value: to.Ptr[float32](58), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:10:00.000Z"); return t}()), - // Value: to.Ptr[float32](42), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:15:00.000Z"); return t}()), - // Value: to.Ptr[float32](17), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:20:00.000Z"); return t}()), - // Value: to.Ptr[float32](21), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:25:00.000Z"); return t}()), - // Value: to.Ptr[float32](41), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:30:00.000Z"); return t}()), - // Value: to.Ptr[float32](8), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:35:00.000Z"); return t}()), - // Value: to.Ptr[float32](15), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:40:00.000Z"); return t}()), - // Value: to.Ptr[float32](25), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:45:00.000Z"); return t}()), - // Value: to.Ptr[float32](13), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:50:00.000Z"); return t}()), - // Value: to.Ptr[float32](17), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:55:00.000Z"); return t}()), - // Value: to.Ptr[float32](29), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T09:00:00.000Z"); return t}()), - // Value: to.Ptr[float32](17), - // }}, - // Groups: []*armcdn.WafMetricsResponseSeriesPropertiesItemsItem{ - // }, - // Metric: to.Ptr("clientRequestCount"), - // Unit: to.Ptr(armcdn.WafMetricsSeriesUnitCount), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/LogAnalytics_GetWafLogAnalyticsRankings.json -func ExampleLogAnalyticsClient_GetWafLogAnalyticsRankings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLogAnalyticsClient().GetWafLogAnalyticsRankings(ctx, "RG", "profile1", []armcdn.WafMetric{ - armcdn.WafMetricClientRequestCount}, func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T06:49:27.554Z"); return t }(), func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T09:49:27.554Z"); return t }(), 5, []armcdn.WafRankingType{ - armcdn.WafRankingTypeRuleID}, &armcdn.LogAnalyticsClientGetWafLogAnalyticsRankingsOptions{Actions: []armcdn.WafAction{}, - RuleTypes: []armcdn.WafRuleType{}, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WafRankingsResponse = armcdn.WafRankingsResponse{ - // Data: []*armcdn.WafRankingsResponseDataItem{ - // { - // GroupValues: []*string{ - // to.Ptr("BlockRateLimit")}, - // Metrics: []*armcdn.ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems{ - // { - // Metric: to.Ptr("clientRequestCount"), - // Percentage: to.Ptr[float64](0), - // Value: to.Ptr[int64](1268), - // }}, - // }}, - // DateTimeBegin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T06:49:27.554Z"); return t}()), - // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T09:49:27.554Z"); return t}()), - // Groups: []*string{ - // to.Ptr("ruleId")}, - // } -} diff --git a/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go index 2b7abb1dd26f..8cbe7cac24bb 100644 --- a/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -45,7 +42,7 @@ func NewManagedRuleSetsClient(subscriptionID string, credential azcore.TokenCred // NewListPager - Lists all available managed rule sets. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - options - ManagedRuleSetsClientListOptions contains the optional parameters for the ManagedRuleSetsClient.NewListPager // method. func (client *ManagedRuleSetsClient) NewListPager(options *ManagedRuleSetsClientListOptions) *runtime.Pager[ManagedRuleSetsClientListResponse] { @@ -72,7 +69,7 @@ func (client *ManagedRuleSetsClient) NewListPager(options *ManagedRuleSetsClient } // listCreateRequest creates the List request. -func (client *ManagedRuleSetsClient) listCreateRequest(ctx context.Context, options *ManagedRuleSetsClientListOptions) (*policy.Request, error) { +func (client *ManagedRuleSetsClient) listCreateRequest(ctx context.Context, _ *ManagedRuleSetsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/cdnWebApplicationFirewallManagedRuleSets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -83,7 +80,7 @@ func (client *ManagedRuleSetsClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/managedrulesets_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client_example_test.go deleted file mode 100644 index 419786cdb8f5..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/managedrulesets_client_example_test.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/WafListManagedRuleSets.json -func ExampleManagedRuleSetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedRuleSetsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ManagedRuleSetDefinitionList = armcdn.ManagedRuleSetDefinitionList{ - // Value: []*armcdn.ManagedRuleSetDefinition{ - // { - // Name: to.Ptr("DefaultRuleSet_1.0"), - // Type: to.Ptr("Microsoft.Cdn/cdnwebapplicationfirewallmanagedrulesets"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Cdn/CdnWebApplicationFirewallManagedRuleSets"), - // Properties: &armcdn.ManagedRuleSetDefinitionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RuleGroups: []*armcdn.ManagedRuleGroupDefinition{ - // { - // Description: to.Ptr("Description for rule group 1."), - // RuleGroupName: to.Ptr("Group1"), - // Rules: []*armcdn.ManagedRuleDefinition{ - // { - // Description: to.Ptr("Generic managed web application firewall rule."), - // RuleID: to.Ptr("GROUP1-0001"), - // }, - // { - // Description: to.Ptr("Generic managed web application firewall rule."), - // RuleID: to.Ptr("GROUP1-0002"), - // }}, - // }, - // { - // Description: to.Ptr("Description for rule group 2."), - // RuleGroupName: to.Ptr("Group2"), - // Rules: []*armcdn.ManagedRuleDefinition{ - // { - // Description: to.Ptr("Generic managed web application firewall rule."), - // RuleID: to.Ptr("GROUP2-0001"), - // }}, - // }}, - // RuleSetType: to.Ptr("DefaultRuleSet"), - // RuleSetVersion: to.Ptr("preview-1.0"), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNameStandardMicrosoft), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/management_client.go b/sdk/resourcemanager/cdn/armcdn/management_client.go index 147db9ead964..2e950e92aa4c 100644 --- a/sdk/resourcemanager/cdn/armcdn/management_client.go +++ b/sdk/resourcemanager/cdn/armcdn/management_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // unique, such as a afdx endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - checkEndpointNameAvailabilityInput - Input to check. // - options - ManagementClientCheckEndpointNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckEndpointNameAvailability @@ -75,7 +72,7 @@ func (client *ManagementClient) CheckEndpointNameAvailability(ctx context.Contex } // checkEndpointNameAvailabilityCreateRequest creates the CheckEndpointNameAvailability request. -func (client *ManagementClient) checkEndpointNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, checkEndpointNameAvailabilityInput CheckEndpointNameAvailabilityInput, options *ManagementClientCheckEndpointNameAvailabilityOptions) (*policy.Request, error) { +func (client *ManagementClient) checkEndpointNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, checkEndpointNameAvailabilityInput CheckEndpointNameAvailabilityInput, _ *ManagementClientCheckEndpointNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/checkEndpointNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -90,7 +87,7 @@ func (client *ManagementClient) checkEndpointNameAvailabilityCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkEndpointNameAvailabilityInput); err != nil { @@ -112,7 +109,7 @@ func (client *ManagementClient) checkEndpointNameAvailabilityHandleResponse(resp // unique, such as a CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - checkNameAvailabilityInput - Input to check. // - options - ManagementClientCheckNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckNameAvailability // method. @@ -139,14 +136,14 @@ func (client *ManagementClient) CheckNameAvailability(ctx context.Context, check } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *ManagementClient) checkNameAvailabilityCreateRequest(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, options *ManagementClientCheckNameAvailabilityOptions) (*policy.Request, error) { +func (client *ManagementClient) checkNameAvailabilityCreateRequest(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, _ *ManagementClientCheckNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Cdn/checkNameAvailability" req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { @@ -168,7 +165,7 @@ func (client *ManagementClient) checkNameAvailabilityHandleResponse(resp *http.R // is globally unique, such as a CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - checkNameAvailabilityInput - Input to check. // - options - ManagementClientCheckNameAvailabilityWithSubscriptionOptions contains the optional parameters for the ManagementClient.CheckNameAvailabilityWithSubscription // method. @@ -195,7 +192,7 @@ func (client *ManagementClient) CheckNameAvailabilityWithSubscription(ctx contex } // checkNameAvailabilityWithSubscriptionCreateRequest creates the CheckNameAvailabilityWithSubscription request. -func (client *ManagementClient) checkNameAvailabilityWithSubscriptionCreateRequest(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, options *ManagementClientCheckNameAvailabilityWithSubscriptionOptions) (*policy.Request, error) { +func (client *ManagementClient) checkNameAvailabilityWithSubscriptionCreateRequest(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, _ *ManagementClientCheckNameAvailabilityWithSubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +203,7 @@ func (client *ManagementClient) checkNameAvailabilityWithSubscriptionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { @@ -229,7 +226,7 @@ func (client *ManagementClient) checkNameAvailabilityWithSubscriptionHandleRespo // endpoint. This path is relative to the origin path specified in the endpoint configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - validateProbeInput - Input to check. // - options - ManagementClientValidateProbeOptions contains the optional parameters for the ManagementClient.ValidateProbe // method. @@ -256,7 +253,7 @@ func (client *ManagementClient) ValidateProbe(ctx context.Context, validateProbe } // validateProbeCreateRequest creates the ValidateProbe request. -func (client *ManagementClient) validateProbeCreateRequest(ctx context.Context, validateProbeInput ValidateProbeInput, options *ManagementClientValidateProbeOptions) (*policy.Request, error) { +func (client *ManagementClient) validateProbeCreateRequest(ctx context.Context, validateProbeInput ValidateProbeInput, _ *ManagementClientValidateProbeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateProbe" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -267,7 +264,7 @@ func (client *ManagementClient) validateProbeCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, validateProbeInput); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/management_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/management_client_example_test.go deleted file mode 100644 index dc7a5aa0cd65..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/management_client_example_test.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CheckEndpointNameAvailability.json -func ExampleManagementClient_CheckEndpointNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().CheckEndpointNameAvailability(ctx, "myResourceGroup", armcdn.CheckEndpointNameAvailabilityInput{ - Name: to.Ptr("sampleName"), - Type: to.Ptr(armcdn.ResourceTypeMicrosoftCdnProfilesAfdEndpoints), - AutoGeneratedDomainNameLabelScope: to.Ptr(armcdn.AutoGeneratedDomainNameLabelScopeTenantReuse), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckEndpointNameAvailabilityOutput = armcdn.CheckEndpointNameAvailabilityOutput{ - // AvailableHostname: to.Ptr(""), - // Message: to.Ptr("Name not available"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("Name is already in use"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CheckNameAvailability.json -func ExampleManagementClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().CheckNameAvailability(ctx, armcdn.CheckNameAvailabilityInput{ - Name: to.Ptr("sampleName"), - Type: to.Ptr(armcdn.ResourceTypeMicrosoftCdnProfilesEndpoints), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityOutput = armcdn.CheckNameAvailabilityOutput{ - // Message: to.Ptr("Name not available"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("Name is already in use"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/CheckNameAvailabilityWithSubscription.json -func ExampleManagementClient_CheckNameAvailabilityWithSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().CheckNameAvailabilityWithSubscription(ctx, armcdn.CheckNameAvailabilityInput{ - Name: to.Ptr("sampleName"), - Type: to.Ptr(armcdn.ResourceTypeMicrosoftCdnProfilesEndpoints), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityOutput = armcdn.CheckNameAvailabilityOutput{ - // Message: to.Ptr("Name not available"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("Name is already in use"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/ValidateProbe.json -func ExampleManagementClient_ValidateProbe() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().ValidateProbe(ctx, armcdn.ValidateProbeInput{ - ProbeURL: to.Ptr("https://www.bing.com/image"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateProbeOutput = armcdn.ValidateProbeOutput{ - // ErrorCode: to.Ptr("None"), - // IsValid: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/cdn/armcdn/models.go b/sdk/resourcemanager/cdn/armcdn/models.go index 6bf84b2b1483..a68031f5f11b 100644 --- a/sdk/resourcemanager/cdn/armcdn/models.go +++ b/sdk/resourcemanager/cdn/armcdn/models.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -29,12 +26,28 @@ type AFDDomain struct { Type *string } +// AFDDomainHTTPSCustomizedCipherSuiteSet - Customized cipher suite set object that will be used for Https when cipherSuiteSetType +// is Customized. +type AFDDomainHTTPSCustomizedCipherSuiteSet struct { + // Cipher suites for TLS 1.2. Required at least one in minimumTlsVersion TLS 1.2. + CipherSuiteSetForTls12 []*AfdCustomizedCipherSuiteForTls12 + + // Cipher suites for TLS 1.3. Required at least one in minimumTlsVersion TLS 1.2, TLS 1.3. + CipherSuiteSetForTls13 []*AfdCustomizedCipherSuiteForTls13 +} + // AFDDomainHTTPSParameters - The JSON object that contains the properties to secure a domain. type AFDDomainHTTPSParameters struct { // REQUIRED; Defines the source of the SSL certificate. CertificateType *AfdCertificateType - // TLS protocol version that will be used for Https + // cipher suite set type that will be used for Https + CipherSuiteSetType *AfdCipherSuiteSetType + + // Customized cipher suites object that will be used for Https when cipherSuiteSetType is Customized. + CustomizedCipherSuiteSet *AFDDomainHTTPSCustomizedCipherSuiteSet + + // TLS protocol version that will be used for Https when cipherSuiteSetType is Customized. MinimumTLSVersion *AfdMinimumTLSVersion // Resource reference to the secret. ie. subs/rg/profile/secret @@ -488,24 +501,38 @@ type CacheExpirationActionParameters struct { CacheType *CacheType // REQUIRED - TypeName *CacheExpirationActionParametersTypeName + TypeName *DeliveryRuleActionParametersType // The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss CacheDuration *string } +// GetDeliveryRuleActionParameters implements the DeliveryRuleActionParametersClassification interface for type CacheExpirationActionParameters. +func (c *CacheExpirationActionParameters) GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters { + return &DeliveryRuleActionParameters{ + TypeName: c.TypeName, + } +} + // CacheKeyQueryStringActionParameters - Defines the parameters for the cache-key query string action. type CacheKeyQueryStringActionParameters struct { // REQUIRED; Caching behavior for the requests QueryStringBehavior *QueryStringBehavior // REQUIRED - TypeName *CacheKeyQueryStringActionParametersTypeName + TypeName *DeliveryRuleActionParametersType // query parameters to include or exclude (comma separated). QueryParameters *string } +// GetDeliveryRuleActionParameters implements the DeliveryRuleActionParametersClassification interface for type CacheKeyQueryStringActionParameters. +func (c *CacheKeyQueryStringActionParameters) GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters { + return &DeliveryRuleActionParameters{ + TypeName: c.TypeName, + } +} + // CanMigrateParameters - Request body for CanMigrate operation. type CanMigrateParameters struct { // REQUIRED; Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. @@ -539,7 +566,25 @@ type CertificateSourceParameters struct { CertificateType *CertificateType // REQUIRED - TypeName *CdnCertificateSourceParametersTypeName + TypeName *CertificateSourceParametersType +} + +// GetCertificateSourceParametersBase implements the CertificateSourceParametersBaseClassification interface for type CertificateSourceParameters. +func (c *CertificateSourceParameters) GetCertificateSourceParametersBase() *CertificateSourceParametersBase { + return &CertificateSourceParametersBase{ + TypeName: c.TypeName, + } +} + +// CertificateSourceParametersBase - Defines the parameters for certificate source +type CertificateSourceParametersBase struct { + // REQUIRED + TypeName *CertificateSourceParametersType +} + +// GetCertificateSourceParametersBase implements the CertificateSourceParametersBaseClassification interface for type CertificateSourceParametersBase. +func (c *CertificateSourceParametersBase) GetCertificateSourceParametersBase() *CertificateSourceParametersBase { + return c } // CheckEndpointNameAvailabilityInput - Input of CheckNameAvailability API. @@ -612,7 +657,7 @@ type ClientPortMatchConditionParameters struct { Operator *ClientPortOperator // REQUIRED - TypeName *ClientPortMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -624,6 +669,13 @@ type ClientPortMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type ClientPortMatchConditionParameters. +func (c *ClientPortMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: c.TypeName, + } +} + type Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems struct { DateTime *time.Time Value *float32 @@ -672,7 +724,7 @@ type CookiesMatchConditionParameters struct { Operator *CookiesOperator // REQUIRED - TypeName *CookiesMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -687,6 +739,13 @@ type CookiesMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type CookiesMatchConditionParameters. +func (c *CookiesMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: c.TypeName, + } +} + // CustomDomain - Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, // e.g. www.contoso.com. type CustomDomain struct { @@ -933,7 +992,7 @@ type DeepCreatedOriginProperties struct { // DeliveryRule - A rule that specifies a set of actions and conditions type DeliveryRule struct { // REQUIRED; A list of actions that are executed when all the conditions of a rule are satisfied. - Actions []DeliveryRuleActionAutoGeneratedClassification + Actions []DeliveryRuleActionClassification // REQUIRED; The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser // order will be applied before a rule with a greater order. Rule with order 0 is a special @@ -947,29 +1006,38 @@ type DeliveryRule struct { Name *string } -// DeliveryRuleActionAutoGenerated - An action for the delivery rule. -type DeliveryRuleActionAutoGenerated struct { +// DeliveryRuleAction - An action for the delivery rule. +type DeliveryRuleAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName +} + +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type DeliveryRuleAction. +func (d *DeliveryRuleAction) GetDeliveryRuleAction() *DeliveryRuleAction { return d } + +// DeliveryRuleActionParameters - Defines the parameters for delivery rule actions +type DeliveryRuleActionParameters struct { + // REQUIRED + TypeName *DeliveryRuleActionParametersType } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type DeliveryRuleActionAutoGenerated. -func (d *DeliveryRuleActionAutoGenerated) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { +// GetDeliveryRuleActionParameters implements the DeliveryRuleActionParametersClassification interface for type DeliveryRuleActionParameters. +func (d *DeliveryRuleActionParameters) GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters { return d } // DeliveryRuleCacheExpirationAction - Defines the cache expiration action for the delivery rule. type DeliveryRuleCacheExpirationAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName // REQUIRED; Defines the parameters for the action. Parameters *CacheExpirationActionParameters } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type DeliveryRuleCacheExpirationAction. -func (d *DeliveryRuleCacheExpirationAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return &DeliveryRuleActionAutoGenerated{ +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type DeliveryRuleCacheExpirationAction. +func (d *DeliveryRuleCacheExpirationAction) GetDeliveryRuleAction() *DeliveryRuleAction { + return &DeliveryRuleAction{ Name: d.Name, } } @@ -977,15 +1045,15 @@ func (d *DeliveryRuleCacheExpirationAction) GetDeliveryRuleActionAutoGenerated() // DeliveryRuleCacheKeyQueryStringAction - Defines the cache-key query string action for the delivery rule. type DeliveryRuleCacheKeyQueryStringAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName // REQUIRED; Defines the parameters for the action. Parameters *CacheKeyQueryStringActionParameters } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type DeliveryRuleCacheKeyQueryStringAction. -func (d *DeliveryRuleCacheKeyQueryStringAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return &DeliveryRuleActionAutoGenerated{ +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type DeliveryRuleCacheKeyQueryStringAction. +func (d *DeliveryRuleCacheKeyQueryStringAction) GetDeliveryRuleAction() *DeliveryRuleAction { + return &DeliveryRuleAction{ Name: d.Name, } } @@ -1015,6 +1083,17 @@ type DeliveryRuleCondition struct { // GetDeliveryRuleCondition implements the DeliveryRuleConditionClassification interface for type DeliveryRuleCondition. func (d *DeliveryRuleCondition) GetDeliveryRuleCondition() *DeliveryRuleCondition { return d } +// DeliveryRuleConditionParameters - Defines the parameters for delivery rule match conditions +type DeliveryRuleConditionParameters struct { + // REQUIRED + TypeName *DeliveryRuleConditionParametersType +} + +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type DeliveryRuleConditionParameters. +func (d *DeliveryRuleConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return d +} + // DeliveryRuleCookiesCondition - Defines the Cookies condition for the delivery rule. type DeliveryRuleCookiesCondition struct { // REQUIRED; The name of the condition for the delivery rule. @@ -1146,15 +1225,15 @@ func (d *DeliveryRuleRequestBodyCondition) GetDeliveryRuleCondition() *DeliveryR // DeliveryRuleRequestHeaderAction - Defines the request header action for the delivery rule. type DeliveryRuleRequestHeaderAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName // REQUIRED; Defines the parameters for the action. Parameters *HeaderActionParameters } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type DeliveryRuleRequestHeaderAction. -func (d *DeliveryRuleRequestHeaderAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return &DeliveryRuleActionAutoGenerated{ +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type DeliveryRuleRequestHeaderAction. +func (d *DeliveryRuleRequestHeaderAction) GetDeliveryRuleAction() *DeliveryRuleAction { + return &DeliveryRuleAction{ Name: d.Name, } } @@ -1226,15 +1305,15 @@ func (d *DeliveryRuleRequestURICondition) GetDeliveryRuleCondition() *DeliveryRu // DeliveryRuleResponseHeaderAction - Defines the response header action for the delivery rule. type DeliveryRuleResponseHeaderAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName // REQUIRED; Defines the parameters for the action. Parameters *HeaderActionParameters } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type DeliveryRuleResponseHeaderAction. -func (d *DeliveryRuleResponseHeaderAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return &DeliveryRuleActionAutoGenerated{ +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type DeliveryRuleResponseHeaderAction. +func (d *DeliveryRuleResponseHeaderAction) GetDeliveryRuleAction() *DeliveryRuleAction { + return &DeliveryRuleAction{ Name: d.Name, } } @@ -1243,15 +1322,15 @@ func (d *DeliveryRuleResponseHeaderAction) GetDeliveryRuleActionAutoGenerated() // applicable to Frontdoor Standard/Premium Profiles. type DeliveryRuleRouteConfigurationOverrideAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName // REQUIRED; Defines the parameters for the action. Parameters *RouteConfigurationOverrideActionParameters } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type DeliveryRuleRouteConfigurationOverrideAction. -func (d *DeliveryRuleRouteConfigurationOverrideAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return &DeliveryRuleActionAutoGenerated{ +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type DeliveryRuleRouteConfigurationOverrideAction. +func (d *DeliveryRuleRouteConfigurationOverrideAction) GetDeliveryRuleAction() *DeliveryRuleAction { + return &DeliveryRuleAction{ Name: d.Name, } } @@ -1631,7 +1710,7 @@ type HTTPVersionMatchConditionParameters struct { Operator *HTTPVersionOperator // REQUIRED - TypeName *HTTPVersionMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -1643,6 +1722,13 @@ type HTTPVersionMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type HTTPVersionMatchConditionParameters. +func (h *HTTPVersionMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: h.TypeName, + } +} + // HeaderActionParameters - Defines the parameters for the request header action. type HeaderActionParameters struct { // REQUIRED; Action to perform @@ -1652,12 +1738,19 @@ type HeaderActionParameters struct { HeaderName *string // REQUIRED - TypeName *HeaderActionParametersTypeName + TypeName *DeliveryRuleActionParametersType // Value for the specified action Value *string } +// GetDeliveryRuleActionParameters implements the DeliveryRuleActionParametersClassification interface for type HeaderActionParameters. +func (h *HeaderActionParameters) GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters { + return &DeliveryRuleActionParameters{ + TypeName: h.TypeName, + } +} + // HealthProbeParameters - The JSON object that contains the properties to send health probes to origin. type HealthProbeParameters struct { // The number of seconds between health probes.Default is 240sec. @@ -1679,7 +1772,7 @@ type HostNameMatchConditionParameters struct { Operator *HostNameOperator // REQUIRED - TypeName *HostNameMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -1691,6 +1784,13 @@ type HostNameMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type HostNameMatchConditionParameters. +func (h *HostNameMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: h.TypeName, + } +} + // IPAddressGroup - CDN Ip address group type IPAddressGroup struct { // The delivery region of the ip address group @@ -1709,10 +1809,10 @@ type IsDeviceMatchConditionParameters struct { Operator *IsDeviceOperator // REQUIRED - TypeName *IsDeviceMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule - MatchValues []*IsDeviceMatchConditionParametersMatchValuesItem + MatchValues []*IsDeviceMatchValue // Describes if this is negate condition or not NegateCondition *bool @@ -1721,6 +1821,13 @@ type IsDeviceMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type IsDeviceMatchConditionParameters. +func (i *IsDeviceMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: i.TypeName, + } +} + // KeyVaultCertificateSourceParameters - Describes the parameters for using a user's KeyVault certificate for securing custom // domain. type KeyVaultCertificateSourceParameters struct { @@ -1737,7 +1844,7 @@ type KeyVaultCertificateSourceParameters struct { SubscriptionID *string // REQUIRED - TypeName *KeyVaultCertificateSourceParametersTypeName + TypeName *CertificateSourceParametersType // REQUIRED; Describes the action that shall be taken when the certificate is updated in Key Vault. UpdateRule *UpdateRule @@ -1749,6 +1856,13 @@ type KeyVaultCertificateSourceParameters struct { SecretVersion *string } +// GetCertificateSourceParametersBase implements the CertificateSourceParametersBaseClassification interface for type KeyVaultCertificateSourceParameters. +func (k *KeyVaultCertificateSourceParameters) GetCertificateSourceParametersBase() *CertificateSourceParametersBase { + return &CertificateSourceParametersBase{ + TypeName: k.TypeName, + } +} + // KeyVaultSigningKeyParameters - Describes the parameters for using a user's KeyVault for URL Signing Key. type KeyVaultSigningKeyParameters struct { // REQUIRED; Resource group of the user's Key Vault containing the secret @@ -1764,7 +1878,7 @@ type KeyVaultSigningKeyParameters struct { SubscriptionID *string // REQUIRED - TypeName *KeyVaultSigningKeyParametersTypeName + TypeName *KeyVaultSigningKeyParametersType // REQUIRED; The name of the user's Key Vault containing the secret VaultName *string @@ -2079,6 +2193,16 @@ type MigrateResultProperties struct { MigratedProfileResourceID *ResourceReference } +// MigrationEndpointMapping - CDN Endpoint Mapping. +type MigrationEndpointMapping struct { + // Name of the classic CDN profile endpoint. + MigratedFrom *string + + // Name of the newly created migrated Azure Frontdoor Standard/Premium profile endpoint. This name will replace the name of + // the classic CDN endpoint resource. + MigratedTo *string +} + // MigrationErrorType - Error response indicates CDN service is not able to process the incoming request. The reason is provided // in the error message. type MigrationErrorType struct { @@ -2110,6 +2234,15 @@ type MigrationParameters struct { MigrationWebApplicationFirewallMappings []*MigrationWebApplicationFirewallMapping } +// MigrationToAfdParameters - Request body for Migrate operation. +type MigrationToAfdParameters struct { + // REQUIRED; Sku for the migration + SKU *SKU + + // A name map between classic CDN endpoints and AFD Premium/Standard endpoints. + MigrationEndpointMappings []*MigrationEndpointMapping +} + // MigrationWebApplicationFirewallMapping - Web Application Firewall Mapping type MigrationWebApplicationFirewallMapping struct { // Migration From Waf policy @@ -2229,15 +2362,15 @@ type OriginGroupOverride struct { // OriginGroupOverrideAction - Defines the origin group override action for the delivery rule. type OriginGroupOverrideAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName // REQUIRED; Defines the parameters for the action. Parameters *OriginGroupOverrideActionParameters } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type OriginGroupOverrideAction. -func (o *OriginGroupOverrideAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return &DeliveryRuleActionAutoGenerated{ +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type OriginGroupOverrideAction. +func (o *OriginGroupOverrideAction) GetDeliveryRuleAction() *DeliveryRuleAction { + return &DeliveryRuleAction{ Name: o.Name, } } @@ -2248,7 +2381,14 @@ type OriginGroupOverrideActionParameters struct { OriginGroup *ResourceReference // REQUIRED - TypeName *OriginGroupOverrideActionParametersTypeName + TypeName *DeliveryRuleActionParametersType +} + +// GetDeliveryRuleActionParameters implements the DeliveryRuleActionParametersClassification interface for type OriginGroupOverrideActionParameters. +func (o *OriginGroupOverrideActionParameters) GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters { + return &DeliveryRuleActionParameters{ + TypeName: o.TypeName, + } } // OriginGroupProperties - The JSON object that contains the properties of the origin group. @@ -2426,7 +2566,7 @@ type PostArgsMatchConditionParameters struct { Operator *PostArgsOperator // REQUIRED - TypeName *PostArgsMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2441,6 +2581,13 @@ type PostArgsMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type PostArgsMatchConditionParameters. +func (p *PostArgsMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: p.TypeName, + } +} + // Profile - A profile is a logical grouping of endpoints that share the same settings. type Profile struct { // REQUIRED; Resource location. @@ -2579,7 +2726,7 @@ type QueryStringMatchConditionParameters struct { Operator *QueryStringOperator // REQUIRED - TypeName *QueryStringMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2591,6 +2738,13 @@ type QueryStringMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type QueryStringMatchConditionParameters. +func (q *QueryStringMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: q.TypeName, + } +} + // RankingsResponse - Rankings Response type RankingsResponse struct { DateTimeBegin *time.Time @@ -2650,7 +2804,7 @@ type RemoteAddressMatchConditionParameters struct { Operator *RemoteAddressOperator // REQUIRED - TypeName *RemoteAddressMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // Match values to match against. The operator will apply to each value in here with OR semantics. If any of them match the // variable with the given operator this match condition is considered a match. @@ -2663,13 +2817,20 @@ type RemoteAddressMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type RemoteAddressMatchConditionParameters. +func (r *RemoteAddressMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: r.TypeName, + } +} + // RequestBodyMatchConditionParameters - Defines the parameters for RequestBody match conditions type RequestBodyMatchConditionParameters struct { // REQUIRED; Describes operator to be matched Operator *RequestBodyOperator // REQUIRED - TypeName *RequestBodyMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2681,13 +2842,20 @@ type RequestBodyMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type RequestBodyMatchConditionParameters. +func (r *RequestBodyMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: r.TypeName, + } +} + // RequestHeaderMatchConditionParameters - Defines the parameters for RequestHeader match conditions type RequestHeaderMatchConditionParameters struct { // REQUIRED; Describes operator to be matched Operator *RequestHeaderOperator // REQUIRED - TypeName *RequestHeaderMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2702,16 +2870,23 @@ type RequestHeaderMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type RequestHeaderMatchConditionParameters. +func (r *RequestHeaderMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: r.TypeName, + } +} + // RequestMethodMatchConditionParameters - Defines the parameters for RequestMethod match conditions type RequestMethodMatchConditionParameters struct { // REQUIRED; Describes operator to be matched Operator *RequestMethodOperator // REQUIRED - TypeName *RequestMethodMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule - MatchValues []*RequestMethodMatchConditionParametersMatchValuesItem + MatchValues []*RequestMethodMatchValue // Describes if this is negate condition or not NegateCondition *bool @@ -2720,16 +2895,23 @@ type RequestMethodMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type RequestMethodMatchConditionParameters. +func (r *RequestMethodMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: r.TypeName, + } +} + // RequestSchemeMatchConditionParameters - Defines the parameters for RequestScheme match conditions type RequestSchemeMatchConditionParameters struct { // REQUIRED; Describes operator to be matched Operator *RequestSchemeMatchConditionParametersOperator // REQUIRED - TypeName *RequestSchemeMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule - MatchValues []*RequestSchemeMatchConditionParametersMatchValuesItem + MatchValues []*RequestSchemeMatchValue // Describes if this is negate condition or not NegateCondition *bool @@ -2738,13 +2920,20 @@ type RequestSchemeMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type RequestSchemeMatchConditionParameters. +func (r *RequestSchemeMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: r.TypeName, + } +} + // RequestURIMatchConditionParameters - Defines the parameters for RequestUri match conditions type RequestURIMatchConditionParameters struct { // REQUIRED; Describes operator to be matched Operator *RequestURIOperator // REQUIRED - TypeName *RequestURIMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2756,6 +2945,13 @@ type RequestURIMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type RequestURIMatchConditionParameters. +func (r *RequestURIMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: r.TypeName, + } +} + // ResourceReference - Reference to another resource. type ResourceReference struct { // Resource ID. @@ -2847,7 +3043,7 @@ type Route struct { // RouteConfigurationOverrideActionParameters - Defines the parameters for the route configuration override action. type RouteConfigurationOverrideActionParameters struct { // REQUIRED - TypeName *RouteConfigurationOverrideActionParametersTypeName + TypeName *DeliveryRuleActionParametersType // The caching configuration associated with this rule. To disable caching, do not provide a cacheConfiguration object. CacheConfiguration *CacheConfiguration @@ -2856,6 +3052,13 @@ type RouteConfigurationOverrideActionParameters struct { OriginGroupOverride *OriginGroupOverride } +// GetDeliveryRuleActionParameters implements the DeliveryRuleActionParametersClassification interface for type RouteConfigurationOverrideActionParameters. +func (r *RouteConfigurationOverrideActionParameters) GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters { + return &DeliveryRuleActionParameters{ + TypeName: r.TypeName, + } +} + // RouteListResult - Result of the request to list routes. It contains a list of route objects and a URL link to get the next // set of results. type RouteListResult struct { @@ -2989,7 +3192,7 @@ type RuleListResult struct { // RuleProperties - The JSON object that contains the properties of the Rules to create. type RuleProperties struct { // A list of actions that are executed when all the conditions of a rule are satisfied. - Actions []DeliveryRuleActionAutoGeneratedClassification + Actions []DeliveryRuleActionClassification // A list of conditions that must be matched for the actions to be executed Conditions []DeliveryRuleConditionClassification @@ -3062,7 +3265,7 @@ type RuleUpdateParameters struct { // RuleUpdatePropertiesParameters - The JSON object that contains the properties of the rule to update. type RuleUpdatePropertiesParameters struct { // A list of actions that are executed when all the conditions of a rule are satisfied. - Actions []DeliveryRuleActionAutoGeneratedClassification + Actions []DeliveryRuleActionClassification // A list of conditions that must be matched for the actions to be executed Conditions []DeliveryRuleConditionClassification @@ -3104,7 +3307,7 @@ type SSLProtocolMatchConditionParameters struct { Operator *SSLProtocolOperator // REQUIRED - TypeName *SSLProtocolMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*SSLProtocol @@ -3116,6 +3319,13 @@ type SSLProtocolMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type SSLProtocolMatchConditionParameters. +func (s *SSLProtocolMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: s.TypeName, + } +} + // Secret - Friendly Secret name mapping to the any Secret or secret related information. type Secret struct { // The JSON object that contains the properties of the Secret to create. @@ -3270,7 +3480,7 @@ type ServerPortMatchConditionParameters struct { Operator *ServerPortOperator // REQUIRED - TypeName *ServerPortMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3282,6 +3492,13 @@ type ServerPortMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type ServerPortMatchConditionParameters. +func (s *ServerPortMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: s.TypeName, + } +} + // ServiceSpecification - One property of operation, include log specifications. type ServiceSpecification struct { // Log specifications of operation. @@ -3316,7 +3533,7 @@ type SocketAddrMatchConditionParameters struct { Operator *SocketAddrOperator // REQUIRED - TypeName *SocketAddrMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3328,6 +3545,13 @@ type SocketAddrMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type SocketAddrMatchConditionParameters. +func (s *SocketAddrMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: s.TypeName, + } +} + // SsoURI - The URI required to login to the supplemental portal from the Azure portal. type SsoURI struct { // READ-ONLY; The URI used to login to the supplemental portal. @@ -3367,7 +3591,7 @@ type URLFileExtensionMatchConditionParameters struct { Operator *URLFileExtensionOperator // REQUIRED - TypeName *URLFileExtensionMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3379,13 +3603,20 @@ type URLFileExtensionMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type URLFileExtensionMatchConditionParameters. +func (u *URLFileExtensionMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: u.TypeName, + } +} + // URLFileNameMatchConditionParameters - Defines the parameters for UrlFilename match conditions type URLFileNameMatchConditionParameters struct { // REQUIRED; Describes operator to be matched Operator *URLFileNameOperator // REQUIRED - TypeName *URLFileNameMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3397,13 +3628,20 @@ type URLFileNameMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type URLFileNameMatchConditionParameters. +func (u *URLFileNameMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: u.TypeName, + } +} + // URLPathMatchConditionParameters - Defines the parameters for UrlPath match conditions type URLPathMatchConditionParameters struct { // REQUIRED; Describes operator to be matched Operator *URLPathOperator // REQUIRED - TypeName *URLPathMatchConditionParametersTypeName + TypeName *DeliveryRuleConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3415,18 +3653,25 @@ type URLPathMatchConditionParameters struct { Transforms []*Transform } +// GetDeliveryRuleConditionParameters implements the DeliveryRuleConditionParametersClassification interface for type URLPathMatchConditionParameters. +func (u *URLPathMatchConditionParameters) GetDeliveryRuleConditionParameters() *DeliveryRuleConditionParameters { + return &DeliveryRuleConditionParameters{ + TypeName: u.TypeName, + } +} + // URLRedirectAction - Defines the url redirect action for the delivery rule. type URLRedirectAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName // REQUIRED; Defines the parameters for the action. Parameters *URLRedirectActionParameters } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type URLRedirectAction. -func (u *URLRedirectAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return &DeliveryRuleActionAutoGenerated{ +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type URLRedirectAction. +func (u *URLRedirectAction) GetDeliveryRuleAction() *DeliveryRuleAction { + return &DeliveryRuleAction{ Name: u.Name, } } @@ -3437,7 +3682,7 @@ type URLRedirectActionParameters struct { RedirectType *RedirectType // REQUIRED - TypeName *URLRedirectActionParametersTypeName + TypeName *DeliveryRuleActionParametersType // Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. CustomFragment *string @@ -3458,18 +3703,25 @@ type URLRedirectActionParameters struct { DestinationProtocol *DestinationProtocol } +// GetDeliveryRuleActionParameters implements the DeliveryRuleActionParametersClassification interface for type URLRedirectActionParameters. +func (u *URLRedirectActionParameters) GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters { + return &DeliveryRuleActionParameters{ + TypeName: u.TypeName, + } +} + // URLRewriteAction - Defines the url rewrite action for the delivery rule. type URLRewriteAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName // REQUIRED; Defines the parameters for the action. Parameters *URLRewriteActionParameters } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type URLRewriteAction. -func (u *URLRewriteAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return &DeliveryRuleActionAutoGenerated{ +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type URLRewriteAction. +func (u *URLRewriteAction) GetDeliveryRuleAction() *DeliveryRuleAction { + return &DeliveryRuleAction{ Name: u.Name, } } @@ -3484,24 +3736,31 @@ type URLRewriteActionParameters struct { SourcePattern *string // REQUIRED - TypeName *URLRewriteActionParametersTypeName + TypeName *DeliveryRuleActionParametersType // Whether to preserve unmatched path. Default value is true. PreserveUnmatchedPath *bool } +// GetDeliveryRuleActionParameters implements the DeliveryRuleActionParametersClassification interface for type URLRewriteActionParameters. +func (u *URLRewriteActionParameters) GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters { + return &DeliveryRuleActionParameters{ + TypeName: u.TypeName, + } +} + // URLSigningAction - Defines the url signing action for the delivery rule. type URLSigningAction struct { // REQUIRED; The name of the action for the delivery rule. - Name *DeliveryRuleAction + Name *DeliveryRuleActionName // REQUIRED; Defines the parameters for the action. Parameters *URLSigningActionParameters } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type URLSigningAction. -func (u *URLSigningAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return &DeliveryRuleActionAutoGenerated{ +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type URLSigningAction. +func (u *URLSigningAction) GetDeliveryRuleAction() *DeliveryRuleAction { + return &DeliveryRuleAction{ Name: u.Name, } } @@ -3509,7 +3768,7 @@ func (u *URLSigningAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleAct // URLSigningActionParameters - Defines the parameters for the Url Signing action. type URLSigningActionParameters struct { // REQUIRED - TypeName *URLSigningActionParametersTypeName + TypeName *DeliveryRuleActionParametersType // Algorithm to use for URL signing Algorithm *Algorithm @@ -3518,6 +3777,13 @@ type URLSigningActionParameters struct { ParameterNameOverride []*URLSigningParamIdentifier } +// GetDeliveryRuleActionParameters implements the DeliveryRuleActionParametersClassification interface for type URLSigningActionParameters. +func (u *URLSigningActionParameters) GetDeliveryRuleActionParameters() *DeliveryRuleActionParameters { + return &DeliveryRuleActionParameters{ + TypeName: u.TypeName, + } +} + // URLSigningKey - Url signing key type URLSigningKey struct { // REQUIRED; Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form @@ -3538,11 +3804,11 @@ type URLSigningKeyParameters struct { // /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ SecretSource *ResourceReference + // REQUIRED; Version of the secret to be used + SecretVersion *string + // REQUIRED; The type of the secret resource. Type *SecretType - - // Version of the secret to be used - SecretVersion *string } // GetSecretParameters implements the SecretParametersClassification interface for type URLSigningKeyParameters. diff --git a/sdk/resourcemanager/cdn/armcdn/models_serde.go b/sdk/resourcemanager/cdn/armcdn/models_serde.go index 8bd436672968..111a58ea8a41 100644 --- a/sdk/resourcemanager/cdn/armcdn/models_serde.go +++ b/sdk/resourcemanager/cdn/armcdn/models_serde.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -58,10 +55,43 @@ func (a *AFDDomain) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AFDDomainHTTPSCustomizedCipherSuiteSet. +func (a AFDDomainHTTPSCustomizedCipherSuiteSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cipherSuiteSetForTls12", a.CipherSuiteSetForTls12) + populate(objectMap, "cipherSuiteSetForTls13", a.CipherSuiteSetForTls13) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDDomainHTTPSCustomizedCipherSuiteSet. +func (a *AFDDomainHTTPSCustomizedCipherSuiteSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cipherSuiteSetForTls12": + err = unpopulate(val, "CipherSuiteSetForTls12", &a.CipherSuiteSetForTls12) + delete(rawMsg, key) + case "cipherSuiteSetForTls13": + err = unpopulate(val, "CipherSuiteSetForTls13", &a.CipherSuiteSetForTls13) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AFDDomainHTTPSParameters. func (a AFDDomainHTTPSParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "certificateType", a.CertificateType) + populate(objectMap, "cipherSuiteSetType", a.CipherSuiteSetType) + populate(objectMap, "customizedCipherSuiteSet", a.CustomizedCipherSuiteSet) populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion) populate(objectMap, "secret", a.Secret) return json.Marshal(objectMap) @@ -79,6 +109,12 @@ func (a *AFDDomainHTTPSParameters) UnmarshalJSON(data []byte) error { case "certificateType": err = unpopulate(val, "CertificateType", &a.CertificateType) delete(rawMsg, key) + case "cipherSuiteSetType": + err = unpopulate(val, "CipherSuiteSetType", &a.CipherSuiteSetType) + delete(rawMsg, key) + case "customizedCipherSuiteSet": + err = unpopulate(val, "CustomizedCipherSuiteSet", &a.CustomizedCipherSuiteSet) + delete(rawMsg, key) case "minimumTlsVersion": err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion) delete(rawMsg, key) @@ -1079,7 +1115,7 @@ func (c CacheExpirationActionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "cacheBehavior", c.CacheBehavior) populate(objectMap, "cacheDuration", c.CacheDuration) populate(objectMap, "cacheType", c.CacheType) - populate(objectMap, "typeName", c.TypeName) + objectMap["typeName"] = DeliveryRuleActionParametersTypeDeliveryRuleCacheExpirationActionParameters return json.Marshal(objectMap) } @@ -1117,7 +1153,7 @@ func (c CacheKeyQueryStringActionParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "queryParameters", c.QueryParameters) populate(objectMap, "queryStringBehavior", c.QueryStringBehavior) - populate(objectMap, "typeName", c.TypeName) + objectMap["typeName"] = DeliveryRuleActionParametersTypeDeliveryRuleCacheKeyQueryStringBehaviorActionParameters return json.Marshal(objectMap) } @@ -1248,7 +1284,7 @@ func (c *CanMigrateResult) UnmarshalJSON(data []byte) error { func (c CertificateSourceParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "certificateType", c.CertificateType) - populate(objectMap, "typeName", c.TypeName) + objectMap["typeName"] = CertificateSourceParametersTypeCdnCertificateSourceParameters return json.Marshal(objectMap) } @@ -1275,6 +1311,33 @@ func (c *CertificateSourceParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CertificateSourceParametersBase. +func (c CertificateSourceParametersBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["typeName"] = c.TypeName + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateSourceParametersBase. +func (c *CertificateSourceParametersBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "typeName": + err = unpopulate(val, "TypeName", &c.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CheckEndpointNameAvailabilityInput. func (c CheckEndpointNameAvailabilityInput) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1480,7 +1543,7 @@ func (c ClientPortMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", c.NegateCondition) populate(objectMap, "operator", c.Operator) populate(objectMap, "transforms", c.Transforms) - populate(objectMap, "typeName", c.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleClientPortConditionParameters return json.Marshal(objectMap) } @@ -1741,7 +1804,7 @@ func (c CookiesMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "operator", c.Operator) populate(objectMap, "selector", c.Selector) populate(objectMap, "transforms", c.Transforms) - populate(objectMap, "typeName", c.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleCookiesConditionParameters return json.Marshal(objectMap) } @@ -2377,7 +2440,7 @@ func (d *DeliveryRule) UnmarshalJSON(data []byte) error { var err error switch key { case "actions": - d.Actions, err = unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(val) + d.Actions, err = unmarshalDeliveryRuleActionClassificationArray(val) delete(rawMsg, key) case "conditions": d.Conditions, err = unmarshalDeliveryRuleConditionClassificationArray(val) @@ -2396,15 +2459,15 @@ func (d *DeliveryRule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleActionAutoGenerated. -func (d DeliveryRuleActionAutoGenerated) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleAction. +func (d DeliveryRuleAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["name"] = d.Name return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleActionAutoGenerated. -func (d *DeliveryRuleActionAutoGenerated) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleAction. +func (d *DeliveryRuleAction) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -2423,10 +2486,37 @@ func (d *DeliveryRuleActionAutoGenerated) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleActionParameters. +func (d DeliveryRuleActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["typeName"] = d.TypeName + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleActionParameters. +func (d *DeliveryRuleActionParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "typeName": + err = unpopulate(val, "TypeName", &d.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCacheExpirationAction. func (d DeliveryRuleCacheExpirationAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["name"] = DeliveryRuleActionCacheExpiration + objectMap["name"] = DeliveryRuleActionNameCacheExpiration populate(objectMap, "parameters", d.Parameters) return json.Marshal(objectMap) } @@ -2457,7 +2547,7 @@ func (d *DeliveryRuleCacheExpirationAction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCacheKeyQueryStringAction. func (d DeliveryRuleCacheKeyQueryStringAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["name"] = DeliveryRuleActionCacheKeyQueryString + objectMap["name"] = DeliveryRuleActionNameCacheKeyQueryString populate(objectMap, "parameters", d.Parameters) return json.Marshal(objectMap) } @@ -2543,6 +2633,33 @@ func (d *DeliveryRuleCondition) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleConditionParameters. +func (d DeliveryRuleConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["typeName"] = d.TypeName + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleConditionParameters. +func (d *DeliveryRuleConditionParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "typeName": + err = unpopulate(val, "TypeName", &d.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCookiesCondition. func (d DeliveryRuleCookiesCondition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2794,7 +2911,7 @@ func (d *DeliveryRuleRequestBodyCondition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestHeaderAction. func (d DeliveryRuleRequestHeaderAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["name"] = DeliveryRuleActionModifyRequestHeader + objectMap["name"] = DeliveryRuleActionNameModifyRequestHeader populate(objectMap, "parameters", d.Parameters) return json.Marshal(objectMap) } @@ -2949,7 +3066,7 @@ func (d *DeliveryRuleRequestURICondition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeliveryRuleResponseHeaderAction. func (d DeliveryRuleResponseHeaderAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["name"] = DeliveryRuleActionModifyResponseHeader + objectMap["name"] = DeliveryRuleActionNameModifyResponseHeader populate(objectMap, "parameters", d.Parameters) return json.Marshal(objectMap) } @@ -2980,7 +3097,7 @@ func (d *DeliveryRuleResponseHeaderAction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRouteConfigurationOverrideAction. func (d DeliveryRuleRouteConfigurationOverrideAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["name"] = DeliveryRuleActionRouteConfigurationOverride + objectMap["name"] = DeliveryRuleActionNameRouteConfigurationOverride populate(objectMap, "parameters", d.Parameters) return json.Marshal(objectMap) } @@ -3787,7 +3904,7 @@ func (h HTTPVersionMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", h.NegateCondition) populate(objectMap, "operator", h.Operator) populate(objectMap, "transforms", h.Transforms) - populate(objectMap, "typeName", h.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleHTTPVersionConditionParameters return json.Marshal(objectMap) } @@ -3828,7 +3945,7 @@ func (h HeaderActionParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "headerAction", h.HeaderAction) populate(objectMap, "headerName", h.HeaderName) - populate(objectMap, "typeName", h.TypeName) + objectMap["typeName"] = DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters populate(objectMap, "value", h.Value) return json.Marshal(objectMap) } @@ -3908,7 +4025,7 @@ func (h HostNameMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", h.NegateCondition) populate(objectMap, "operator", h.Operator) populate(objectMap, "transforms", h.Transforms) - populate(objectMap, "typeName", h.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleHostNameConditionParameters return json.Marshal(objectMap) } @@ -3986,7 +4103,7 @@ func (i IsDeviceMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", i.NegateCondition) populate(objectMap, "operator", i.Operator) populate(objectMap, "transforms", i.Transforms) - populate(objectMap, "typeName", i.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleIsDeviceConditionParameters return json.Marshal(objectMap) } @@ -4030,7 +4147,7 @@ func (k KeyVaultCertificateSourceParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "secretName", k.SecretName) populate(objectMap, "secretVersion", k.SecretVersion) populate(objectMap, "subscriptionId", k.SubscriptionID) - populate(objectMap, "typeName", k.TypeName) + objectMap["typeName"] = CertificateSourceParametersTypeKeyVaultCertificateSourceParameters populate(objectMap, "updateRule", k.UpdateRule) populate(objectMap, "vaultName", k.VaultName) return json.Marshal(objectMap) @@ -4996,6 +5113,37 @@ func (m *MigrateResultProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MigrationEndpointMapping. +func (m MigrationEndpointMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "migratedFrom", m.MigratedFrom) + populate(objectMap, "migratedTo", m.MigratedTo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationEndpointMapping. +func (m *MigrationEndpointMapping) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "migratedFrom": + err = unpopulate(val, "MigratedFrom", &m.MigratedFrom) + delete(rawMsg, key) + case "migratedTo": + err = unpopulate(val, "MigratedTo", &m.MigratedTo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MigrationErrorType. func (m MigrationErrorType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5074,6 +5222,37 @@ func (m *MigrationParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MigrationToAfdParameters. +func (m MigrationToAfdParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "migrationEndpointMappings", m.MigrationEndpointMappings) + populate(objectMap, "sku", m.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationToAfdParameters. +func (m *MigrationToAfdParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "migrationEndpointMappings": + err = unpopulate(val, "MigrationEndpointMappings", &m.MigrationEndpointMappings) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MigrationWebApplicationFirewallMapping. func (m MigrationWebApplicationFirewallMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5396,7 +5575,7 @@ func (o *OriginGroupOverride) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OriginGroupOverrideAction. func (o OriginGroupOverrideAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["name"] = DeliveryRuleActionOriginGroupOverride + objectMap["name"] = DeliveryRuleActionNameOriginGroupOverride populate(objectMap, "parameters", o.Parameters) return json.Marshal(objectMap) } @@ -5428,7 +5607,7 @@ func (o *OriginGroupOverrideAction) UnmarshalJSON(data []byte) error { func (o OriginGroupOverrideActionParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "originGroup", o.OriginGroup) - populate(objectMap, "typeName", o.TypeName) + objectMap["typeName"] = DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters return json.Marshal(objectMap) } @@ -5823,7 +6002,7 @@ func (p PostArgsMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "operator", p.Operator) populate(objectMap, "selector", p.Selector) populate(objectMap, "transforms", p.Transforms) - populate(objectMap, "typeName", p.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRulePostArgsConditionParameters return json.Marshal(objectMap) } @@ -6231,7 +6410,7 @@ func (q QueryStringMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", q.NegateCondition) populate(objectMap, "operator", q.Operator) populate(objectMap, "transforms", q.Transforms) - populate(objectMap, "typeName", q.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleQueryStringConditionParameters return json.Marshal(objectMap) } @@ -6484,7 +6663,7 @@ func (r RemoteAddressMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", r.NegateCondition) populate(objectMap, "operator", r.Operator) populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleRemoteAddressConditionParameters return json.Marshal(objectMap) } @@ -6527,7 +6706,7 @@ func (r RequestBodyMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", r.NegateCondition) populate(objectMap, "operator", r.Operator) populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleRequestBodyConditionParameters return json.Marshal(objectMap) } @@ -6571,7 +6750,7 @@ func (r RequestHeaderMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "operator", r.Operator) populate(objectMap, "selector", r.Selector) populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleRequestHeaderConditionParameters return json.Marshal(objectMap) } @@ -6617,7 +6796,7 @@ func (r RequestMethodMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", r.NegateCondition) populate(objectMap, "operator", r.Operator) populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleRequestMethodConditionParameters return json.Marshal(objectMap) } @@ -6660,7 +6839,7 @@ func (r RequestSchemeMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", r.NegateCondition) populate(objectMap, "operator", r.Operator) populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleRequestSchemeConditionParameters return json.Marshal(objectMap) } @@ -6703,7 +6882,7 @@ func (r RequestURIMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", r.NegateCondition) populate(objectMap, "operator", r.Operator) populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleRequestURIConditionParameters return json.Marshal(objectMap) } @@ -7067,7 +7246,7 @@ func (r RouteConfigurationOverrideActionParameters) MarshalJSON() ([]byte, error objectMap := make(map[string]any) populate(objectMap, "cacheConfiguration", r.CacheConfiguration) populate(objectMap, "originGroupOverride", r.OriginGroupOverride) - populate(objectMap, "typeName", r.TypeName) + objectMap["typeName"] = DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters return json.Marshal(objectMap) } @@ -7402,7 +7581,7 @@ func (r *RuleProperties) UnmarshalJSON(data []byte) error { var err error switch key { case "actions": - r.Actions, err = unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(val) + r.Actions, err = unmarshalDeliveryRuleActionClassificationArray(val) delete(rawMsg, key) case "conditions": r.Conditions, err = unmarshalDeliveryRuleConditionClassificationArray(val) @@ -7587,7 +7766,7 @@ func (r *RuleUpdatePropertiesParameters) UnmarshalJSON(data []byte) error { var err error switch key { case "actions": - r.Actions, err = unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(val) + r.Actions, err = unmarshalDeliveryRuleActionClassificationArray(val) delete(rawMsg, key) case "conditions": r.Conditions, err = unmarshalDeliveryRuleConditionClassificationArray(val) @@ -7643,7 +7822,7 @@ func (s SSLProtocolMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", s.NegateCondition) populate(objectMap, "operator", s.Operator) populate(objectMap, "transforms", s.Transforms) - populate(objectMap, "typeName", s.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleSSLProtocolConditionParameters return json.Marshal(objectMap) } @@ -8086,7 +8265,7 @@ func (s ServerPortMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", s.NegateCondition) populate(objectMap, "operator", s.Operator) populate(objectMap, "transforms", s.Transforms) - populate(objectMap, "typeName", s.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters return json.Marshal(objectMap) } @@ -8203,7 +8382,7 @@ func (s SocketAddrMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", s.NegateCondition) populate(objectMap, "operator", s.Operator) populate(objectMap, "transforms", s.Transforms) - populate(objectMap, "typeName", s.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters return json.Marshal(objectMap) } @@ -8347,7 +8526,7 @@ func (u URLFileExtensionMatchConditionParameters) MarshalJSON() ([]byte, error) populate(objectMap, "negateCondition", u.NegateCondition) populate(objectMap, "operator", u.Operator) populate(objectMap, "transforms", u.Transforms) - populate(objectMap, "typeName", u.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters return json.Marshal(objectMap) } @@ -8390,7 +8569,7 @@ func (u URLFileNameMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", u.NegateCondition) populate(objectMap, "operator", u.Operator) populate(objectMap, "transforms", u.Transforms) - populate(objectMap, "typeName", u.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters return json.Marshal(objectMap) } @@ -8433,7 +8612,7 @@ func (u URLPathMatchConditionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "negateCondition", u.NegateCondition) populate(objectMap, "operator", u.Operator) populate(objectMap, "transforms", u.Transforms) - populate(objectMap, "typeName", u.TypeName) + objectMap["typeName"] = DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters return json.Marshal(objectMap) } @@ -8472,7 +8651,7 @@ func (u *URLPathMatchConditionParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type URLRedirectAction. func (u URLRedirectAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["name"] = DeliveryRuleActionURLRedirect + objectMap["name"] = DeliveryRuleActionNameURLRedirect populate(objectMap, "parameters", u.Parameters) return json.Marshal(objectMap) } @@ -8509,7 +8688,7 @@ func (u URLRedirectActionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "customQueryString", u.CustomQueryString) populate(objectMap, "destinationProtocol", u.DestinationProtocol) populate(objectMap, "redirectType", u.RedirectType) - populate(objectMap, "typeName", u.TypeName) + objectMap["typeName"] = DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters return json.Marshal(objectMap) } @@ -8554,7 +8733,7 @@ func (u *URLRedirectActionParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type URLRewriteAction. func (u URLRewriteAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["name"] = DeliveryRuleActionURLRewrite + objectMap["name"] = DeliveryRuleActionNameURLRewrite populate(objectMap, "parameters", u.Parameters) return json.Marshal(objectMap) } @@ -8588,7 +8767,7 @@ func (u URLRewriteActionParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "destination", u.Destination) populate(objectMap, "preserveUnmatchedPath", u.PreserveUnmatchedPath) populate(objectMap, "sourcePattern", u.SourcePattern) - populate(objectMap, "typeName", u.TypeName) + objectMap["typeName"] = DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters return json.Marshal(objectMap) } @@ -8624,7 +8803,7 @@ func (u *URLRewriteActionParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type URLSigningAction. func (u URLSigningAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["name"] = DeliveryRuleActionURLSigning + objectMap["name"] = DeliveryRuleActionNameURLSigning populate(objectMap, "parameters", u.Parameters) return json.Marshal(objectMap) } @@ -8657,7 +8836,7 @@ func (u URLSigningActionParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "algorithm", u.Algorithm) populate(objectMap, "parameterNameOverride", u.ParameterNameOverride) - populate(objectMap, "typeName", u.TypeName) + objectMap["typeName"] = DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters return json.Marshal(objectMap) } diff --git a/sdk/resourcemanager/cdn/armcdn/operations_client.go b/sdk/resourcemanager/cdn/armcdn/operations_client.go index 37de6b41ee3a..0b65e830bcba 100644 --- a/sdk/resourcemanager/cdn/armcdn/operations_client.go +++ b/sdk/resourcemanager/cdn/armcdn/operations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -39,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available CDN REST API operations. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -65,14 +62,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Cdn/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/operations_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/operations_client_example_test.go deleted file mode 100644 index 2b806b7d281b..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/operations_client_example_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationsListResult = armcdn.OperationsListResult{ - // Value: []*armcdn.Operation{ - // { - // Name: to.Ptr("Microsoft.Cdn/register/action"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("Registers the Microsoft.Cdn Resource Provider"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("Microsoft.Cdn Resource Provider"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cdn/edgenodes/read"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("read"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("EdgeNode"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cdn/edgenodes/write"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("write"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("EdgeNode"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cdn/edgenodes/delete"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("delete"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("EdgeNode"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cdn/profiles/read"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("read"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("Profile"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cdn/profiles/write"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("write"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("Profile"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cdn/operationresults/profileresults/write"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("write"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("Profile"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cdn/operationresults/profileresults/delete"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("delete"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("Profile"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cdn/operationresults/profileresults/CheckResourceUsage/action"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("CheckResourceUsage"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("Profile"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cdn/operationresults/profileresults/GenerateSsoUri/action"), - // Display: &armcdn.OperationDisplay{ - // Operation: to.Ptr("GenerateSsoUri"), - // Provider: to.Ptr("Microsoft.Cdn"), - // Resource: to.Ptr("Profile"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/options.go b/sdk/resourcemanager/cdn/armcdn/options.go index 44aa1e609d1a..03fd3fef48e3 100644 --- a/sdk/resourcemanager/cdn/armcdn/options.go +++ b/sdk/resourcemanager/cdn/armcdn/options.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,26 +7,26 @@ package armcdn // AFDCustomDomainsClientBeginCreateOptions contains the optional parameters for the AFDCustomDomainsClient.BeginCreate method. type AFDCustomDomainsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDCustomDomainsClientBeginDeleteOptions contains the optional parameters for the AFDCustomDomainsClient.BeginDelete method. type AFDCustomDomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDCustomDomainsClientBeginRefreshValidationTokenOptions contains the optional parameters for the AFDCustomDomainsClient.BeginRefreshValidationToken // method. type AFDCustomDomainsClientBeginRefreshValidationTokenOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDCustomDomainsClientBeginUpdateOptions contains the optional parameters for the AFDCustomDomainsClient.BeginUpdate method. type AFDCustomDomainsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -46,26 +43,26 @@ type AFDCustomDomainsClientListByProfileOptions struct { // AFDEndpointsClientBeginCreateOptions contains the optional parameters for the AFDEndpointsClient.BeginCreate method. type AFDEndpointsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDEndpointsClientBeginDeleteOptions contains the optional parameters for the AFDEndpointsClient.BeginDelete method. type AFDEndpointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDEndpointsClientBeginPurgeContentOptions contains the optional parameters for the AFDEndpointsClient.BeginPurgeContent // method. type AFDEndpointsClientBeginPurgeContentOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDEndpointsClientBeginUpdateOptions contains the optional parameters for the AFDEndpointsClient.BeginUpdate method. type AFDEndpointsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -94,19 +91,19 @@ type AFDEndpointsClientValidateCustomDomainOptions struct { // AFDOriginGroupsClientBeginCreateOptions contains the optional parameters for the AFDOriginGroupsClient.BeginCreate method. type AFDOriginGroupsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDOriginGroupsClientBeginDeleteOptions contains the optional parameters for the AFDOriginGroupsClient.BeginDelete method. type AFDOriginGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDOriginGroupsClientBeginUpdateOptions contains the optional parameters for the AFDOriginGroupsClient.BeginUpdate method. type AFDOriginGroupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -129,19 +126,19 @@ type AFDOriginGroupsClientListResourceUsageOptions struct { // AFDOriginsClientBeginCreateOptions contains the optional parameters for the AFDOriginsClient.BeginCreate method. type AFDOriginsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDOriginsClientBeginDeleteOptions contains the optional parameters for the AFDOriginsClient.BeginDelete method. type AFDOriginsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AFDOriginsClientBeginUpdateOptions contains the optional parameters for the AFDOriginsClient.BeginUpdate method. type AFDOriginsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -158,7 +155,7 @@ type AFDOriginsClientListByOriginGroupOptions struct { // AFDProfilesClientBeginUpgradeOptions contains the optional parameters for the AFDProfilesClient.BeginUpgrade method. type AFDProfilesClientBeginUpgradeOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -187,20 +184,20 @@ type AFDProfilesClientValidateSecretOptions struct { // CustomDomainsClientBeginCreateOptions contains the optional parameters for the CustomDomainsClient.BeginCreate method. type CustomDomainsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CustomDomainsClientBeginDeleteOptions contains the optional parameters for the CustomDomainsClient.BeginDelete method. type CustomDomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CustomDomainsClientBeginDisableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.BeginDisableCustomHTTPS // method. type CustomDomainsClientBeginDisableCustomHTTPSOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -212,7 +209,7 @@ type CustomDomainsClientBeginEnableCustomHTTPSOptions struct { // default. CustomDomainHTTPSParameters CustomDomainHTTPSParametersClassification - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -234,43 +231,43 @@ type EdgeNodesClientListOptions struct { // EndpointsClientBeginCreateOptions contains the optional parameters for the EndpointsClient.BeginCreate method. type EndpointsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // EndpointsClientBeginDeleteOptions contains the optional parameters for the EndpointsClient.BeginDelete method. type EndpointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // EndpointsClientBeginLoadContentOptions contains the optional parameters for the EndpointsClient.BeginLoadContent method. type EndpointsClientBeginLoadContentOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // EndpointsClientBeginPurgeContentOptions contains the optional parameters for the EndpointsClient.BeginPurgeContent method. type EndpointsClientBeginPurgeContentOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // EndpointsClientBeginStartOptions contains the optional parameters for the EndpointsClient.BeginStart method. type EndpointsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // EndpointsClientBeginStopOptions contains the optional parameters for the EndpointsClient.BeginStop method. type EndpointsClientBeginStopOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // EndpointsClientBeginUpdateOptions contains the optional parameters for the EndpointsClient.BeginUpdate method. type EndpointsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -372,19 +369,19 @@ type OperationsClientListOptions struct { // OriginGroupsClientBeginCreateOptions contains the optional parameters for the OriginGroupsClient.BeginCreate method. type OriginGroupsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // OriginGroupsClientBeginDeleteOptions contains the optional parameters for the OriginGroupsClient.BeginDelete method. type OriginGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // OriginGroupsClientBeginUpdateOptions contains the optional parameters for the OriginGroupsClient.BeginUpdate method. type OriginGroupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -401,19 +398,19 @@ type OriginGroupsClientListByEndpointOptions struct { // OriginsClientBeginCreateOptions contains the optional parameters for the OriginsClient.BeginCreate method. type OriginsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // OriginsClientBeginDeleteOptions contains the optional parameters for the OriginsClient.BeginDelete method. type OriginsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // OriginsClientBeginUpdateOptions contains the optional parameters for the OriginsClient.BeginUpdate method. type OriginsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -429,13 +426,13 @@ type OriginsClientListByEndpointOptions struct { // PoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdate method. type PoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // PoliciesClientBeginUpdateOptions contains the optional parameters for the PoliciesClient.BeginUpdate method. type PoliciesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -456,38 +453,58 @@ type PoliciesClientListOptions struct { // ProfilesClientBeginCanMigrateOptions contains the optional parameters for the ProfilesClient.BeginCanMigrate method. type ProfilesClientBeginCanMigrateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ProfilesClientBeginCdnCanMigrateToAfdOptions contains the optional parameters for the ProfilesClient.BeginCdnCanMigrateToAfd +// method. +type ProfilesClientBeginCdnCanMigrateToAfdOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ProfilesClientBeginCdnMigrateToAfdOptions contains the optional parameters for the ProfilesClient.BeginCdnMigrateToAfd +// method. +type ProfilesClientBeginCdnMigrateToAfdOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } // ProfilesClientBeginCreateOptions contains the optional parameters for the ProfilesClient.BeginCreate method. type ProfilesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. type ProfilesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ProfilesClientBeginMigrateOptions contains the optional parameters for the ProfilesClient.BeginMigrate method. type ProfilesClientBeginMigrateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// ProfilesClientBeginMigrationAbortOptions contains the optional parameters for the ProfilesClient.BeginMigrationAbort method. +type ProfilesClientBeginMigrationAbortOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } // ProfilesClientBeginMigrationCommitOptions contains the optional parameters for the ProfilesClient.BeginMigrationCommit // method. type ProfilesClientBeginMigrationCommitOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ProfilesClientBeginUpdateOptions contains the optional parameters for the ProfilesClient.BeginUpdate method. type ProfilesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -531,19 +548,19 @@ type ResourceUsageClientListOptions struct { // RoutesClientBeginCreateOptions contains the optional parameters for the RoutesClient.BeginCreate method. type RoutesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. type RoutesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RoutesClientBeginUpdateOptions contains the optional parameters for the RoutesClient.BeginUpdate method. type RoutesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -559,7 +576,7 @@ type RoutesClientListByEndpointOptions struct { // RuleSetsClientBeginDeleteOptions contains the optional parameters for the RuleSetsClient.BeginDelete method. type RuleSetsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -586,19 +603,19 @@ type RuleSetsClientListResourceUsageOptions struct { // RulesClientBeginCreateOptions contains the optional parameters for the RulesClient.BeginCreate method. type RulesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RulesClientBeginDeleteOptions contains the optional parameters for the RulesClient.BeginDelete method. type RulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // RulesClientBeginUpdateOptions contains the optional parameters for the RulesClient.BeginUpdate method. type RulesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -614,13 +631,13 @@ type RulesClientListByRuleSetOptions struct { // SecretsClientBeginCreateOptions contains the optional parameters for the SecretsClient.BeginCreate method. type SecretsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SecretsClientBeginDeleteOptions contains the optional parameters for the SecretsClient.BeginDelete method. type SecretsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -636,19 +653,19 @@ type SecretsClientListByProfileOptions struct { // SecurityPoliciesClientBeginCreateOptions contains the optional parameters for the SecurityPoliciesClient.BeginCreate method. type SecurityPoliciesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SecurityPoliciesClientBeginDeleteOptions contains the optional parameters for the SecurityPoliciesClient.BeginDelete method. type SecurityPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SecurityPoliciesClientBeginPatchOptions contains the optional parameters for the SecurityPoliciesClient.BeginPatch method. type SecurityPoliciesClientBeginPatchOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/cdn/armcdn/origingroups_client.go b/sdk/resourcemanager/cdn/armcdn/origingroups_client.go index c8943e2c27c7..2cb760fe044c 100644 --- a/sdk/resourcemanager/cdn/armcdn/origingroups_client.go +++ b/sdk/resourcemanager/cdn/armcdn/origingroups_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewOriginGroupsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Creates a new origin group within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -74,7 +71,7 @@ func (client *OriginGroupsClient) BeginCreate(ctx context.Context, resourceGroup // Create - Creates a new origin group within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *OriginGroupsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroup OriginGroup, options *OriginGroupsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "OriginGroupsClient.BeginCreate" @@ -97,7 +94,7 @@ func (client *OriginGroupsClient) create(ctx context.Context, resourceGroupName } // createCreateRequest creates the Create request. -func (client *OriginGroupsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroup OriginGroup, options *OriginGroupsClientBeginCreateOptions) (*policy.Request, error) { +func (client *OriginGroupsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroup OriginGroup, _ *OriginGroupsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -124,7 +121,7 @@ func (client *OriginGroupsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, originGroup); err != nil { @@ -136,7 +133,7 @@ func (client *OriginGroupsClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Deletes an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -163,7 +160,7 @@ func (client *OriginGroupsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *OriginGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, options *OriginGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "OriginGroupsClient.BeginDelete" @@ -186,7 +183,7 @@ func (client *OriginGroupsClient) deleteOperation(ctx context.Context, resourceG } // deleteCreateRequest creates the Delete request. -func (client *OriginGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, options *OriginGroupsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *OriginGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, _ *OriginGroupsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -213,7 +210,7 @@ func (client *OriginGroupsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -222,7 +219,7 @@ func (client *OriginGroupsClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -251,7 +248,7 @@ func (client *OriginGroupsClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *OriginGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, options *OriginGroupsClientGetOptions) (*policy.Request, error) { +func (client *OriginGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, _ *OriginGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -278,7 +275,7 @@ func (client *OriginGroupsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -295,7 +292,7 @@ func (client *OriginGroupsClient) getHandleResponse(resp *http.Response) (Origin // NewListByEndpointPager - Lists all of the existing origin groups within an endpoint. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -325,7 +322,7 @@ func (client *OriginGroupsClient) NewListByEndpointPager(resourceGroupName strin } // listByEndpointCreateRequest creates the ListByEndpoint request. -func (client *OriginGroupsClient) listByEndpointCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *OriginGroupsClientListByEndpointOptions) (*policy.Request, error) { +func (client *OriginGroupsClient) listByEndpointCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *OriginGroupsClientListByEndpointOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -348,7 +345,7 @@ func (client *OriginGroupsClient) listByEndpointCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -366,7 +363,7 @@ func (client *OriginGroupsClient) listByEndpointHandleResponse(resp *http.Respon // BeginUpdate - Updates an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -394,7 +391,7 @@ func (client *OriginGroupsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Updates an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *OriginGroupsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroupUpdateProperties OriginGroupUpdateParameters, options *OriginGroupsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "OriginGroupsClient.BeginUpdate" @@ -417,7 +414,7 @@ func (client *OriginGroupsClient) update(ctx context.Context, resourceGroupName } // updateCreateRequest creates the Update request. -func (client *OriginGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroupUpdateProperties OriginGroupUpdateParameters, options *OriginGroupsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *OriginGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroupUpdateProperties OriginGroupUpdateParameters, _ *OriginGroupsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -444,7 +441,7 @@ func (client *OriginGroupsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, originGroupUpdateProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/origingroups_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/origingroups_client_example_test.go deleted file mode 100644 index 66b9b152a64d..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/origingroups_client_example_test.go +++ /dev/null @@ -1,259 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/OriginGroups_ListByEndpoint.json -func ExampleOriginGroupsClient_NewListByEndpointPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOriginGroupsClient().NewListByEndpointPager("RG", "profile1", "endpoint1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OriginGroupListResult = armcdn.OriginGroupListResult{ - // Value: []*armcdn.OriginGroup{ - // { - // Name: to.Ptr("origingroup1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/origingroups"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1"), - // Properties: &armcdn.OriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](120), - // ProbePath: to.Ptr("/health.aspx"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - // }, - // Origins: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"), - // }}, - // ResponseBasedOriginErrorDetectionSettings: &armcdn.ResponseBasedOriginErrorDetectionParameters{ - // ResponseBasedDetectedErrorTypes: to.Ptr(armcdn.ResponseBasedDetectedErrorTypesTCPErrorsOnly), - // ResponseBasedFailoverThresholdPercentage: to.Ptr[int32](10), - // }, - // ProvisioningState: to.Ptr(armcdn.OriginGroupProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.OriginGroupResourceStateActive), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/OriginGroups_Get.json -func ExampleOriginGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOriginGroupsClient().Get(ctx, "RG", "profile1", "endpoint1", "originGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OriginGroup = armcdn.OriginGroup{ - // Name: to.Ptr("origingroup1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/origingroups"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1"), - // Properties: &armcdn.OriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](120), - // ProbePath: to.Ptr("/health.aspx"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - // }, - // Origins: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"), - // }}, - // ResponseBasedOriginErrorDetectionSettings: &armcdn.ResponseBasedOriginErrorDetectionParameters{ - // HTTPErrorRanges: []*armcdn.HTTPErrorRangeParameters{ - // { - // Begin: to.Ptr[int32](500), - // End: to.Ptr[int32](505), - // }}, - // ResponseBasedDetectedErrorTypes: to.Ptr(armcdn.ResponseBasedDetectedErrorTypesTCPAndHTTPErrors), - // ResponseBasedFailoverThresholdPercentage: to.Ptr[int32](10), - // }, - // ProvisioningState: to.Ptr(armcdn.OriginGroupProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.OriginGroupResourceStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/OriginGroups_Create.json -func ExampleOriginGroupsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOriginGroupsClient().BeginCreate(ctx, "RG", "profile1", "endpoint1", "origingroup1", armcdn.OriginGroup{ - Properties: &armcdn.OriginGroupProperties{ - HealthProbeSettings: &armcdn.HealthProbeParameters{ - ProbeIntervalInSeconds: to.Ptr[int32](120), - ProbePath: to.Ptr("/health.aspx"), - ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - }, - Origins: []*armcdn.ResourceReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"), - }}, - ResponseBasedOriginErrorDetectionSettings: &armcdn.ResponseBasedOriginErrorDetectionParameters{ - ResponseBasedDetectedErrorTypes: to.Ptr(armcdn.ResponseBasedDetectedErrorTypesTCPErrorsOnly), - ResponseBasedFailoverThresholdPercentage: to.Ptr[int32](10), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OriginGroup = armcdn.OriginGroup{ - // Name: to.Ptr("origingroup1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/origingroups"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/originGroups/originGroup1"), - // Properties: &armcdn.OriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](120), - // ProbePath: to.Ptr("/health.aspx"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - // }, - // Origins: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin1"), - // }}, - // ResponseBasedOriginErrorDetectionSettings: &armcdn.ResponseBasedOriginErrorDetectionParameters{ - // ResponseBasedDetectedErrorTypes: to.Ptr(armcdn.ResponseBasedDetectedErrorTypesTCPErrorsOnly), - // ResponseBasedFailoverThresholdPercentage: to.Ptr[int32](10), - // }, - // ProvisioningState: to.Ptr(armcdn.OriginGroupProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.OriginGroupResourceStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/OriginGroups_Update.json -func ExampleOriginGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOriginGroupsClient().BeginUpdate(ctx, "RG", "profile1", "endpoint1", "originGroup1", armcdn.OriginGroupUpdateParameters{ - Properties: &armcdn.OriginGroupUpdatePropertiesParameters{ - HealthProbeSettings: &armcdn.HealthProbeParameters{ - ProbeIntervalInSeconds: to.Ptr[int32](120), - ProbePath: to.Ptr("/health.aspx"), - ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - }, - Origins: []*armcdn.ResourceReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OriginGroup = armcdn.OriginGroup{ - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/origins"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/www-someDomain-net"), - // Properties: &armcdn.OriginGroupProperties{ - // HealthProbeSettings: &armcdn.HealthProbeParameters{ - // ProbeIntervalInSeconds: to.Ptr[int32](120), - // ProbePath: to.Ptr("/health.aspx"), - // ProbeProtocol: to.Ptr(armcdn.ProbeProtocolHTTP), - // ProbeRequestType: to.Ptr(armcdn.HealthProbeRequestTypeGET), - // }, - // Origins: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/origin2"), - // }}, - // ProvisioningState: to.Ptr(armcdn.OriginGroupProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.OriginGroupResourceStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/OriginGroups_Delete.json -func ExampleOriginGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOriginGroupsClient().BeginDelete(ctx, "RG", "profile1", "endpoint1", "originGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/origins_client.go b/sdk/resourcemanager/cdn/armcdn/origins_client.go index 028f0936fe2e..cf8513ba7925 100644 --- a/sdk/resourcemanager/cdn/armcdn/origins_client.go +++ b/sdk/resourcemanager/cdn/armcdn/origins_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewOriginsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new origin within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -73,7 +70,7 @@ func (client *OriginsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new origin within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *OriginsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, origin Origin, options *OriginsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "OriginsClient.BeginCreate" @@ -96,7 +93,7 @@ func (client *OriginsClient) create(ctx context.Context, resourceGroupName strin } // createCreateRequest creates the Create request. -func (client *OriginsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, origin Origin, options *OriginsClientBeginCreateOptions) (*policy.Request, error) { +func (client *OriginsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, origin Origin, _ *OriginsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -123,7 +120,7 @@ func (client *OriginsClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, origin); err != nil { @@ -135,7 +132,7 @@ func (client *OriginsClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -161,7 +158,7 @@ func (client *OriginsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *OriginsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, options *OriginsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "OriginsClient.BeginDelete" @@ -184,7 +181,7 @@ func (client *OriginsClient) deleteOperation(ctx context.Context, resourceGroupN } // deleteCreateRequest creates the Delete request. -func (client *OriginsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, options *OriginsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *OriginsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, _ *OriginsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -211,7 +208,7 @@ func (client *OriginsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,7 +217,7 @@ func (client *OriginsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -249,7 +246,7 @@ func (client *OriginsClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *OriginsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, options *OriginsClientGetOptions) (*policy.Request, error) { +func (client *OriginsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, _ *OriginsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -276,7 +273,7 @@ func (client *OriginsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,7 +290,7 @@ func (client *OriginsClient) getHandleResponse(resp *http.Response) (OriginsClie // NewListByEndpointPager - Lists all of the existing origins within an endpoint. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -323,7 +320,7 @@ func (client *OriginsClient) NewListByEndpointPager(resourceGroupName string, pr } // listByEndpointCreateRequest creates the ListByEndpoint request. -func (client *OriginsClient) listByEndpointCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *OriginsClientListByEndpointOptions) (*policy.Request, error) { +func (client *OriginsClient) listByEndpointCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *OriginsClientListByEndpointOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -346,7 +343,7 @@ func (client *OriginsClient) listByEndpointCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +361,7 @@ func (client *OriginsClient) listByEndpointHandleResponse(resp *http.Response) ( // BeginUpdate - Updates an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -391,7 +388,7 @@ func (client *OriginsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *OriginsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters, options *OriginsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "OriginsClient.BeginUpdate" @@ -414,7 +411,7 @@ func (client *OriginsClient) update(ctx context.Context, resourceGroupName strin } // updateCreateRequest creates the Update request. -func (client *OriginsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters, options *OriginsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *OriginsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters, _ *OriginsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -441,7 +438,7 @@ func (client *OriginsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, originUpdateProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/origins_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/origins_client_example_test.go deleted file mode 100644 index 274bbcb2e5fa..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/origins_client_example_test.go +++ /dev/null @@ -1,232 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Origins_ListByEndpoint.json -func ExampleOriginsClient_NewListByEndpointPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOriginsClient().NewListByEndpointPager("RG", "profile1", "endpoint1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OriginListResult = armcdn.OriginListResult{ - // Value: []*armcdn.Origin{ - // { - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/origins"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/www-someDomain-net"), - // Properties: &armcdn.OriginProperties{ - // Enabled: to.Ptr(true), - // HostName: to.Ptr("www.someDomain.net"), - // OriginHostHeader: to.Ptr("www.someDomain.net"), - // Priority: to.Ptr[int32](1), - // PrivateLinkAlias: to.Ptr("APPSERVER.d84e61f0-0870-4d24-9746-7438fa0019d1.westus2.azure.privatelinkservice"), - // PrivateLinkApprovalMessage: to.Ptr("Please approve the connection request for this Private Link"), - // Weight: to.Ptr[int32](50), - // PrivateEndpointStatus: to.Ptr(armcdn.PrivateEndpointStatusPending), - // ProvisioningState: to.Ptr(armcdn.OriginProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.OriginResourceStateActive), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Origins_Get.json -func ExampleOriginsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOriginsClient().Get(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Origin = armcdn.Origin{ - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/origins"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/www-someDomain-net"), - // Properties: &armcdn.OriginProperties{ - // Enabled: to.Ptr(true), - // HostName: to.Ptr("www.someDomain.net"), - // OriginHostHeader: to.Ptr("www.someDomain.net"), - // Priority: to.Ptr[int32](1), - // PrivateLinkAlias: to.Ptr("APPSERVER.d84e61f0-0870-4d24-9746-7438fa0019d1.westus2.azure.privatelinkservice"), - // PrivateLinkApprovalMessage: to.Ptr("Please approve the connection request for this Private Link"), - // Weight: to.Ptr[int32](50), - // PrivateEndpointStatus: to.Ptr(armcdn.PrivateEndpointStatusPending), - // ProvisioningState: to.Ptr(armcdn.OriginProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.OriginResourceStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Origins_Create.json -func ExampleOriginsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOriginsClient().BeginCreate(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", armcdn.Origin{ - Properties: &armcdn.OriginProperties{ - Enabled: to.Ptr(true), - HostName: to.Ptr("www.someDomain.net"), - HTTPPort: to.Ptr[int32](80), - HTTPSPort: to.Ptr[int32](443), - OriginHostHeader: to.Ptr("www.someDomain.net"), - Priority: to.Ptr[int32](1), - PrivateLinkApprovalMessage: to.Ptr("Please approve the connection request for this Private Link"), - PrivateLinkLocation: to.Ptr("eastus"), - PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Network/privateLinkServices/pls1"), - Weight: to.Ptr[int32](50), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Origin = armcdn.Origin{ - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/origins"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/www-someDomain-net"), - // Properties: &armcdn.OriginProperties{ - // Enabled: to.Ptr(true), - // HostName: to.Ptr("www.someDomain.net"), - // HTTPPort: to.Ptr[int32](80), - // HTTPSPort: to.Ptr[int32](443), - // OriginHostHeader: to.Ptr("www.someDomain.net"), - // Priority: to.Ptr[int32](1), - // PrivateLinkApprovalMessage: to.Ptr("Please approve the connection request for this Private Link"), - // PrivateLinkLocation: to.Ptr("eastus"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Network/privateLinkServices/pls1"), - // Weight: to.Ptr[int32](50), - // PrivateEndpointStatus: to.Ptr(armcdn.PrivateEndpointStatusPending), - // ProvisioningState: to.Ptr(armcdn.OriginProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.OriginResourceStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Origins_Update.json -func ExampleOriginsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOriginsClient().BeginUpdate(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", armcdn.OriginUpdateParameters{ - Properties: &armcdn.OriginUpdatePropertiesParameters{ - Enabled: to.Ptr(true), - HTTPPort: to.Ptr[int32](42), - HTTPSPort: to.Ptr[int32](43), - OriginHostHeader: to.Ptr("www.someDomain2.net"), - Priority: to.Ptr[int32](1), - PrivateLinkAlias: to.Ptr("APPSERVER.d84e61f0-0870-4d24-9746-7438fa0019d1.westus2.azure.privatelinkservice"), - Weight: to.Ptr[int32](50), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Origin = armcdn.Origin{ - // Name: to.Ptr("www-someDomain-net"), - // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/origins"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/origins/www-someDomain-net"), - // Properties: &armcdn.OriginProperties{ - // Enabled: to.Ptr(true), - // HostName: to.Ptr("www.someDomain.net"), - // HTTPPort: to.Ptr[int32](42), - // HTTPSPort: to.Ptr[int32](43), - // OriginHostHeader: to.Ptr("www.someDomain2.net"), - // Priority: to.Ptr[int32](1), - // PrivateLinkAlias: to.Ptr("APPSERVER.d84e61f0-0870-4d24-9746-7438fa0019d1.westus2.azure.privatelinkservice"), - // PrivateLinkApprovalMessage: to.Ptr("Please approve the connection request for this Private Link"), - // Weight: to.Ptr[int32](50), - // PrivateEndpointStatus: to.Ptr(armcdn.PrivateEndpointStatusPending), - // ProvisioningState: to.Ptr(armcdn.OriginProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.OriginResourceStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Origins_Delete.json -func ExampleOriginsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewOriginsClient().BeginDelete(ctx, "RG", "profile1", "endpoint1", "origin1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/policies_client.go b/sdk/resourcemanager/cdn/armcdn/policies_client.go index b45759b15446..64505b8368e1 100644 --- a/sdk/resourcemanager/cdn/armcdn/policies_client.go +++ b/sdk/resourcemanager/cdn/armcdn/policies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewPoliciesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update policy with specified rule set name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - cdnWebApplicationFirewallPolicy - Policy to be created. @@ -72,7 +69,7 @@ func (client *PoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update policy with specified rule set name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *PoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicy WebApplicationFirewallPolicy, options *PoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PoliciesClient.BeginCreateOrUpdate" @@ -95,7 +92,7 @@ func (client *PoliciesClient) createOrUpdate(ctx context.Context, resourceGroupN } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicy WebApplicationFirewallPolicy, options *PoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *PoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicy WebApplicationFirewallPolicy, _ *PoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -114,7 +111,7 @@ func (client *PoliciesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cdnWebApplicationFirewallPolicy); err != nil { @@ -126,7 +123,7 @@ func (client *PoliciesClient) createOrUpdateCreateRequest(ctx context.Context, r // Delete - Deletes Policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - options - PoliciesClientDeleteOptions contains the optional parameters for the PoliciesClient.Delete method. @@ -152,7 +149,7 @@ func (client *PoliciesClient) Delete(ctx context.Context, resourceGroupName stri } // deleteCreateRequest creates the Delete request. -func (client *PoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, policyName string, options *PoliciesClientDeleteOptions) (*policy.Request, error) { +func (client *PoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, policyName string, _ *PoliciesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -171,7 +168,7 @@ func (client *PoliciesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +177,7 @@ func (client *PoliciesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Retrieve protection policy with specified name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - options - PoliciesClientGetOptions contains the optional parameters for the PoliciesClient.Get method. @@ -207,7 +204,7 @@ func (client *PoliciesClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *PoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, policyName string, options *PoliciesClientGetOptions) (*policy.Request, error) { +func (client *PoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, policyName string, _ *PoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -226,7 +223,7 @@ func (client *PoliciesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,7 +240,7 @@ func (client *PoliciesClient) getHandleResponse(resp *http.Response) (PoliciesCl // NewListPager - Lists all of the protection policies within a resource group. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - options - PoliciesClientListOptions contains the optional parameters for the PoliciesClient.NewListPager method. func (client *PoliciesClient) NewListPager(resourceGroupName string, options *PoliciesClientListOptions) *runtime.Pager[PoliciesClientListResponse] { @@ -270,7 +267,7 @@ func (client *PoliciesClient) NewListPager(resourceGroupName string, options *Po } // listCreateRequest creates the List request. -func (client *PoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *PoliciesClientListOptions) (*policy.Request, error) { +func (client *PoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, _ *PoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -285,7 +282,7 @@ func (client *PoliciesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +301,7 @@ func (client *PoliciesClient) listHandleResponse(resp *http.Response) (PoliciesC // and resource group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - cdnWebApplicationFirewallPolicyPatchParameters - CdnWebApplicationFirewallPolicy parameters to be patched. @@ -330,7 +327,7 @@ func (client *PoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName // and resource group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *PoliciesClient) update(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicyPatchParameters WebApplicationFirewallPolicyPatchParameters, options *PoliciesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PoliciesClient.BeginUpdate" @@ -353,7 +350,7 @@ func (client *PoliciesClient) update(ctx context.Context, resourceGroupName stri } // updateCreateRequest creates the Update request. -func (client *PoliciesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicyPatchParameters WebApplicationFirewallPolicyPatchParameters, options *PoliciesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *PoliciesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicyPatchParameters WebApplicationFirewallPolicyPatchParameters, _ *PoliciesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/cdnWebApplicationFirewallPolicies/{policyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -372,7 +369,7 @@ func (client *PoliciesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cdnWebApplicationFirewallPolicyPatchParameters); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/policies_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/policies_client_example_test.go deleted file mode 100644 index 4e97e2b73347..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/policies_client_example_test.go +++ /dev/null @@ -1,798 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/WafListPolicies.json -func ExamplePoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPoliciesClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WebApplicationFirewallPolicyList = armcdn.WebApplicationFirewallPolicyList{ - // Value: []*armcdn.WebApplicationFirewallPolicy{ - // { - // Name: to.Ptr("MicrosoftCdnWafPolicy"), - // Type: to.Ptr("Microsoft.Cdn/cdnwebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/CdnWebApplicationFirewallPolicies/MicrosoftCdnWafPolicy"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armcdn.WebApplicationFirewallPolicyProperties{ - // CustomRules: &armcdn.CustomRuleList{ - // Rules: []*armcdn.CustomRule{ - // { - // Name: to.Ptr("CustomRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("CH")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorGeoMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }, - // { - // MatchValue: []*string{ - // to.Ptr("windows")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRequestHeader), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("UserAgent"), - // Transforms: []*armcdn.TransformType{ - // }, - // }, - // { - // MatchValue: []*string{ - // to.Ptr("")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableQueryString), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("search"), - // Transforms: []*armcdn.TransformType{ - // to.Ptr(armcdn.TransformTypeURLDecode), - // to.Ptr(armcdn.TransformTypeLowercase)}, - // }}, - // Priority: to.Ptr[int32](2), - // }}, - // }, - // EndpointLinks: []*armcdn.LinkedEndpoint{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/profiles/profile1/endpoints/testEndpoint1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/profiles/profile1/endpoints/testEndpoint2"), - // }}, - // ManagedRules: &armcdn.ManagedRuleSetList{ - // ManagedRuleSets: []*armcdn.ManagedRuleSet{ - // { - // RuleGroupOverrides: []*armcdn.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("Group1"), - // Rules: []*armcdn.ManagedRuleOverride{ - // { - // Action: to.Ptr(armcdn.ActionTypeRedirect), - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateEnabled), - // RuleID: to.Ptr("GROUP1-0001"), - // }, - // { - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateDisabled), - // RuleID: to.Ptr("GROUP1-0002"), - // }}, - // }}, - // RuleSetType: to.Ptr("DefaultRuleSet"), - // RuleSetVersion: to.Ptr("preview-1.0"), - // }}, - // }, - // PolicySettings: &armcdn.PolicySettings{ - // DefaultCustomBlockResponseBody: to.Ptr("PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=="), - // DefaultCustomBlockResponseStatusCode: to.Ptr(armcdn.PolicySettingsDefaultCustomBlockResponseStatusCode(429)), - // DefaultRedirectURL: to.Ptr("http://www.bing.com"), - // EnabledState: to.Ptr(armcdn.PolicyEnabledStateEnabled), - // Mode: to.Ptr(armcdn.PolicyModePrevention), - // }, - // ProvisioningState: to.Ptr(armcdn.ProvisioningStateSucceeded), - // RateLimitRules: &armcdn.RateLimitRuleList{ - // Rules: []*armcdn.RateLimitRule{ - // { - // Name: to.Ptr("RateLimitRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorIPMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RateLimitDurationInMinutes: to.Ptr[int32](0), - // RateLimitThreshold: to.Ptr[int32](1000), - // }}, - // }, - // ResourceState: to.Ptr(armcdn.PolicyResourceStateEnabled), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNameStandardMicrosoft), - // }, - // }, - // { - // Name: to.Ptr("VerizonStandardCdnWafPolicy"), - // Type: to.Ptr("Microsoft.Cdn/cdnwebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/CdnWebApplicationFirewallPolicies/VerizonStandardCdnWafPolicy"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armcdn.WebApplicationFirewallPolicyProperties{ - // CustomRules: &armcdn.CustomRuleList{ - // Rules: []*armcdn.CustomRule{ - // { - // Name: to.Ptr("CustomRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("CH")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorGeoMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }, - // { - // MatchValue: []*string{ - // to.Ptr("windows")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRequestHeader), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("UserAgent"), - // }, - // { - // MatchValue: []*string{ - // to.Ptr("")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableQueryString), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("search"), - // Transforms: []*armcdn.TransformType{ - // to.Ptr(armcdn.TransformTypeURLDecode), - // to.Ptr(armcdn.TransformTypeLowercase)}, - // }}, - // Priority: to.Ptr[int32](2), - // }}, - // }, - // EndpointLinks: []*armcdn.LinkedEndpoint{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/profiles/profile1/endpoints/testEndpoint3"), - // }}, - // ManagedRules: &armcdn.ManagedRuleSetList{ - // ManagedRuleSets: []*armcdn.ManagedRuleSet{ - // { - // RuleGroupOverrides: []*armcdn.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("XSS"), - // Rules: []*armcdn.ManagedRuleOverride{ - // { - // Action: to.Ptr(armcdn.ActionTypeRedirect), - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateEnabled), - // RuleID: to.Ptr("XSS-0001"), - // }, - // { - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateDisabled), - // RuleID: to.Ptr("XSS-0002"), - // }}, - // }}, - // RuleSetType: to.Ptr("ECRS"), - // RuleSetVersion: to.Ptr("2018-11-2"), - // }}, - // }, - // PolicySettings: &armcdn.PolicySettings{ - // DefaultCustomBlockResponseBody: to.Ptr("PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=="), - // DefaultCustomBlockResponseStatusCode: to.Ptr(armcdn.PolicySettingsDefaultCustomBlockResponseStatusCode(429)), - // DefaultRedirectURL: to.Ptr("http://www.bing.com"), - // EnabledState: to.Ptr(armcdn.PolicyEnabledStateEnabled), - // Mode: to.Ptr(armcdn.PolicyModePrevention), - // }, - // ProvisioningState: to.Ptr(armcdn.ProvisioningStateSucceeded), - // RateLimitRules: &armcdn.RateLimitRuleList{ - // Rules: []*armcdn.RateLimitRule{ - // { - // Name: to.Ptr("RateLimitRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorIPMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RateLimitDurationInMinutes: to.Ptr[int32](0), - // RateLimitThreshold: to.Ptr[int32](1000), - // }}, - // }, - // ResourceState: to.Ptr(armcdn.PolicyResourceStateEnabled), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNameStandardVerizon), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/WafPolicyGet.json -func ExamplePoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoliciesClient().Get(ctx, "rg1", "MicrosoftCdnWafPolicy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WebApplicationFirewallPolicy = armcdn.WebApplicationFirewallPolicy{ - // Name: to.Ptr("MicrosoftCdnWafPolicy"), - // Type: to.Ptr("Microsoft.Cdn/cdnwebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/CdnWebApplicationFirewallPolicies/MicrosoftCdnWafPolicy"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armcdn.WebApplicationFirewallPolicyProperties{ - // CustomRules: &armcdn.CustomRuleList{ - // Rules: []*armcdn.CustomRule{ - // { - // Name: to.Ptr("CustomRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("CH")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorGeoMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }, - // { - // MatchValue: []*string{ - // to.Ptr("windows")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRequestHeader), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("UserAgent"), - // Transforms: []*armcdn.TransformType{ - // }, - // }, - // { - // MatchValue: []*string{ - // to.Ptr("")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableQueryString), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("search"), - // Transforms: []*armcdn.TransformType{ - // to.Ptr(armcdn.TransformTypeURLDecode), - // to.Ptr(armcdn.TransformTypeLowercase)}, - // }}, - // Priority: to.Ptr[int32](2), - // }}, - // }, - // EndpointLinks: []*armcdn.LinkedEndpoint{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/profiles/profile1/endpoints/testEndpoint1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/profiles/profile1/endpoints/testEndpoint2"), - // }}, - // ManagedRules: &armcdn.ManagedRuleSetList{ - // ManagedRuleSets: []*armcdn.ManagedRuleSet{ - // { - // RuleGroupOverrides: []*armcdn.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("Group1"), - // Rules: []*armcdn.ManagedRuleOverride{ - // { - // Action: to.Ptr(armcdn.ActionTypeRedirect), - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateEnabled), - // RuleID: to.Ptr("GROUP1-0001"), - // }, - // { - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateDisabled), - // RuleID: to.Ptr("GROUP1-0002"), - // }}, - // }}, - // RuleSetType: to.Ptr("DefaultRuleSet"), - // RuleSetVersion: to.Ptr("preview-1.0"), - // }}, - // }, - // PolicySettings: &armcdn.PolicySettings{ - // DefaultCustomBlockResponseBody: to.Ptr("PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=="), - // DefaultCustomBlockResponseStatusCode: to.Ptr(armcdn.PolicySettingsDefaultCustomBlockResponseStatusCode(429)), - // DefaultRedirectURL: to.Ptr("http://www.bing.com"), - // EnabledState: to.Ptr(armcdn.PolicyEnabledStateEnabled), - // Mode: to.Ptr(armcdn.PolicyModePrevention), - // }, - // ProvisioningState: to.Ptr(armcdn.ProvisioningStateSucceeded), - // RateLimitRules: &armcdn.RateLimitRuleList{ - // Rules: []*armcdn.RateLimitRule{ - // { - // Name: to.Ptr("RateLimitRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorIPMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RateLimitDurationInMinutes: to.Ptr[int32](0), - // RateLimitThreshold: to.Ptr[int32](1000), - // }}, - // }, - // ResourceState: to.Ptr(armcdn.PolicyResourceStateEnabled), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNameStandardMicrosoft), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/WafPolicyCreateOrUpdate.json -func ExamplePoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "MicrosoftCdnWafPolicy", armcdn.WebApplicationFirewallPolicy{ - Location: to.Ptr("WestUs"), - Properties: &armcdn.WebApplicationFirewallPolicyProperties{ - CustomRules: &armcdn.CustomRuleList{ - Rules: []*armcdn.CustomRule{ - { - Name: to.Ptr("CustomRule1"), - Action: to.Ptr(armcdn.ActionTypeBlock), - EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - MatchConditions: []*armcdn.MatchCondition{ - { - MatchValue: []*string{ - to.Ptr("CH")}, - MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - NegateCondition: to.Ptr(false), - Operator: to.Ptr(armcdn.OperatorGeoMatch), - Transforms: []*armcdn.TransformType{}, - }, - { - MatchValue: []*string{ - to.Ptr("windows")}, - MatchVariable: to.Ptr(armcdn.WafMatchVariableRequestHeader), - NegateCondition: to.Ptr(false), - Operator: to.Ptr(armcdn.OperatorContains), - Selector: to.Ptr("UserAgent"), - Transforms: []*armcdn.TransformType{}, - }, - { - MatchValue: []*string{ - to.Ptr("")}, - MatchVariable: to.Ptr(armcdn.WafMatchVariableQueryString), - NegateCondition: to.Ptr(false), - Operator: to.Ptr(armcdn.OperatorContains), - Selector: to.Ptr("search"), - Transforms: []*armcdn.TransformType{ - to.Ptr(armcdn.TransformTypeURLDecode), - to.Ptr(armcdn.TransformTypeLowercase)}, - }}, - Priority: to.Ptr[int32](2), - }}, - }, - ManagedRules: &armcdn.ManagedRuleSetList{ - ManagedRuleSets: []*armcdn.ManagedRuleSet{ - { - RuleGroupOverrides: []*armcdn.ManagedRuleGroupOverride{ - { - RuleGroupName: to.Ptr("Group1"), - Rules: []*armcdn.ManagedRuleOverride{ - { - Action: to.Ptr(armcdn.ActionTypeRedirect), - EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateEnabled), - RuleID: to.Ptr("GROUP1-0001"), - }, - { - EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateDisabled), - RuleID: to.Ptr("GROUP1-0002"), - }}, - }}, - RuleSetType: to.Ptr("DefaultRuleSet"), - RuleSetVersion: to.Ptr("preview-1.0"), - }}, - }, - PolicySettings: &armcdn.PolicySettings{ - DefaultCustomBlockResponseBody: to.Ptr("PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=="), - DefaultCustomBlockResponseStatusCode: to.Ptr(armcdn.PolicySettingsDefaultCustomBlockResponseStatusCode(200)), - DefaultRedirectURL: to.Ptr("http://www.bing.com"), - }, - RateLimitRules: &armcdn.RateLimitRuleList{ - Rules: []*armcdn.RateLimitRule{ - { - Name: to.Ptr("RateLimitRule1"), - Action: to.Ptr(armcdn.ActionTypeBlock), - EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - MatchConditions: []*armcdn.MatchCondition{ - { - MatchValue: []*string{ - to.Ptr("192.168.1.0/24"), - to.Ptr("10.0.0.0/24")}, - MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - NegateCondition: to.Ptr(false), - Operator: to.Ptr(armcdn.OperatorIPMatch), - Transforms: []*armcdn.TransformType{}, - }}, - Priority: to.Ptr[int32](1), - RateLimitDurationInMinutes: to.Ptr[int32](0), - RateLimitThreshold: to.Ptr[int32](1000), - }}, - }, - }, - SKU: &armcdn.SKU{ - Name: to.Ptr(armcdn.SKUNameStandardMicrosoft), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WebApplicationFirewallPolicy = armcdn.WebApplicationFirewallPolicy{ - // Name: to.Ptr("MicrosoftCdnWafPolicy"), - // Type: to.Ptr("Microsoft.Cdn/cdnwebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/CdnWebApplicationFirewallPolicies/MicrosoftCdnWafPolicy"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Properties: &armcdn.WebApplicationFirewallPolicyProperties{ - // CustomRules: &armcdn.CustomRuleList{ - // Rules: []*armcdn.CustomRule{ - // { - // Name: to.Ptr("CustomRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("CH")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorGeoMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }, - // { - // MatchValue: []*string{ - // to.Ptr("windows")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRequestHeader), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("UserAgent"), - // Transforms: []*armcdn.TransformType{ - // }, - // }, - // { - // MatchValue: []*string{ - // to.Ptr("")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableQueryString), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("search"), - // Transforms: []*armcdn.TransformType{ - // to.Ptr(armcdn.TransformTypeURLDecode), - // to.Ptr(armcdn.TransformTypeLowercase)}, - // }}, - // Priority: to.Ptr[int32](2), - // }}, - // }, - // EndpointLinks: []*armcdn.LinkedEndpoint{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/profiles/profile1/endpoints/testEndpoint1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/profiles/profile1/endpoints/testEndpoint2"), - // }}, - // ManagedRules: &armcdn.ManagedRuleSetList{ - // ManagedRuleSets: []*armcdn.ManagedRuleSet{ - // { - // RuleGroupOverrides: []*armcdn.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("Group1"), - // Rules: []*armcdn.ManagedRuleOverride{ - // { - // Action: to.Ptr(armcdn.ActionTypeRedirect), - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateEnabled), - // RuleID: to.Ptr("GROUP1-0001"), - // }, - // { - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateDisabled), - // RuleID: to.Ptr("GROUP1-0002"), - // }}, - // }}, - // RuleSetType: to.Ptr("DefaultRuleSet"), - // RuleSetVersion: to.Ptr("preview-1.0"), - // }}, - // }, - // PolicySettings: &armcdn.PolicySettings{ - // DefaultCustomBlockResponseBody: to.Ptr("PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=="), - // DefaultCustomBlockResponseStatusCode: to.Ptr(armcdn.PolicySettingsDefaultCustomBlockResponseStatusCode(200)), - // DefaultRedirectURL: to.Ptr("http://www.bing.com"), - // EnabledState: to.Ptr(armcdn.PolicyEnabledStateEnabled), - // Mode: to.Ptr(armcdn.PolicyModePrevention), - // }, - // ProvisioningState: to.Ptr(armcdn.ProvisioningStateSucceeded), - // RateLimitRules: &armcdn.RateLimitRuleList{ - // Rules: []*armcdn.RateLimitRule{ - // { - // Name: to.Ptr("RateLimitRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorIPMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RateLimitDurationInMinutes: to.Ptr[int32](0), - // RateLimitThreshold: to.Ptr[int32](1000), - // }}, - // }, - // ResourceState: to.Ptr(armcdn.PolicyResourceStateEnabled), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNameStandardMicrosoft), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/WafPatchPolicy.json -func ExamplePoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPoliciesClient().BeginUpdate(ctx, "rg1", "MicrosoftCdnWafPolicy", armcdn.WebApplicationFirewallPolicyPatchParameters{ - Tags: map[string]*string{ - "foo": to.Ptr("bar"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WebApplicationFirewallPolicy = armcdn.WebApplicationFirewallPolicy{ - // Name: to.Ptr("MicrosoftCdnWafPolicy"), - // Type: to.Ptr("Microsoft.Cdn/cdnwebapplicationfirewallpolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/CdnWebApplicationFirewallPolicies/MicrosoftCdnWafPolicy"), - // Location: to.Ptr("WestUs"), - // Tags: map[string]*string{ - // "foo": to.Ptr("bar"), - // }, - // Properties: &armcdn.WebApplicationFirewallPolicyProperties{ - // CustomRules: &armcdn.CustomRuleList{ - // Rules: []*armcdn.CustomRule{ - // { - // Name: to.Ptr("CustomRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("CH")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorGeoMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }, - // { - // MatchValue: []*string{ - // to.Ptr("windows")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRequestHeader), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("UserAgent"), - // Transforms: []*armcdn.TransformType{ - // }, - // }, - // { - // MatchValue: []*string{ - // to.Ptr("")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableQueryString), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorContains), - // Selector: to.Ptr("search"), - // Transforms: []*armcdn.TransformType{ - // to.Ptr(armcdn.TransformTypeURLDecode), - // to.Ptr(armcdn.TransformTypeLowercase)}, - // }}, - // Priority: to.Ptr[int32](2), - // }}, - // }, - // EndpointLinks: []*armcdn.LinkedEndpoint{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/profiles/profile1/endpoints/testEndpoint1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cdn/profiles/profile1/endpoints/testEndpoint2"), - // }}, - // ManagedRules: &armcdn.ManagedRuleSetList{ - // ManagedRuleSets: []*armcdn.ManagedRuleSet{ - // { - // RuleGroupOverrides: []*armcdn.ManagedRuleGroupOverride{ - // { - // RuleGroupName: to.Ptr("Group1"), - // Rules: []*armcdn.ManagedRuleOverride{ - // { - // Action: to.Ptr(armcdn.ActionTypeRedirect), - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateEnabled), - // RuleID: to.Ptr("GROUP1-0001"), - // }, - // { - // EnabledState: to.Ptr(armcdn.ManagedRuleEnabledStateDisabled), - // RuleID: to.Ptr("GROUP1-0002"), - // }}, - // }}, - // RuleSetType: to.Ptr("DefaultRuleSet"), - // RuleSetVersion: to.Ptr("preview-1.0"), - // }}, - // }, - // PolicySettings: &armcdn.PolicySettings{ - // DefaultCustomBlockResponseBody: to.Ptr("PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=="), - // DefaultCustomBlockResponseStatusCode: to.Ptr(armcdn.PolicySettingsDefaultCustomBlockResponseStatusCode(403)), - // DefaultRedirectURL: to.Ptr("http://www.bing.com"), - // EnabledState: to.Ptr(armcdn.PolicyEnabledStateEnabled), - // Mode: to.Ptr(armcdn.PolicyModePrevention), - // }, - // ProvisioningState: to.Ptr(armcdn.ProvisioningStateSucceeded), - // RateLimitRules: &armcdn.RateLimitRuleList{ - // Rules: []*armcdn.RateLimitRule{ - // { - // Name: to.Ptr("RateLimitRule1"), - // Action: to.Ptr(armcdn.ActionTypeBlock), - // EnabledState: to.Ptr(armcdn.CustomRuleEnabledStateEnabled), - // MatchConditions: []*armcdn.MatchCondition{ - // { - // MatchValue: []*string{ - // to.Ptr("192.168.1.0/24"), - // to.Ptr("10.0.0.0/24")}, - // MatchVariable: to.Ptr(armcdn.WafMatchVariableRemoteAddr), - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.OperatorIPMatch), - // Transforms: []*armcdn.TransformType{ - // }, - // }}, - // Priority: to.Ptr[int32](1), - // RateLimitDurationInMinutes: to.Ptr[int32](0), - // RateLimitThreshold: to.Ptr[int32](1000), - // }}, - // }, - // ResourceState: to.Ptr(armcdn.PolicyResourceStateEnabled), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNameStandardMicrosoft), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/WafPolicyDelete.json -func ExamplePoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPoliciesClient().Delete(ctx, "rg1", "Policy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go b/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go index 112fa9a70a58..714980539317 100644 --- a/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go +++ b/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -33,7 +30,7 @@ func unmarshalCustomDomainHTTPSParametersClassification(rawMsg json.RawMessage) return b, nil } -func unmarshalDeliveryRuleActionAutoGeneratedClassification(rawMsg json.RawMessage) (DeliveryRuleActionAutoGeneratedClassification, error) { +func unmarshalDeliveryRuleActionClassification(rawMsg json.RawMessage) (DeliveryRuleActionClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } @@ -41,28 +38,28 @@ func unmarshalDeliveryRuleActionAutoGeneratedClassification(rawMsg json.RawMessa if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } - var b DeliveryRuleActionAutoGeneratedClassification + var b DeliveryRuleActionClassification switch m["name"] { - case string(DeliveryRuleActionCacheExpiration): + case string(DeliveryRuleActionNameCacheExpiration): b = &DeliveryRuleCacheExpirationAction{} - case string(DeliveryRuleActionCacheKeyQueryString): + case string(DeliveryRuleActionNameCacheKeyQueryString): b = &DeliveryRuleCacheKeyQueryStringAction{} - case string(DeliveryRuleActionModifyRequestHeader): + case string(DeliveryRuleActionNameModifyRequestHeader): b = &DeliveryRuleRequestHeaderAction{} - case string(DeliveryRuleActionModifyResponseHeader): + case string(DeliveryRuleActionNameModifyResponseHeader): b = &DeliveryRuleResponseHeaderAction{} - case string(DeliveryRuleActionOriginGroupOverride): + case string(DeliveryRuleActionNameOriginGroupOverride): b = &OriginGroupOverrideAction{} - case string(DeliveryRuleActionRouteConfigurationOverride): + case string(DeliveryRuleActionNameRouteConfigurationOverride): b = &DeliveryRuleRouteConfigurationOverrideAction{} - case string(DeliveryRuleActionURLRedirect): + case string(DeliveryRuleActionNameURLRedirect): b = &URLRedirectAction{} - case string(DeliveryRuleActionURLRewrite): + case string(DeliveryRuleActionNameURLRewrite): b = &URLRewriteAction{} - case string(DeliveryRuleActionURLSigning): + case string(DeliveryRuleActionNameURLSigning): b = &URLSigningAction{} default: - b = &DeliveryRuleActionAutoGenerated{} + b = &DeliveryRuleAction{} } if err := json.Unmarshal(rawMsg, b); err != nil { return nil, err @@ -70,7 +67,7 @@ func unmarshalDeliveryRuleActionAutoGeneratedClassification(rawMsg json.RawMessa return b, nil } -func unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(rawMsg json.RawMessage) ([]DeliveryRuleActionAutoGeneratedClassification, error) { +func unmarshalDeliveryRuleActionClassificationArray(rawMsg json.RawMessage) ([]DeliveryRuleActionClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil } @@ -78,9 +75,9 @@ func unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(rawMsg json.Raw if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { return nil, err } - fArray := make([]DeliveryRuleActionAutoGeneratedClassification, len(rawMessages)) + fArray := make([]DeliveryRuleActionClassification, len(rawMessages)) for index, rawMessage := range rawMessages { - f, err := unmarshalDeliveryRuleActionAutoGeneratedClassification(rawMessage) + f, err := unmarshalDeliveryRuleActionClassification(rawMessage) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/cdn/armcdn/profiles_client.go b/sdk/resourcemanager/cdn/armcdn/profiles_client.go index d6bd6a7f0927..51614808201a 100644 --- a/sdk/resourcemanager/cdn/armcdn/profiles_client.go +++ b/sdk/resourcemanager/cdn/armcdn/profiles_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCanMigrate - Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - canMigrateParameters - Properties needed to check if cdn profile or classic frontdoor can be migrated. // - options - ProfilesClientBeginCanMigrateOptions contains the optional parameters for the ProfilesClient.BeginCanMigrate @@ -72,7 +69,7 @@ func (client *ProfilesClient) BeginCanMigrate(ctx context.Context, resourceGroup // CanMigrate - Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *ProfilesClient) canMigrate(ctx context.Context, resourceGroupName string, canMigrateParameters CanMigrateParameters, options *ProfilesClientBeginCanMigrateOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginCanMigrate" @@ -95,7 +92,7 @@ func (client *ProfilesClient) canMigrate(ctx context.Context, resourceGroupName } // canMigrateCreateRequest creates the CanMigrate request. -func (client *ProfilesClient) canMigrateCreateRequest(ctx context.Context, resourceGroupName string, canMigrateParameters CanMigrateParameters, options *ProfilesClientBeginCanMigrateOptions) (*policy.Request, error) { +func (client *ProfilesClient) canMigrateCreateRequest(ctx context.Context, resourceGroupName string, canMigrateParameters CanMigrateParameters, _ *ProfilesClientBeginCanMigrateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/canMigrate" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -110,7 +107,7 @@ func (client *ProfilesClient) canMigrateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, canMigrateParameters); err != nil { @@ -119,11 +116,171 @@ func (client *ProfilesClient) canMigrateCreateRequest(ctx context.Context, resou return req, nil } +// BeginCdnCanMigrateToAfd - Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. +// - options - ProfilesClientBeginCdnCanMigrateToAfdOptions contains the optional parameters for the ProfilesClient.BeginCdnCanMigrateToAfd +// method. +func (client *ProfilesClient) BeginCdnCanMigrateToAfd(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginCdnCanMigrateToAfdOptions) (*runtime.Poller[ProfilesClientCdnCanMigrateToAfdResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cdnCanMigrateToAfd(ctx, resourceGroupName, profileName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProfilesClientCdnCanMigrateToAfdResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ProfilesClientCdnCanMigrateToAfdResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CdnCanMigrateToAfd - Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-15 +func (client *ProfilesClient) cdnCanMigrateToAfd(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginCdnCanMigrateToAfdOptions) (*http.Response, error) { + var err error + const operationName = "ProfilesClient.BeginCdnCanMigrateToAfd" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cdnCanMigrateToAfdCreateRequest(ctx, resourceGroupName, profileName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// cdnCanMigrateToAfdCreateRequest creates the CdnCanMigrateToAfd request. +func (client *ProfilesClient) cdnCanMigrateToAfdCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *ProfilesClientBeginCdnCanMigrateToAfdOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/cdnCanMigrateToAfd" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginCdnMigrateToAfd - Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile +// for migration and will be followed by Commit to finalize the migration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. +// - migrationParameters - Properties needed to migrate the profile. +// - options - ProfilesClientBeginCdnMigrateToAfdOptions contains the optional parameters for the ProfilesClient.BeginCdnMigrateToAfd +// method. +func (client *ProfilesClient) BeginCdnMigrateToAfd(ctx context.Context, resourceGroupName string, profileName string, migrationParameters MigrationToAfdParameters, options *ProfilesClientBeginCdnMigrateToAfdOptions) (*runtime.Poller[ProfilesClientCdnMigrateToAfdResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cdnMigrateToAfd(ctx, resourceGroupName, profileName, migrationParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProfilesClientCdnMigrateToAfdResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ProfilesClientCdnMigrateToAfdResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CdnMigrateToAfd - Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. This step prepares the profile +// for migration and will be followed by Commit to finalize the migration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-15 +func (client *ProfilesClient) cdnMigrateToAfd(ctx context.Context, resourceGroupName string, profileName string, migrationParameters MigrationToAfdParameters, options *ProfilesClientBeginCdnMigrateToAfdOptions) (*http.Response, error) { + var err error + const operationName = "ProfilesClient.BeginCdnMigrateToAfd" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cdnMigrateToAfdCreateRequest(ctx, resourceGroupName, profileName, migrationParameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// cdnMigrateToAfdCreateRequest creates the CdnMigrateToAfd request. +func (client *ProfilesClient) cdnMigrateToAfdCreateRequest(ctx context.Context, resourceGroupName string, profileName string, migrationParameters MigrationToAfdParameters, _ *ProfilesClientBeginCdnMigrateToAfdOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/cdnMigrateToAfd" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, migrationParameters); err != nil { + return nil, err + } + return req, nil +} + // BeginCreate - Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under // the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -150,7 +307,7 @@ func (client *ProfilesClient) BeginCreate(ctx context.Context, resourceGroupName // specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *ProfilesClient) create(ctx context.Context, resourceGroupName string, profileName string, profile Profile, options *ProfilesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginCreate" @@ -173,7 +330,7 @@ func (client *ProfilesClient) create(ctx context.Context, resourceGroupName stri } // createCreateRequest creates the Create request. -func (client *ProfilesClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, profile Profile, options *ProfilesClientBeginCreateOptions) (*policy.Request, error) { +func (client *ProfilesClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, profile Profile, _ *ProfilesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -192,7 +349,7 @@ func (client *ProfilesClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, profile); err != nil { @@ -206,7 +363,7 @@ func (client *ProfilesClient) createCreateRequest(ctx context.Context, resourceG // including endpoints, origins and custom domains. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -233,7 +390,7 @@ func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName // including endpoints, origins and custom domains. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginDelete" @@ -256,7 +413,7 @@ func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *ProfilesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -275,7 +432,7 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +444,7 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG // profile. The SSO URI changes approximately every 10 minutes. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - options - ProfilesClientGenerateSsoURIOptions contains the optional parameters for the ProfilesClient.GenerateSsoURI method. @@ -314,7 +471,7 @@ func (client *ProfilesClient) GenerateSsoURI(ctx context.Context, resourceGroupN } // generateSsoURICreateRequest creates the GenerateSsoURI request. -func (client *ProfilesClient) generateSsoURICreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientGenerateSsoURIOptions) (*policy.Request, error) { +func (client *ProfilesClient) generateSsoURICreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *ProfilesClientGenerateSsoURIOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -333,7 +490,7 @@ func (client *ProfilesClient) generateSsoURICreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +509,7 @@ func (client *ProfilesClient) generateSsoURIHandleResponse(resp *http.Response) // the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -380,7 +537,7 @@ func (client *ProfilesClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientGetOptions) (*policy.Request, error) { +func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *ProfilesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -399,7 +556,7 @@ func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -416,7 +573,7 @@ func (client *ProfilesClient) getHandleResponse(resp *http.Response) (ProfilesCl // NewListPager - Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure subscription. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - options - ProfilesClientListOptions contains the optional parameters for the ProfilesClient.NewListPager method. func (client *ProfilesClient) NewListPager(options *ProfilesClientListOptions) *runtime.Pager[ProfilesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProfilesClientListResponse]{ @@ -442,7 +599,7 @@ func (client *ProfilesClient) NewListPager(options *ProfilesClientListOptions) * } // listCreateRequest creates the List request. -func (client *ProfilesClient) listCreateRequest(ctx context.Context, options *ProfilesClientListOptions) (*policy.Request, error) { +func (client *ProfilesClient) listCreateRequest(ctx context.Context, _ *ProfilesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -453,7 +610,7 @@ func (client *ProfilesClient) listCreateRequest(ctx context.Context, options *Pr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -471,7 +628,7 @@ func (client *ProfilesClient) listHandleResponse(resp *http.Response) (ProfilesC // NewListByResourceGroupPager - Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within // a resource group. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - options - ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.NewListByResourceGroupPager // method. @@ -499,7 +656,7 @@ func (client *ProfilesClient) NewListByResourceGroupPager(resourceGroupName stri } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ProfilesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ProfilesClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ProfilesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ProfilesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -514,7 +671,7 @@ func (client *ProfilesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -532,7 +689,7 @@ func (client *ProfilesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or // Azure Front Door Premium or CDN profile. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -562,7 +719,7 @@ func (client *ProfilesClient) NewListResourceUsagePager(resourceGroupName string } // listResourceUsageCreateRequest creates the ListResourceUsage request. -func (client *ProfilesClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientListResourceUsageOptions) (*policy.Request, error) { +func (client *ProfilesClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *ProfilesClientListResourceUsageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkResourceUsage" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -581,7 +738,7 @@ func (client *ProfilesClient) listResourceUsageCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -600,7 +757,7 @@ func (client *ProfilesClient) listResourceUsageHandleResponse(resp *http.Respons // with an optimization type from the listed values. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -629,7 +786,7 @@ func (client *ProfilesClient) ListSupportedOptimizationTypes(ctx context.Context } // listSupportedOptimizationTypesCreateRequest creates the ListSupportedOptimizationTypes request. -func (client *ProfilesClient) listSupportedOptimizationTypesCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientListSupportedOptimizationTypesOptions) (*policy.Request, error) { +func (client *ProfilesClient) listSupportedOptimizationTypesCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *ProfilesClientListSupportedOptimizationTypesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getSupportedOptimizationTypes" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -648,7 +805,7 @@ func (client *ProfilesClient) listSupportedOptimizationTypesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -667,7 +824,7 @@ func (client *ProfilesClient) listSupportedOptimizationTypesHandleResponse(resp // this. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - migrationParameters - Properties needed to migrate the profile. // - options - ProfilesClientBeginMigrateOptions contains the optional parameters for the ProfilesClient.BeginMigrate method. @@ -692,7 +849,7 @@ func (client *ProfilesClient) BeginMigrate(ctx context.Context, resourceGroupNam // Migrate - Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *ProfilesClient) migrate(ctx context.Context, resourceGroupName string, migrationParameters MigrationParameters, options *ProfilesClientBeginMigrateOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginMigrate" @@ -715,7 +872,7 @@ func (client *ProfilesClient) migrate(ctx context.Context, resourceGroupName str } // migrateCreateRequest creates the Migrate request. -func (client *ProfilesClient) migrateCreateRequest(ctx context.Context, resourceGroupName string, migrationParameters MigrationParameters, options *ProfilesClientBeginMigrateOptions) (*policy.Request, error) { +func (client *ProfilesClient) migrateCreateRequest(ctx context.Context, resourceGroupName string, migrationParameters MigrationParameters, _ *ProfilesClientBeginMigrateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/migrate" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -730,7 +887,7 @@ func (client *ProfilesClient) migrateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, migrationParameters); err != nil { @@ -739,10 +896,87 @@ func (client *ProfilesClient) migrateCreateRequest(ctx context.Context, resource return req, nil } +// BeginMigrationAbort - Abort the migration to Azure Frontdoor Premium/Standard. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. +// - options - ProfilesClientBeginMigrationAbortOptions contains the optional parameters for the ProfilesClient.BeginMigrationAbort +// method. +func (client *ProfilesClient) BeginMigrationAbort(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginMigrationAbortOptions) (*runtime.Poller[ProfilesClientMigrationAbortResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.migrationAbort(ctx, resourceGroupName, profileName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProfilesClientMigrationAbortResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ProfilesClientMigrationAbortResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// MigrationAbort - Abort the migration to Azure Frontdoor Premium/Standard. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-04-15 +func (client *ProfilesClient) migrationAbort(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginMigrationAbortOptions) (*http.Response, error) { + var err error + const operationName = "ProfilesClient.BeginMigrationAbort" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.migrationAbortCreateRequest(ctx, resourceGroupName, profileName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// migrationAbortCreateRequest creates the MigrationAbort request. +func (client *ProfilesClient) migrationAbortCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *ProfilesClientBeginMigrationAbortOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/migrationAbort" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-04-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginMigrationCommit - Commit the migrated Azure Frontdoor(Standard/Premium) profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - options - ProfilesClientBeginMigrationCommitOptions contains the optional parameters for the ProfilesClient.BeginMigrationCommit @@ -768,7 +1002,7 @@ func (client *ProfilesClient) BeginMigrationCommit(ctx context.Context, resource // MigrationCommit - Commit the migrated Azure Frontdoor(Standard/Premium) profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *ProfilesClient) migrationCommit(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginMigrationCommitOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginMigrationCommit" @@ -791,7 +1025,7 @@ func (client *ProfilesClient) migrationCommit(ctx context.Context, resourceGroup } // migrationCommitCreateRequest creates the MigrationCommit request. -func (client *ProfilesClient) migrationCommitCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginMigrationCommitOptions) (*policy.Request, error) { +func (client *ProfilesClient) migrationCommitCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *ProfilesClientBeginMigrationCommitOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/migrationCommit" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -810,7 +1044,7 @@ func (client *ProfilesClient) migrationCommitCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -820,7 +1054,7 @@ func (client *ProfilesClient) migrationCommitCreateRequest(ctx context.Context, // profile name under the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -847,7 +1081,7 @@ func (client *ProfilesClient) BeginUpdate(ctx context.Context, resourceGroupName // name under the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *ProfilesClient) update(ctx context.Context, resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters, options *ProfilesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginUpdate" @@ -870,7 +1104,7 @@ func (client *ProfilesClient) update(ctx context.Context, resourceGroupName stri } // updateCreateRequest creates the Update request. -func (client *ProfilesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters, options *ProfilesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ProfilesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters, _ *ProfilesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -889,7 +1123,7 @@ func (client *ProfilesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, profileUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go deleted file mode 100644 index cd0bc701c4fd..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go +++ /dev/null @@ -1,510 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_List.json -func ExampleProfilesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProfilesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProfileListResult = armcdn.ProfileListResult{ - // Value: []*armcdn.Profile{ - // { - // Name: to.Ptr("profile1"), - // Type: to.Ptr("Microsoft.Cdn/profiles"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG1/providers/Microsoft.Cdn/profiles/profile1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr("frontdoor"), - // Properties: &armcdn.ProfileProperties{ - // FrontDoorID: to.Ptr("3b4682da-b3e2-47a1-96ca-08ab3cb7294e"), - // LogScrubbing: &armcdn.ProfileLogScrubbing{ - // ScrubbingRules: []*armcdn.ProfileScrubbingRules{ - // }, - // State: to.Ptr(armcdn.ProfileScrubbingStateEnabled), - // }, - // OriginResponseTimeoutSeconds: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armcdn.ProfileProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.ProfileResourceStateActive), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNamePremiumAzureFrontDoor), - // }, - // }, - // { - // Name: to.Ptr("profile2"), - // Type: to.Ptr("Microsoft.Cdn/profiles"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG1/providers/Microsoft.Cdn/profiles/profile2"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr("frontdoor"), - // Properties: &armcdn.ProfileProperties{ - // FrontDoorID: to.Ptr("3b4682da-b3e2-47a1-96ca-08ab3cb7294e"), - // LogScrubbing: &armcdn.ProfileLogScrubbing{ - // ScrubbingRules: []*armcdn.ProfileScrubbingRules{ - // }, - // State: to.Ptr(armcdn.ProfileScrubbingStateEnabled), - // }, - // OriginResponseTimeoutSeconds: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armcdn.ProfileProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.ProfileResourceStateActive), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNamePremiumAzureFrontDoor), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_ListByResourceGroup.json -func ExampleProfilesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProfilesClient().NewListByResourceGroupPager("RG", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProfileListResult = armcdn.ProfileListResult{ - // Value: []*armcdn.Profile{ - // { - // Name: to.Ptr("profile1"), - // Type: to.Ptr("Microsoft.Cdn/profiles"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr("frontdoor"), - // Properties: &armcdn.ProfileProperties{ - // FrontDoorID: to.Ptr("3b4682da-b3e2-47a1-96ca-08ab3cb7294e"), - // LogScrubbing: &armcdn.ProfileLogScrubbing{ - // ScrubbingRules: []*armcdn.ProfileScrubbingRules{ - // }, - // State: to.Ptr(armcdn.ProfileScrubbingStateEnabled), - // }, - // OriginResponseTimeoutSeconds: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armcdn.ProfileProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.ProfileResourceStateActive), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNamePremiumAzureFrontDoor), - // }, - // }, - // { - // Name: to.Ptr("profile2"), - // Type: to.Ptr("Microsoft.Cdn/profiles"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile2"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr("frontdoor"), - // Properties: &armcdn.ProfileProperties{ - // FrontDoorID: to.Ptr("3b4682da-b3e2-47a1-96ca-08ab3cb7294e"), - // LogScrubbing: &armcdn.ProfileLogScrubbing{ - // ScrubbingRules: []*armcdn.ProfileScrubbingRules{ - // }, - // State: to.Ptr(armcdn.ProfileScrubbingStateEnabled), - // }, - // OriginResponseTimeoutSeconds: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armcdn.ProfileProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.ProfileResourceStateActive), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNamePremiumAzureFrontDoor), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_Get.json -func ExampleProfilesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().Get(ctx, "RG", "profile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Profile = armcdn.Profile{ - // Name: to.Ptr("profile1"), - // Type: to.Ptr("Microsoft.Cdn/profiles"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr("frontdoor"), - // Properties: &armcdn.ProfileProperties{ - // FrontDoorID: to.Ptr("3b4682da-b3e2-47a1-96ca-08ab3cb7294e"), - // LogScrubbing: &armcdn.ProfileLogScrubbing{ - // ScrubbingRules: []*armcdn.ProfileScrubbingRules{ - // }, - // State: to.Ptr(armcdn.ProfileScrubbingStateEnabled), - // }, - // OriginResponseTimeoutSeconds: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armcdn.ProfileProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.ProfileResourceStateActive), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNamePremiumAzureFrontDoor), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_Create.json -func ExampleProfilesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProfilesClient().BeginCreate(ctx, "RG", "profile1", armcdn.Profile{ - Location: to.Ptr("global"), - SKU: &armcdn.SKU{ - Name: to.Ptr(armcdn.SKUNamePremiumAzureFrontDoor), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Profile = armcdn.Profile{ - // Name: to.Ptr("profile1"), - // Type: to.Ptr("Microsoft.Cdn/profiles"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr("frontdoor"), - // Properties: &armcdn.ProfileProperties{ - // FrontDoorID: to.Ptr("3b4682da-b3e2-47a1-96ca-08ab3cb7294e"), - // OriginResponseTimeoutSeconds: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armcdn.ProfileProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.ProfileResourceStateActive), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNamePremiumAzureFrontDoor), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_Update.json -func ExampleProfilesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProfilesClient().BeginUpdate(ctx, "RG", "profile1", armcdn.ProfileUpdateParameters{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("Tag1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Profile = armcdn.Profile{ - // Name: to.Ptr("profile1"), - // Type: to.Ptr("Microsoft.Cdn/profiles"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"), - // Location: to.Ptr("global"), - // Tags: map[string]*string{ - // "additionalProperties": to.Ptr("Tag1"), - // }, - // Kind: to.Ptr("frontdoor"), - // Properties: &armcdn.ProfileProperties{ - // FrontDoorID: to.Ptr("3b4682da-b3e2-47a1-96ca-08ab3cb7294e"), - // LogScrubbing: &armcdn.ProfileLogScrubbing{ - // ScrubbingRules: []*armcdn.ProfileScrubbingRules{ - // }, - // State: to.Ptr(armcdn.ProfileScrubbingStateEnabled), - // }, - // OriginResponseTimeoutSeconds: to.Ptr[int32](30), - // ProvisioningState: to.Ptr(armcdn.ProfileProvisioningStateSucceeded), - // ResourceState: to.Ptr(armcdn.ProfileResourceStateActive), - // }, - // SKU: &armcdn.SKU{ - // Name: to.Ptr(armcdn.SKUNamePremiumAzureFrontDoor), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_Delete.json -func ExampleProfilesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProfilesClient().BeginDelete(ctx, "RG", "profile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_CanMigrate.json -func ExampleProfilesClient_BeginCanMigrate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProfilesClient().BeginCanMigrate(ctx, "RG", armcdn.CanMigrateParameters{ - ClassicResourceReference: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CanMigrateResult = armcdn.CanMigrateResult{ - // Type: to.Ptr("Microsoft.Cdn/canmigrate"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/yaoshitest/providers/Microsoft.Cdn/operationresults/operationid/profileresults/DummyProfile/canmigrateresults/DummyProfile"), - // Properties: &armcdn.CanMigrateProperties{ - // CanMigrate: to.Ptr(true), - // DefaultSKU: to.Ptr(armcdn.CanMigrateDefaultSKUStandardAzureFrontDoor), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_Migrate.json -func ExampleProfilesClient_BeginMigrate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProfilesClient().BeginMigrate(ctx, "RG", armcdn.MigrationParameters{ - ClassicResourceReference: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname"), - }, - ProfileName: to.Ptr("profile1"), - SKU: &armcdn.SKU{ - Name: to.Ptr(armcdn.SKUNameStandardAzureFrontDoor), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MigrateResult = armcdn.MigrateResult{ - // Type: to.Ptr("Microsoft.Cdn/migrate"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/operationresults/operationid/profileresults/profile1/migrateresults/profile1"), - // Properties: &armcdn.MigrateResultProperties{ - // MigratedProfileResourceID: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_MigrationCommit.json -func ExampleProfilesClient_BeginMigrationCommit() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProfilesClient().BeginMigrationCommit(ctx, "RG", "profile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_GenerateSsoUri.json -func ExampleProfilesClient_GenerateSsoURI() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().GenerateSsoURI(ctx, "RG", "profile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SsoURI = armcdn.SsoURI{ - // SsoURIValue: to.Ptr("https://someuri.com"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_ListSupportedOptimizationTypes.json -func ExampleProfilesClient_ListSupportedOptimizationTypes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().ListSupportedOptimizationTypes(ctx, "RG", "profile1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportedOptimizationTypesListResult = armcdn.SupportedOptimizationTypesListResult{ - // SupportedOptimizationTypes: []*armcdn.OptimizationType{ - // to.Ptr(armcdn.OptimizationTypeGeneralWebDelivery), - // to.Ptr(armcdn.OptimizationTypeDynamicSiteAcceleration)}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Profiles_ListResourceUsage.json -func ExampleProfilesClient_NewListResourceUsagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProfilesClient().NewListResourceUsagePager("RG", "profile1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceUsageListResult = armcdn.ResourceUsageListResult{ - // Value: []*armcdn.ResourceUsage{ - // { - // CurrentValue: to.Ptr[int32](0), - // Limit: to.Ptr[int32](25), - // ResourceType: to.Ptr("endpoint"), - // Unit: to.Ptr(armcdn.ResourceUsageUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go b/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go index f47342b7ea72..188382ba6d0f 100644 --- a/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go +++ b/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -45,7 +42,7 @@ func NewResourceUsageClient(subscriptionID string, credential azcore.TokenCreden // NewListPager - Check the quota and actual usage of the CDN profiles under the given subscription. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - options - ResourceUsageClientListOptions contains the optional parameters for the ResourceUsageClient.NewListPager method. func (client *ResourceUsageClient) NewListPager(options *ResourceUsageClientListOptions) *runtime.Pager[ResourceUsageClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ResourceUsageClientListResponse]{ @@ -71,7 +68,7 @@ func (client *ResourceUsageClient) NewListPager(options *ResourceUsageClientList } // listCreateRequest creates the List request. -func (client *ResourceUsageClient) listCreateRequest(ctx context.Context, options *ResourceUsageClientListOptions) (*policy.Request, error) { +func (client *ResourceUsageClient) listCreateRequest(ctx context.Context, _ *ResourceUsageClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -82,7 +79,7 @@ func (client *ResourceUsageClient) listCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/resourceusage_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/resourceusage_client_example_test.go deleted file mode 100644 index f37f2e3e285d..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/resourceusage_client_example_test.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/ResourceUsage_List.json -func ExampleResourceUsageClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceUsageClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceUsageListResult = armcdn.ResourceUsageListResult{ - // Value: []*armcdn.ResourceUsage{ - // { - // CurrentValue: to.Ptr[int32](31), - // Limit: to.Ptr[int32](200), - // ResourceType: to.Ptr("profile"), - // Unit: to.Ptr(armcdn.ResourceUsageUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/responses.go b/sdk/resourcemanager/cdn/armcdn/responses.go index cafb7e10495f..d9417732a11e 100644 --- a/sdk/resourcemanager/cdn/armcdn/responses.go +++ b/sdk/resourcemanager/cdn/armcdn/responses.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -474,6 +471,18 @@ type ProfilesClientCanMigrateResponse struct { CanMigrateResult } +// ProfilesClientCdnCanMigrateToAfdResponse contains the response from method ProfilesClient.BeginCdnCanMigrateToAfd. +type ProfilesClientCdnCanMigrateToAfdResponse struct { + // Result for canMigrate operation. + CanMigrateResult +} + +// ProfilesClientCdnMigrateToAfdResponse contains the response from method ProfilesClient.BeginCdnMigrateToAfd. +type ProfilesClientCdnMigrateToAfdResponse struct { + // Result for migrate operation. + MigrateResult +} + // ProfilesClientCreateResponse contains the response from method ProfilesClient.BeginCreate. type ProfilesClientCreateResponse struct { // A profile is a logical grouping of endpoints that share the same settings. @@ -527,6 +536,11 @@ type ProfilesClientMigrateResponse struct { MigrateResult } +// ProfilesClientMigrationAbortResponse contains the response from method ProfilesClient.BeginMigrationAbort. +type ProfilesClientMigrationAbortResponse struct { + // placeholder for future response values +} + // ProfilesClientMigrationCommitResponse contains the response from method ProfilesClient.BeginMigrationCommit. type ProfilesClientMigrationCommitResponse struct { // placeholder for future response values diff --git a/sdk/resourcemanager/cdn/armcdn/routes_client.go b/sdk/resourcemanager/cdn/armcdn/routes_client.go index 40c7682510d3..9b1005dc3fb8 100644 --- a/sdk/resourcemanager/cdn/armcdn/routes_client.go +++ b/sdk/resourcemanager/cdn/armcdn/routes_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,10 +44,9 @@ func NewRoutesClient(subscriptionID string, credential azcore.TokenCredential, o // and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - routeName - Name of the routing rule. // - route - Route properties @@ -77,7 +73,7 @@ func (client *RoutesClient) BeginCreate(ctx context.Context, resourceGroupName s // AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *RoutesClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, route Route, options *RoutesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "RoutesClient.BeginCreate" @@ -100,7 +96,7 @@ func (client *RoutesClient) create(ctx context.Context, resourceGroupName string } // createCreateRequest creates the Create request. -func (client *RoutesClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, route Route, options *RoutesClientBeginCreateOptions) (*policy.Request, error) { +func (client *RoutesClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, route Route, _ *RoutesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -127,7 +123,7 @@ func (client *RoutesClient) createCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, route); err != nil { @@ -140,10 +136,9 @@ func (client *RoutesClient) createCreateRequest(ctx context.Context, resourceGro // profile, and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - routeName - Name of the routing rule. // - options - RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. @@ -169,7 +164,7 @@ func (client *RoutesClient) BeginDelete(ctx context.Context, resourceGroupName s // and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *RoutesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, options *RoutesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RoutesClient.BeginDelete" @@ -192,7 +187,7 @@ func (client *RoutesClient) deleteOperation(ctx context.Context, resourceGroupNa } // deleteCreateRequest creates the Delete request. -func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, options *RoutesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, _ *RoutesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -219,7 +214,7 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,10 +224,9 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro // AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - routeName - Name of the routing rule. // - options - RoutesClientGetOptions contains the optional parameters for the RoutesClient.Get method. @@ -259,7 +253,7 @@ func (client *RoutesClient) Get(ctx context.Context, resourceGroupName string, p } // getCreateRequest creates the Get request. -func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, options *RoutesClientGetOptions) (*policy.Request, error) { +func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, _ *RoutesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -286,7 +280,7 @@ func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,10 +297,9 @@ func (client *RoutesClient) getHandleResponse(resp *http.Response) (RoutesClient // NewListByEndpointPager - Lists all of the existing origins within a profile. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - options - RoutesClientListByEndpointOptions contains the optional parameters for the RoutesClient.NewListByEndpointPager // method. @@ -334,7 +327,7 @@ func (client *RoutesClient) NewListByEndpointPager(resourceGroupName string, pro } // listByEndpointCreateRequest creates the ListByEndpoint request. -func (client *RoutesClient) listByEndpointCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *RoutesClientListByEndpointOptions) (*policy.Request, error) { +func (client *RoutesClient) listByEndpointCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, _ *RoutesClientListByEndpointOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -357,7 +350,7 @@ func (client *RoutesClient) listByEndpointCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -376,10 +369,9 @@ func (client *RoutesClient) listByEndpointHandleResponse(resp *http.Response) (R // profile, and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - routeName - Name of the routing rule. // - routeUpdateProperties - Route update properties @@ -406,7 +398,7 @@ func (client *RoutesClient) BeginUpdate(ctx context.Context, resourceGroupName s // and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *RoutesClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, routeUpdateProperties RouteUpdateParameters, options *RoutesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "RoutesClient.BeginUpdate" @@ -429,7 +421,7 @@ func (client *RoutesClient) update(ctx context.Context, resourceGroupName string } // updateCreateRequest creates the Update request. -func (client *RoutesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, routeUpdateProperties RouteUpdateParameters, options *RoutesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *RoutesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, routeUpdateProperties RouteUpdateParameters, _ *RoutesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/afdEndpoints/{endpointName}/routes/{routeName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -456,7 +448,7 @@ func (client *RoutesClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, routeUpdateProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/routes_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/routes_client_example_test.go deleted file mode 100644 index 0a4d6649543a..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/routes_client_example_test.go +++ /dev/null @@ -1,354 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Routes_ListByEndpoint.json -func ExampleRoutesClient_NewListByEndpointPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoutesClient().NewListByEndpointPager("RG", "profile1", "endpoint1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RouteListResult = armcdn.RouteListResult{ - // Value: []*armcdn.Route{ - // { - // Name: to.Ptr("route1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/afdendpoints/routes"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1/routes/route1"), - // Properties: &armcdn.RouteProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // CacheConfiguration: &armcdn.AfdRouteCacheConfiguration{ - // CompressionSettings: &armcdn.CompressionSettings{ - // ContentTypesToCompress: []*string{ - // to.Ptr("text/html"), - // to.Ptr("application/octet-stream")}, - // IsCompressionEnabled: to.Ptr(true), - // }, - // QueryStringCachingBehavior: to.Ptr(armcdn.AfdQueryStringCachingBehaviorIgnoreQueryString), - // }, - // CustomDomains: []*armcdn.ActivatedResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"), - // }}, - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // ForwardingProtocol: to.Ptr(armcdn.ForwardingProtocolMatchRequest), - // HTTPSRedirect: to.Ptr(armcdn.HTTPSRedirectEnabled), - // LinkToDefaultDomain: to.Ptr(armcdn.LinkToDefaultDomainEnabled), - // OriginGroup: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1"), - // }, - // PatternsToMatch: []*string{ - // to.Ptr("/*")}, - // RuleSets: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"), - // }}, - // SupportedProtocols: []*armcdn.AFDEndpointProtocols{ - // to.Ptr(armcdn.AFDEndpointProtocolsHTTPS), - // to.Ptr(armcdn.AFDEndpointProtocolsHTTP)}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Routes_Get.json -func ExampleRoutesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoutesClient().Get(ctx, "RG", "profile1", "endpoint1", "route1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Route = armcdn.Route{ - // Name: to.Ptr("route1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/afdendpoints/routes"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1/routes/route1"), - // Properties: &armcdn.RouteProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // CacheConfiguration: &armcdn.AfdRouteCacheConfiguration{ - // CompressionSettings: &armcdn.CompressionSettings{ - // ContentTypesToCompress: []*string{ - // to.Ptr("text/html"), - // to.Ptr("application/octet-stream")}, - // IsCompressionEnabled: to.Ptr(true), - // }, - // QueryStringCachingBehavior: to.Ptr(armcdn.AfdQueryStringCachingBehaviorIgnoreQueryString), - // }, - // CustomDomains: []*armcdn.ActivatedResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"), - // }}, - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // ForwardingProtocol: to.Ptr(armcdn.ForwardingProtocolMatchRequest), - // HTTPSRedirect: to.Ptr(armcdn.HTTPSRedirectEnabled), - // LinkToDefaultDomain: to.Ptr(armcdn.LinkToDefaultDomainEnabled), - // OriginGroup: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1"), - // }, - // PatternsToMatch: []*string{ - // to.Ptr("/*")}, - // RuleSets: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"), - // }}, - // SupportedProtocols: []*armcdn.AFDEndpointProtocols{ - // to.Ptr(armcdn.AFDEndpointProtocolsHTTPS), - // to.Ptr(armcdn.AFDEndpointProtocolsHTTP)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Routes_Create.json -func ExampleRoutesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutesClient().BeginCreate(ctx, "RG", "profile1", "endpoint1", "route1", armcdn.Route{ - Properties: &armcdn.RouteProperties{ - CacheConfiguration: &armcdn.AfdRouteCacheConfiguration{ - CompressionSettings: &armcdn.CompressionSettings{ - ContentTypesToCompress: []*string{ - to.Ptr("text/html"), - to.Ptr("application/octet-stream")}, - IsCompressionEnabled: to.Ptr(true), - }, - QueryParameters: to.Ptr("querystring=test"), - QueryStringCachingBehavior: to.Ptr(armcdn.AfdQueryStringCachingBehaviorIgnoreSpecifiedQueryStrings), - }, - CustomDomains: []*armcdn.ActivatedResourceReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"), - }}, - EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - ForwardingProtocol: to.Ptr(armcdn.ForwardingProtocolMatchRequest), - HTTPSRedirect: to.Ptr(armcdn.HTTPSRedirectEnabled), - LinkToDefaultDomain: to.Ptr(armcdn.LinkToDefaultDomainEnabled), - OriginGroup: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1"), - }, - PatternsToMatch: []*string{ - to.Ptr("/*")}, - RuleSets: []*armcdn.ResourceReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"), - }}, - SupportedProtocols: []*armcdn.AFDEndpointProtocols{ - to.Ptr(armcdn.AFDEndpointProtocolsHTTPS), - to.Ptr(armcdn.AFDEndpointProtocolsHTTP)}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Route = armcdn.Route{ - // Name: to.Ptr("route1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/afdendpoints/routes"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1/routes/route1"), - // Properties: &armcdn.RouteProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // CacheConfiguration: &armcdn.AfdRouteCacheConfiguration{ - // CompressionSettings: &armcdn.CompressionSettings{ - // ContentTypesToCompress: []*string{ - // to.Ptr("text/html"), - // to.Ptr("application/octet-stream")}, - // IsCompressionEnabled: to.Ptr(true), - // }, - // QueryParameters: to.Ptr("querystring=test"), - // QueryStringCachingBehavior: to.Ptr(armcdn.AfdQueryStringCachingBehaviorIgnoreSpecifiedQueryStrings), - // }, - // CustomDomains: []*armcdn.ActivatedResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"), - // }}, - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // ForwardingProtocol: to.Ptr(armcdn.ForwardingProtocolMatchRequest), - // HTTPSRedirect: to.Ptr(armcdn.HTTPSRedirectEnabled), - // LinkToDefaultDomain: to.Ptr(armcdn.LinkToDefaultDomainEnabled), - // OriginGroup: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1"), - // }, - // PatternsToMatch: []*string{ - // to.Ptr("/*")}, - // RuleSets: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"), - // }}, - // SupportedProtocols: []*armcdn.AFDEndpointProtocols{ - // to.Ptr(armcdn.AFDEndpointProtocolsHTTPS), - // to.Ptr(armcdn.AFDEndpointProtocolsHTTP)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Routes_Update.json -func ExampleRoutesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutesClient().BeginUpdate(ctx, "RG", "profile1", "endpoint1", "route1", armcdn.RouteUpdateParameters{ - Properties: &armcdn.RouteUpdatePropertiesParameters{ - CacheConfiguration: &armcdn.AfdRouteCacheConfiguration{ - CompressionSettings: &armcdn.CompressionSettings{ - ContentTypesToCompress: []*string{ - to.Ptr("text/html"), - to.Ptr("application/octet-stream")}, - IsCompressionEnabled: to.Ptr(true), - }, - QueryStringCachingBehavior: to.Ptr(armcdn.AfdQueryStringCachingBehaviorIgnoreQueryString), - }, - CustomDomains: []*armcdn.ActivatedResourceReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"), - }}, - EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - ForwardingProtocol: to.Ptr(armcdn.ForwardingProtocolMatchRequest), - HTTPSRedirect: to.Ptr(armcdn.HTTPSRedirectEnabled), - LinkToDefaultDomain: to.Ptr(armcdn.LinkToDefaultDomainEnabled), - OriginGroup: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1"), - }, - PatternsToMatch: []*string{ - to.Ptr("/*")}, - RuleSets: []*armcdn.ResourceReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"), - }}, - SupportedProtocols: []*armcdn.AFDEndpointProtocols{ - to.Ptr(armcdn.AFDEndpointProtocolsHTTPS), - to.Ptr(armcdn.AFDEndpointProtocolsHTTP)}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Route = armcdn.Route{ - // Name: to.Ptr("route1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/afdendpoints/routes"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/afdendpoints/endpoint1/routes/route1"), - // Properties: &armcdn.RouteProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // CacheConfiguration: &armcdn.AfdRouteCacheConfiguration{ - // CompressionSettings: &armcdn.CompressionSettings{ - // ContentTypesToCompress: []*string{ - // to.Ptr("text/html"), - // to.Ptr("application/octet-stream")}, - // IsCompressionEnabled: to.Ptr(true), - // }, - // QueryStringCachingBehavior: to.Ptr(armcdn.AfdQueryStringCachingBehaviorIgnoreQueryString), - // }, - // CustomDomains: []*armcdn.ActivatedResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1"), - // }}, - // EnabledState: to.Ptr(armcdn.EnabledStateEnabled), - // ForwardingProtocol: to.Ptr(armcdn.ForwardingProtocolMatchRequest), - // HTTPSRedirect: to.Ptr(armcdn.HTTPSRedirectEnabled), - // LinkToDefaultDomain: to.Ptr(armcdn.LinkToDefaultDomainEnabled), - // OriginGroup: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1"), - // }, - // PatternsToMatch: []*string{ - // to.Ptr("/*")}, - // RuleSets: []*armcdn.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1"), - // }}, - // SupportedProtocols: []*armcdn.AFDEndpointProtocols{ - // to.Ptr(armcdn.AFDEndpointProtocolsHTTPS), - // to.Ptr(armcdn.AFDEndpointProtocolsHTTP)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Routes_Delete.json -func ExampleRoutesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutesClient().BeginDelete(ctx, "RG", "profile1", "endpoint1", "route1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/rules_client.go b/sdk/resourcemanager/cdn/armcdn/rules_client.go index 85d0e4f6edd8..312bc5562c6f 100644 --- a/sdk/resourcemanager/cdn/armcdn/rules_client.go +++ b/sdk/resourcemanager/cdn/armcdn/rules_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,10 +43,9 @@ func NewRulesClient(subscriptionID string, credential azcore.TokenCredential, op // BeginCreate - Creates a new delivery rule within the specified rule set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - ruleSetName - Name of the rule set under the profile. // - ruleName - Name of the delivery rule which is unique within the endpoint. // - rule - The delivery rule properties. @@ -75,7 +71,7 @@ func (client *RulesClient) BeginCreate(ctx context.Context, resourceGroupName st // Create - Creates a new delivery rule within the specified rule set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *RulesClient) create(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, rule Rule, options *RulesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "RulesClient.BeginCreate" @@ -98,7 +94,7 @@ func (client *RulesClient) create(ctx context.Context, resourceGroupName string, } // createCreateRequest creates the Create request. -func (client *RulesClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, rule Rule, options *RulesClientBeginCreateOptions) (*policy.Request, error) { +func (client *RulesClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, rule Rule, _ *RulesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -125,7 +121,7 @@ func (client *RulesClient) createCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, rule); err != nil { @@ -137,10 +133,9 @@ func (client *RulesClient) createCreateRequest(ctx context.Context, resourceGrou // BeginDelete - Deletes an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - ruleSetName - Name of the rule set under the profile. // - ruleName - Name of the delivery rule which is unique within the endpoint. // - options - RulesClientBeginDeleteOptions contains the optional parameters for the RulesClient.BeginDelete method. @@ -165,7 +160,7 @@ func (client *RulesClient) BeginDelete(ctx context.Context, resourceGroupName st // Delete - Deletes an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *RulesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, options *RulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RulesClient.BeginDelete" @@ -188,7 +183,7 @@ func (client *RulesClient) deleteOperation(ctx context.Context, resourceGroupNam } // deleteCreateRequest creates the Delete request. -func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, options *RulesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, _ *RulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -215,7 +210,7 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,10 +219,9 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - ruleSetName - Name of the rule set under the profile. // - ruleName - Name of the delivery rule which is unique within the endpoint. // - options - RulesClientGetOptions contains the optional parameters for the RulesClient.Get method. @@ -254,7 +248,7 @@ func (client *RulesClient) Get(ctx context.Context, resourceGroupName string, pr } // getCreateRequest creates the Get request. -func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, options *RulesClientGetOptions) (*policy.Request, error) { +func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, _ *RulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -281,7 +275,7 @@ func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,10 +292,9 @@ func (client *RulesClient) getHandleResponse(resp *http.Response) (RulesClientGe // NewListByRuleSetPager - Lists all of the existing delivery rules within a rule set. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - ruleSetName - Name of the rule set under the profile. // - options - RulesClientListByRuleSetOptions contains the optional parameters for the RulesClient.NewListByRuleSetPager method. func (client *RulesClient) NewListByRuleSetPager(resourceGroupName string, profileName string, ruleSetName string, options *RulesClientListByRuleSetOptions) *runtime.Pager[RulesClientListByRuleSetResponse] { @@ -328,7 +321,7 @@ func (client *RulesClient) NewListByRuleSetPager(resourceGroupName string, profi } // listByRuleSetCreateRequest creates the ListByRuleSet request. -func (client *RulesClient) listByRuleSetCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RulesClientListByRuleSetOptions) (*policy.Request, error) { +func (client *RulesClient) listByRuleSetCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, _ *RulesClientListByRuleSetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -351,7 +344,7 @@ func (client *RulesClient) listByRuleSetCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -369,10 +362,9 @@ func (client *RulesClient) listByRuleSetHandleResponse(resp *http.Response) (Rul // BeginUpdate - Updates an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - ruleSetName - Name of the rule set under the profile. // - ruleName - Name of the delivery rule which is unique within the endpoint. // - ruleUpdateProperties - Delivery rule properties @@ -398,7 +390,7 @@ func (client *RulesClient) BeginUpdate(ctx context.Context, resourceGroupName st // Update - Updates an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *RulesClient) update(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, ruleUpdateProperties RuleUpdateParameters, options *RulesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "RulesClient.BeginUpdate" @@ -421,7 +413,7 @@ func (client *RulesClient) update(ctx context.Context, resourceGroupName string, } // updateCreateRequest creates the Update request. -func (client *RulesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, ruleUpdateProperties RuleUpdateParameters, options *RulesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *RulesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, ruleUpdateProperties RuleUpdateParameters, _ *RulesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/rules/{ruleName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -448,7 +440,7 @@ func (client *RulesClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, ruleUpdateProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/rules_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/rules_client_example_test.go deleted file mode 100644 index f7562df37ccb..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/rules_client_example_test.go +++ /dev/null @@ -1,311 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Rules_ListByRuleSet.json -func ExampleRulesClient_NewListByRuleSetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRulesClient().NewListByRuleSetPager("RG", "profile1", "ruleSet1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RuleListResult = armcdn.RuleListResult{ - // Value: []*armcdn.Rule{ - // { - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/rulesets/rules"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/rulesets/ruleSet1/rules/rule1"), - // Properties: &armcdn.RuleProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Actions: []armcdn.DeliveryRuleActionAutoGeneratedClassification{ - // &armcdn.DeliveryRuleResponseHeaderAction{ - // Name: to.Ptr(armcdn.DeliveryRuleActionModifyResponseHeader), - // Parameters: &armcdn.HeaderActionParameters{ - // HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - // HeaderName: to.Ptr("X-CDN"), - // TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - // Value: to.Ptr("MSFT"), - // }, - // }}, - // Conditions: []armcdn.DeliveryRuleConditionClassification{ - // &armcdn.DeliveryRuleRequestMethodCondition{ - // Name: to.Ptr(armcdn.MatchVariableRequestMethod), - // Parameters: &armcdn.RequestMethodMatchConditionParameters{ - // MatchValues: []*armcdn.RequestMethodMatchConditionParametersMatchValuesItem{ - // to.Ptr(armcdn.RequestMethodMatchConditionParametersMatchValuesItemGET)}, - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.RequestMethodOperatorEqual), - // Transforms: []*armcdn.Transform{ - // }, - // TypeName: to.Ptr(armcdn.RequestMethodMatchConditionParametersTypeNameDeliveryRuleRequestMethodConditionParameters), - // }, - // }}, - // MatchProcessingBehavior: to.Ptr(armcdn.MatchProcessingBehaviorContinue), - // Order: to.Ptr[int32](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Rules_Get.json -func ExampleRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRulesClient().Get(ctx, "RG", "profile1", "ruleSet1", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Rule = armcdn.Rule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/rulesets/rules"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/rulesets/ruleSet1/rules/rule1"), - // Properties: &armcdn.RuleProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Actions: []armcdn.DeliveryRuleActionAutoGeneratedClassification{ - // &armcdn.DeliveryRuleResponseHeaderAction{ - // Name: to.Ptr(armcdn.DeliveryRuleActionModifyResponseHeader), - // Parameters: &armcdn.HeaderActionParameters{ - // HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - // HeaderName: to.Ptr("X-CDN"), - // TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - // Value: to.Ptr("MSFT"), - // }, - // }}, - // Conditions: []armcdn.DeliveryRuleConditionClassification{ - // &armcdn.DeliveryRuleRequestMethodCondition{ - // Name: to.Ptr(armcdn.MatchVariableRequestMethod), - // Parameters: &armcdn.RequestMethodMatchConditionParameters{ - // MatchValues: []*armcdn.RequestMethodMatchConditionParametersMatchValuesItem{ - // to.Ptr(armcdn.RequestMethodMatchConditionParametersMatchValuesItemGET)}, - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.RequestMethodOperatorEqual), - // Transforms: []*armcdn.Transform{ - // }, - // TypeName: to.Ptr(armcdn.RequestMethodMatchConditionParametersTypeNameDeliveryRuleRequestMethodConditionParameters), - // }, - // }}, - // MatchProcessingBehavior: to.Ptr(armcdn.MatchProcessingBehaviorContinue), - // Order: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Rules_Create.json -func ExampleRulesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRulesClient().BeginCreate(ctx, "RG", "profile1", "ruleSet1", "rule1", armcdn.Rule{ - Properties: &armcdn.RuleProperties{ - Actions: []armcdn.DeliveryRuleActionAutoGeneratedClassification{ - &armcdn.DeliveryRuleResponseHeaderAction{ - Name: to.Ptr(armcdn.DeliveryRuleActionModifyResponseHeader), - Parameters: &armcdn.HeaderActionParameters{ - HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - HeaderName: to.Ptr("X-CDN"), - TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - Value: to.Ptr("MSFT"), - }, - }}, - Conditions: []armcdn.DeliveryRuleConditionClassification{ - &armcdn.DeliveryRuleRequestMethodCondition{ - Name: to.Ptr(armcdn.MatchVariableRequestMethod), - Parameters: &armcdn.RequestMethodMatchConditionParameters{ - MatchValues: []*armcdn.RequestMethodMatchConditionParametersMatchValuesItem{ - to.Ptr(armcdn.RequestMethodMatchConditionParametersMatchValuesItemGET)}, - NegateCondition: to.Ptr(false), - Operator: to.Ptr(armcdn.RequestMethodOperatorEqual), - TypeName: to.Ptr(armcdn.RequestMethodMatchConditionParametersTypeNameDeliveryRuleRequestMethodConditionParameters), - }, - }}, - Order: to.Ptr[int32](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Rule = armcdn.Rule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/rulesets/rules"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/rulesets/ruleSet1/rules/rule1"), - // Properties: &armcdn.RuleProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Actions: []armcdn.DeliveryRuleActionAutoGeneratedClassification{ - // &armcdn.DeliveryRuleResponseHeaderAction{ - // Name: to.Ptr(armcdn.DeliveryRuleActionModifyResponseHeader), - // Parameters: &armcdn.HeaderActionParameters{ - // HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - // HeaderName: to.Ptr("X-CDN"), - // TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - // Value: to.Ptr("MSFT"), - // }, - // }}, - // Conditions: []armcdn.DeliveryRuleConditionClassification{ - // &armcdn.DeliveryRuleRequestMethodCondition{ - // Name: to.Ptr(armcdn.MatchVariableRequestMethod), - // Parameters: &armcdn.RequestMethodMatchConditionParameters{ - // MatchValues: []*armcdn.RequestMethodMatchConditionParametersMatchValuesItem{ - // to.Ptr(armcdn.RequestMethodMatchConditionParametersMatchValuesItemGET)}, - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.RequestMethodOperatorEqual), - // Transforms: []*armcdn.Transform{ - // }, - // TypeName: to.Ptr(armcdn.RequestMethodMatchConditionParametersTypeNameDeliveryRuleRequestMethodConditionParameters), - // }, - // }}, - // MatchProcessingBehavior: to.Ptr(armcdn.MatchProcessingBehaviorContinue), - // Order: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Rules_Update.json -func ExampleRulesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRulesClient().BeginUpdate(ctx, "RG", "profile1", "ruleSet1", "rule1", armcdn.RuleUpdateParameters{ - Properties: &armcdn.RuleUpdatePropertiesParameters{ - Actions: []armcdn.DeliveryRuleActionAutoGeneratedClassification{ - &armcdn.DeliveryRuleResponseHeaderAction{ - Name: to.Ptr(armcdn.DeliveryRuleActionModifyResponseHeader), - Parameters: &armcdn.HeaderActionParameters{ - HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - HeaderName: to.Ptr("X-CDN"), - TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - Value: to.Ptr("MSFT"), - }, - }}, - Order: to.Ptr[int32](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Rule = armcdn.Rule{ - // Name: to.Ptr("rule1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/rulesets/rules"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/rulesets/ruleSet1/rules/rule1"), - // Properties: &armcdn.RuleProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Actions: []armcdn.DeliveryRuleActionAutoGeneratedClassification{ - // &armcdn.DeliveryRuleResponseHeaderAction{ - // Name: to.Ptr(armcdn.DeliveryRuleActionModifyResponseHeader), - // Parameters: &armcdn.HeaderActionParameters{ - // HeaderAction: to.Ptr(armcdn.HeaderActionOverwrite), - // HeaderName: to.Ptr("X-CDN"), - // TypeName: to.Ptr(armcdn.HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters), - // Value: to.Ptr("MSFT"), - // }, - // }}, - // Conditions: []armcdn.DeliveryRuleConditionClassification{ - // &armcdn.DeliveryRuleRequestMethodCondition{ - // Name: to.Ptr(armcdn.MatchVariableRequestMethod), - // Parameters: &armcdn.RequestMethodMatchConditionParameters{ - // MatchValues: []*armcdn.RequestMethodMatchConditionParametersMatchValuesItem{ - // to.Ptr(armcdn.RequestMethodMatchConditionParametersMatchValuesItemGET)}, - // NegateCondition: to.Ptr(false), - // Operator: to.Ptr(armcdn.RequestMethodOperatorEqual), - // Transforms: []*armcdn.Transform{ - // }, - // TypeName: to.Ptr(armcdn.RequestMethodMatchConditionParametersTypeNameDeliveryRuleRequestMethodConditionParameters), - // }, - // }}, - // MatchProcessingBehavior: to.Ptr(armcdn.MatchProcessingBehaviorContinue), - // Order: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Rules_Delete.json -func ExampleRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRulesClient().BeginDelete(ctx, "RG", "profile1", "ruleSet1", "rule1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/rulesets_client.go b/sdk/resourcemanager/cdn/armcdn/rulesets_client.go index cf83cf630118..7aa25ebd3014 100644 --- a/sdk/resourcemanager/cdn/armcdn/rulesets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/rulesets_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,10 +43,9 @@ func NewRuleSetsClient(subscriptionID string, credential azcore.TokenCredential, // Create - Creates a new rule set within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - ruleSetName - Name of the rule set under the profile which is unique globally // - options - RuleSetsClientCreateOptions contains the optional parameters for the RuleSetsClient.Create method. func (client *RuleSetsClient) Create(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientCreateOptions) (RuleSetsClientCreateResponse, error) { @@ -75,7 +71,7 @@ func (client *RuleSetsClient) Create(ctx context.Context, resourceGroupName stri } // createCreateRequest creates the Create request. -func (client *RuleSetsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientCreateOptions) (*policy.Request, error) { +func (client *RuleSetsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, _ *RuleSetsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -98,7 +94,7 @@ func (client *RuleSetsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,10 +113,9 @@ func (client *RuleSetsClient) createHandleResponse(resp *http.Response) (RuleSet // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - ruleSetName - Name of the rule set under the profile which is unique globally. // - options - RuleSetsClientBeginDeleteOptions contains the optional parameters for the RuleSetsClient.BeginDelete method. func (client *RuleSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientBeginDeleteOptions) (*runtime.Poller[RuleSetsClientDeleteResponse], error) { @@ -145,7 +140,7 @@ func (client *RuleSetsClient) BeginDelete(ctx context.Context, resourceGroupName // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *RuleSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RuleSetsClient.BeginDelete" @@ -168,7 +163,7 @@ func (client *RuleSetsClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *RuleSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *RuleSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, _ *RuleSetsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -191,7 +186,7 @@ func (client *RuleSetsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,10 +196,9 @@ func (client *RuleSetsClient) deleteCreateRequest(ctx context.Context, resourceG // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - ruleSetName - Name of the rule set under the profile which is unique globally. // - options - RuleSetsClientGetOptions contains the optional parameters for the RuleSetsClient.Get method. func (client *RuleSetsClient) Get(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientGetOptions) (RuleSetsClientGetResponse, error) { @@ -230,7 +224,7 @@ func (client *RuleSetsClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *RuleSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientGetOptions) (*policy.Request, error) { +func (client *RuleSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, _ *RuleSetsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -253,7 +247,7 @@ func (client *RuleSetsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,10 +264,9 @@ func (client *RuleSetsClient) getHandleResponse(resp *http.Response) (RuleSetsCl // NewListByProfilePager - Lists existing AzureFrontDoor rule sets within a profile. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - options - RuleSetsClientListByProfileOptions contains the optional parameters for the RuleSetsClient.NewListByProfilePager // method. func (client *RuleSetsClient) NewListByProfilePager(resourceGroupName string, profileName string, options *RuleSetsClientListByProfileOptions) *runtime.Pager[RuleSetsClientListByProfileResponse] { @@ -300,7 +293,7 @@ func (client *RuleSetsClient) NewListByProfilePager(resourceGroupName string, pr } // listByProfileCreateRequest creates the ListByProfile request. -func (client *RuleSetsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *RuleSetsClientListByProfileOptions) (*policy.Request, error) { +func (client *RuleSetsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *RuleSetsClientListByProfileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -319,7 +312,7 @@ func (client *RuleSetsClient) listByProfileCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,10 +329,9 @@ func (client *RuleSetsClient) listByProfileHandleResponse(resp *http.Response) ( // NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - ruleSetName - Name of the rule set under the profile which is unique globally. // - options - RuleSetsClientListResourceUsageOptions contains the optional parameters for the RuleSetsClient.NewListResourceUsagePager // method. @@ -367,7 +359,7 @@ func (client *RuleSetsClient) NewListResourceUsagePager(resourceGroupName string } // listResourceUsageCreateRequest creates the ListResourceUsage request. -func (client *RuleSetsClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientListResourceUsageOptions) (*policy.Request, error) { +func (client *RuleSetsClient) listResourceUsageCreateRequest(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, _ *RuleSetsClientListResourceUsageOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/ruleSets/{ruleSetName}/usages" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -390,7 +382,7 @@ func (client *RuleSetsClient) listResourceUsageCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/rulesets_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/rulesets_client_example_test.go deleted file mode 100644 index 513a9c6cd2bd..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/rulesets_client_example_test.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/RuleSets_ListByProfile.json -func ExampleRuleSetsClient_NewListByProfilePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRuleSetsClient().NewListByProfilePager("RG", "profile1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RuleSetListResult = armcdn.RuleSetListResult{ - // Value: []*armcdn.RuleSet{ - // { - // Name: to.Ptr("ruleSet1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/rulesets"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/rulesets/ruleSet1"), - // Properties: &armcdn.RuleSetProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/RuleSets_Get.json -func ExampleRuleSetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRuleSetsClient().Get(ctx, "RG", "profile1", "ruleSet1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleSet = armcdn.RuleSet{ - // Name: to.Ptr("ruleSet1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/rulesets"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/rulesets/ruleSet1"), - // Properties: &armcdn.RuleSetProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/RuleSets_Create.json -func ExampleRuleSetsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRuleSetsClient().Create(ctx, "RG", "profile1", "ruleSet1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleSet = armcdn.RuleSet{ - // Name: to.Ptr("ruleSet1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/rulesets"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/rulesets/ruleSet1"), - // Properties: &armcdn.RuleSetProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/RuleSets_Delete.json -func ExampleRuleSetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRuleSetsClient().BeginDelete(ctx, "RG", "profile1", "ruleSet1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/RuleSets_ListResourceUsage.json -func ExampleRuleSetsClient_NewListResourceUsagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRuleSetsClient().NewListResourceUsagePager("RG", "profile1", "ruleSet1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UsagesListResult = armcdn.UsagesListResult{ - // Value: []*armcdn.Usage{ - // { - // Name: &armcdn.UsageName{ - // LocalizedValue: to.Ptr("rule"), - // Value: to.Ptr("rule"), - // }, - // CurrentValue: to.Ptr[int64](0), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/rulesets/ruleSet1/rules/rule1"), - // Limit: to.Ptr[int64](25), - // Unit: to.Ptr(armcdn.UsageUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/secrets_client.go b/sdk/resourcemanager/cdn/armcdn/secrets_client.go index 723ba4952d6a..000f64a7541c 100644 --- a/sdk/resourcemanager/cdn/armcdn/secrets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/secrets_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,10 +43,9 @@ func NewSecretsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new Secret within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - secretName - Name of the Secret under the profile. // - secret - The Secret properties. // - options - SecretsClientBeginCreateOptions contains the optional parameters for the SecretsClient.BeginCreate method. @@ -74,7 +70,7 @@ func (client *SecretsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new Secret within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *SecretsClient) create(ctx context.Context, resourceGroupName string, profileName string, secretName string, secret Secret, options *SecretsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "SecretsClient.BeginCreate" @@ -97,7 +93,7 @@ func (client *SecretsClient) create(ctx context.Context, resourceGroupName strin } // createCreateRequest creates the Create request. -func (client *SecretsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, secretName string, secret Secret, options *SecretsClientBeginCreateOptions) (*policy.Request, error) { +func (client *SecretsClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, secretName string, secret Secret, _ *SecretsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -120,7 +116,7 @@ func (client *SecretsClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, secret); err != nil { @@ -132,10 +128,9 @@ func (client *SecretsClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes an existing Secret within profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - secretName - Name of the Secret under the profile. // - options - SecretsClientBeginDeleteOptions contains the optional parameters for the SecretsClient.BeginDelete method. func (client *SecretsClient) BeginDelete(ctx context.Context, resourceGroupName string, profileName string, secretName string, options *SecretsClientBeginDeleteOptions) (*runtime.Poller[SecretsClientDeleteResponse], error) { @@ -159,7 +154,7 @@ func (client *SecretsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes an existing Secret within profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *SecretsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, secretName string, options *SecretsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecretsClient.BeginDelete" @@ -182,7 +177,7 @@ func (client *SecretsClient) deleteOperation(ctx context.Context, resourceGroupN } // deleteCreateRequest creates the Delete request. -func (client *SecretsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, secretName string, options *SecretsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *SecretsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, secretName string, _ *SecretsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -205,7 +200,7 @@ func (client *SecretsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,10 +209,9 @@ func (client *SecretsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets an existing Secret within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - secretName - Name of the Secret under the profile. // - options - SecretsClientGetOptions contains the optional parameters for the SecretsClient.Get method. func (client *SecretsClient) Get(ctx context.Context, resourceGroupName string, profileName string, secretName string, options *SecretsClientGetOptions) (SecretsClientGetResponse, error) { @@ -243,7 +237,7 @@ func (client *SecretsClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *SecretsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, secretName string, options *SecretsClientGetOptions) (*policy.Request, error) { +func (client *SecretsClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, secretName string, _ *SecretsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -266,7 +260,7 @@ func (client *SecretsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,10 +277,9 @@ func (client *SecretsClient) getHandleResponse(resp *http.Response) (SecretsClie // NewListByProfilePager - Lists existing AzureFrontDoor secrets. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - options - SecretsClientListByProfileOptions contains the optional parameters for the SecretsClient.NewListByProfilePager // method. func (client *SecretsClient) NewListByProfilePager(resourceGroupName string, profileName string, options *SecretsClientListByProfileOptions) *runtime.Pager[SecretsClientListByProfileResponse] { @@ -313,7 +306,7 @@ func (client *SecretsClient) NewListByProfilePager(resourceGroupName string, pro } // listByProfileCreateRequest creates the ListByProfile request. -func (client *SecretsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *SecretsClientListByProfileOptions) (*policy.Request, error) { +func (client *SecretsClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *SecretsClientListByProfileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -332,7 +325,7 @@ func (client *SecretsClient) listByProfileCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/secrets_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/secrets_client_example_test.go deleted file mode 100644 index c5ec8ad4d788..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/secrets_client_example_test.go +++ /dev/null @@ -1,209 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Secrets_ListByProfile.json -func ExampleSecretsClient_NewListByProfilePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecretsClient().NewListByProfilePager("RG", "profile1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecretListResult = armcdn.SecretListResult{ - // Value: []*armcdn.Secret{ - // { - // Name: to.Ptr("secret1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/secrets"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/secrets/secret1"), - // Properties: &armcdn.SecretProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Parameters: &armcdn.CustomerCertificateParameters{ - // Type: to.Ptr(armcdn.SecretTypeCustomerCertificate), - // CertificateAuthority: to.Ptr("Symantec"), - // ExpirationDate: to.Ptr("2025-01-01T00:00:00-00:00"), - // SecretSource: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vaults/keyvaultname/secrets/certificatename"), - // }, - // SecretVersion: to.Ptr("abcdef1234578900abcdef1234567890"), - // Subject: to.Ptr("*.contoso.com"), - // SubjectAlternativeNames: []*string{ - // to.Ptr("foo.contoso.com"), - // to.Ptr("www3.foo.contoso.com")}, - // Thumbprint: to.Ptr("ABCDEF1234567890ABCDEF1234567890ABCDEF12"), - // UseLatestVersion: to.Ptr(true), - // }, - // }, - // }, - // { - // Name: to.Ptr("69f05517-6aaf-4a1e-a96d-f8c02f66c756-test12-afdx-test-domains-azfdtest-xyz"), - // Type: to.Ptr("Microsoft.Cdn/profiles/secrets"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/secrets/autogenerated_secret_name"), - // Properties: &armcdn.SecretProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Parameters: &armcdn.ManagedCertificateParameters{ - // Type: to.Ptr(armcdn.SecretTypeManagedCertificate), - // ExpirationDate: to.Ptr("2025-01-01T00:00:00-00:00"), - // Subject: to.Ptr("bar.contoso.com"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Secrets_Get.json -func ExampleSecretsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecretsClient().Get(ctx, "RG", "profile1", "secret1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Secret = armcdn.Secret{ - // Name: to.Ptr("secret1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/secrets"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/secrets/secret1"), - // Properties: &armcdn.SecretProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Parameters: &armcdn.CustomerCertificateParameters{ - // Type: to.Ptr(armcdn.SecretTypeCustomerCertificate), - // CertificateAuthority: to.Ptr("Symantec"), - // ExpirationDate: to.Ptr("2025-01-01T00:00:00-00:00"), - // SecretSource: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vaults/keyvaultname/secrets/certificatename"), - // }, - // SecretVersion: to.Ptr("abcdef1234578900abcdef1234567890"), - // Subject: to.Ptr("*.contoso.com"), - // SubjectAlternativeNames: []*string{ - // to.Ptr("foo.contoso.com"), - // to.Ptr("www3.foo.contoso.com")}, - // Thumbprint: to.Ptr("ABCDEF1234567890ABCDEF1234567890ABCDEF12"), - // UseLatestVersion: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Secrets_Create.json -func ExampleSecretsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecretsClient().BeginCreate(ctx, "RG", "profile1", "secret1", armcdn.Secret{ - Properties: &armcdn.SecretProperties{ - Parameters: &armcdn.CustomerCertificateParameters{ - Type: to.Ptr(armcdn.SecretTypeCustomerCertificate), - SecretSource: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/secrets/certificatename"), - }, - SecretVersion: to.Ptr("abcdef1234578900abcdef1234567890"), - UseLatestVersion: to.Ptr(false), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Secret = armcdn.Secret{ - // Name: to.Ptr("secret1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/secrets"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/secrets/secret1"), - // Properties: &armcdn.SecretProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Parameters: &armcdn.CustomerCertificateParameters{ - // Type: to.Ptr(armcdn.SecretTypeCustomerCertificate), - // CertificateAuthority: to.Ptr("Symantec"), - // ExpirationDate: to.Ptr("2025-01-01T00:00:00-00:00"), - // SecretSource: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vaults/keyvaultname/secrets/certificatename"), - // }, - // SecretVersion: to.Ptr("abcdef1234578900abcdef1234567890"), - // Subject: to.Ptr("*.contoso.com"), - // SubjectAlternativeNames: []*string{ - // to.Ptr("foo.contoso.com"), - // to.Ptr("www3.foo.contoso.com")}, - // Thumbprint: to.Ptr("ABCDEF1234567890ABCDEF1234567890ABCDEF12"), - // UseLatestVersion: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/Secrets_Delete.json -func ExampleSecretsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecretsClient().BeginDelete(ctx, "RG", "profile1", "secret1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go index 389511ae0ea6..bac466e9682c 100644 --- a/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go +++ b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,10 +43,9 @@ func NewSecurityPoliciesClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Creates a new security policy within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - securityPolicyName - Name of the security policy under the profile. // - securityPolicy - The security policy properties. // - options - SecurityPoliciesClientBeginCreateOptions contains the optional parameters for the SecurityPoliciesClient.BeginCreate @@ -75,7 +71,7 @@ func (client *SecurityPoliciesClient) BeginCreate(ctx context.Context, resourceG // Create - Creates a new security policy within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *SecurityPoliciesClient) create(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicy SecurityPolicy, options *SecurityPoliciesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "SecurityPoliciesClient.BeginCreate" @@ -98,7 +94,7 @@ func (client *SecurityPoliciesClient) create(ctx context.Context, resourceGroupN } // createCreateRequest creates the Create request. -func (client *SecurityPoliciesClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicy SecurityPolicy, options *SecurityPoliciesClientBeginCreateOptions) (*policy.Request, error) { +func (client *SecurityPoliciesClient) createCreateRequest(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicy SecurityPolicy, _ *SecurityPoliciesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -121,7 +117,7 @@ func (client *SecurityPoliciesClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityPolicy); err != nil { @@ -133,10 +129,9 @@ func (client *SecurityPoliciesClient) createCreateRequest(ctx context.Context, r // BeginDelete - Deletes an existing security policy within profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - securityPolicyName - Name of the security policy under the profile. // - options - SecurityPoliciesClientBeginDeleteOptions contains the optional parameters for the SecurityPoliciesClient.BeginDelete // method. @@ -161,7 +156,7 @@ func (client *SecurityPoliciesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes an existing security policy within profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *SecurityPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, options *SecurityPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SecurityPoliciesClient.BeginDelete" @@ -184,7 +179,7 @@ func (client *SecurityPoliciesClient) deleteOperation(ctx context.Context, resou } // deleteCreateRequest creates the Delete request. -func (client *SecurityPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, options *SecurityPoliciesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *SecurityPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, _ *SecurityPoliciesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -207,7 +202,7 @@ func (client *SecurityPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,10 +211,9 @@ func (client *SecurityPoliciesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets an existing security policy within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - securityPolicyName - Name of the security policy under the profile. // - options - SecurityPoliciesClientGetOptions contains the optional parameters for the SecurityPoliciesClient.Get method. func (client *SecurityPoliciesClient) Get(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, options *SecurityPoliciesClientGetOptions) (SecurityPoliciesClientGetResponse, error) { @@ -245,7 +239,7 @@ func (client *SecurityPoliciesClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *SecurityPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, options *SecurityPoliciesClientGetOptions) (*policy.Request, error) { +func (client *SecurityPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, _ *SecurityPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -268,7 +262,7 @@ func (client *SecurityPoliciesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,10 +279,9 @@ func (client *SecurityPoliciesClient) getHandleResponse(resp *http.Response) (Se // NewListByProfilePager - Lists security policies associated with the profile // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - options - SecurityPoliciesClientListByProfileOptions contains the optional parameters for the SecurityPoliciesClient.NewListByProfilePager // method. func (client *SecurityPoliciesClient) NewListByProfilePager(resourceGroupName string, profileName string, options *SecurityPoliciesClientListByProfileOptions) *runtime.Pager[SecurityPoliciesClientListByProfileResponse] { @@ -315,7 +308,7 @@ func (client *SecurityPoliciesClient) NewListByProfilePager(resourceGroupName st } // listByProfileCreateRequest creates the ListByProfile request. -func (client *SecurityPoliciesClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *SecurityPoliciesClientListByProfileOptions) (*policy.Request, error) { +func (client *SecurityPoliciesClient) listByProfileCreateRequest(ctx context.Context, resourceGroupName string, profileName string, _ *SecurityPoliciesClientListByProfileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -334,7 +327,7 @@ func (client *SecurityPoliciesClient) listByProfileCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,10 +345,9 @@ func (client *SecurityPoliciesClient) listByProfileHandleResponse(resp *http.Res // BeginPatch - Updates an existing security policy within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource -// group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. // - securityPolicyName - Name of the security policy under the profile. // - securityPolicyUpdateProperties - Security policy update properties // - options - SecurityPoliciesClientBeginPatchOptions contains the optional parameters for the SecurityPoliciesClient.BeginPatch @@ -381,7 +373,7 @@ func (client *SecurityPoliciesClient) BeginPatch(ctx context.Context, resourceGr // Patch - Updates an existing security policy within a profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-02-01 +// Generated from API version 2025-04-15 func (client *SecurityPoliciesClient) patch(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicyUpdateProperties SecurityPolicyUpdateParameters, options *SecurityPoliciesClientBeginPatchOptions) (*http.Response, error) { var err error const operationName = "SecurityPoliciesClient.BeginPatch" @@ -404,7 +396,7 @@ func (client *SecurityPoliciesClient) patch(ctx context.Context, resourceGroupNa } // patchCreateRequest creates the Patch request. -func (client *SecurityPoliciesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicyUpdateProperties SecurityPolicyUpdateParameters, options *SecurityPoliciesClientBeginPatchOptions) (*policy.Request, error) { +func (client *SecurityPoliciesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicyUpdateProperties SecurityPolicyUpdateParameters, _ *SecurityPoliciesClientBeginPatchOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/securityPolicies/{securityPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -427,7 +419,7 @@ func (client *SecurityPoliciesClient) patchCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2025-04-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityPolicyUpdateProperties); err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/securitypolicies_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client_example_test.go deleted file mode 100644 index dc23f825e65e..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/securitypolicies_client_example_test.go +++ /dev/null @@ -1,286 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/SecurityPolicies_ListByProfile.json -func ExampleSecurityPoliciesClient_NewListByProfilePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecurityPoliciesClient().NewListByProfilePager("RG", "profile1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecurityPolicyListResult = armcdn.SecurityPolicyListResult{ - // Value: []*armcdn.SecurityPolicy{ - // { - // Name: to.Ptr("securityPolicy1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/securitypolicies"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/securitypolicies/securityPolicy1"), - // Properties: &armcdn.SecurityPolicyProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Parameters: &armcdn.SecurityPolicyWebApplicationFirewallParameters{ - // Type: to.Ptr(armcdn.SecurityPolicyTypeWebApplicationFirewall), - // Associations: []*armcdn.SecurityPolicyWebApplicationFirewallAssociation{ - // { - // Domains: []*armcdn.ActivatedResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"), - // }}, - // PatternsToMatch: []*string{ - // to.Ptr("/*")}, - // }}, - // WafPolicy: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/SecurityPolicies_Get.json -func ExampleSecurityPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityPoliciesClient().Get(ctx, "RG", "profile1", "securityPolicy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityPolicy = armcdn.SecurityPolicy{ - // Name: to.Ptr("securityPolicy1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/securitypolicies"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/securitypolicies/securityPolicy1"), - // Properties: &armcdn.SecurityPolicyProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Parameters: &armcdn.SecurityPolicyWebApplicationFirewallParameters{ - // Type: to.Ptr(armcdn.SecurityPolicyTypeWebApplicationFirewall), - // Associations: []*armcdn.SecurityPolicyWebApplicationFirewallAssociation{ - // { - // Domains: []*armcdn.ActivatedResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"), - // }}, - // PatternsToMatch: []*string{ - // to.Ptr("/*")}, - // }}, - // WafPolicy: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/SecurityPolicies_Create.json -func ExampleSecurityPoliciesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityPoliciesClient().BeginCreate(ctx, "RG", "profile1", "securityPolicy1", armcdn.SecurityPolicy{ - Properties: &armcdn.SecurityPolicyProperties{ - Parameters: &armcdn.SecurityPolicyWebApplicationFirewallParameters{ - Type: to.Ptr(armcdn.SecurityPolicyTypeWebApplicationFirewall), - Associations: []*armcdn.SecurityPolicyWebApplicationFirewallAssociation{ - { - Domains: []*armcdn.ActivatedResourceReference{ - { - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"), - }}, - PatternsToMatch: []*string{ - to.Ptr("/*")}, - }}, - WafPolicy: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityPolicy = armcdn.SecurityPolicy{ - // Name: to.Ptr("securityPolicy1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/securitypolicies"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/securitypolicies/securityPolicy1"), - // Properties: &armcdn.SecurityPolicyProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Parameters: &armcdn.SecurityPolicyWebApplicationFirewallParameters{ - // Type: to.Ptr(armcdn.SecurityPolicyTypeWebApplicationFirewall), - // Associations: []*armcdn.SecurityPolicyWebApplicationFirewallAssociation{ - // { - // Domains: []*armcdn.ActivatedResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"), - // }}, - // PatternsToMatch: []*string{ - // to.Ptr("/*")}, - // }}, - // WafPolicy: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/SecurityPolicies_Patch.json -func ExampleSecurityPoliciesClient_BeginPatch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityPoliciesClient().BeginPatch(ctx, "RG", "profile1", "securityPolicy1", armcdn.SecurityPolicyUpdateParameters{ - Properties: &armcdn.SecurityPolicyUpdateProperties{ - Parameters: &armcdn.SecurityPolicyWebApplicationFirewallParameters{ - Type: to.Ptr(armcdn.SecurityPolicyTypeWebApplicationFirewall), - Associations: []*armcdn.SecurityPolicyWebApplicationFirewallAssociation{ - { - Domains: []*armcdn.ActivatedResourceReference{ - { - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"), - }}, - PatternsToMatch: []*string{ - to.Ptr("/*")}, - }}, - WafPolicy: &armcdn.ResourceReference{ - ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecurityPolicy = armcdn.SecurityPolicy{ - // Name: to.Ptr("securityPolicy1"), - // Type: to.Ptr("Microsoft.Cdn/profiles/securitypolicies"), - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/securitypolicies/securityPolicy1"), - // Properties: &armcdn.SecurityPolicyProperties{ - // DeploymentStatus: to.Ptr(armcdn.DeploymentStatusNotStarted), - // ProvisioningState: to.Ptr(armcdn.AfdProvisioningStateSucceeded), - // Parameters: &armcdn.SecurityPolicyWebApplicationFirewallParameters{ - // Type: to.Ptr(armcdn.SecurityPolicyTypeWebApplicationFirewall), - // Associations: []*armcdn.SecurityPolicyWebApplicationFirewallAssociation{ - // { - // Domains: []*armcdn.ActivatedResourceReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain1"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/customdomains/testdomain2"), - // }}, - // PatternsToMatch: []*string{ - // to.Ptr("/*")}, - // }}, - // WafPolicy: &armcdn.ResourceReference{ - // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/wafTest"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/cdn/resource-manager/Microsoft.Cdn/stable/2024-02-01/examples/SecurityPolicies_Delete.json -func ExampleSecurityPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSecurityPoliciesClient().BeginDelete(ctx, "RG", "profile1", "securityPolicy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go b/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go index 7219a71a5268..f8333a03693a 100644 --- a/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go +++ b/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string