From 66a2c38b52a7ab2ecfffe610d78ec2955d104a4a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 15 Nov 2024 02:38:40 +0000 Subject: [PATCH] CodeGen from PR 31512 in Azure/azure-rest-api-specs Merge 427b38378041eff7ea244ef8f4c2d5a80803f02c into ff7b8e12e78b352561e2e470dd045be310a313fa --- sdk/resourcemanager/cdn/armcdn/CHANGELOG.md | 152 ++++ sdk/resourcemanager/cdn/armcdn/README.md | 2 +- .../cdn/armcdn/afdcustomdomains_client.go | 32 +- .../afdcustomdomains_client_example_test.go | 294 ------- .../cdn/armcdn/afdendpoints_client.go | 40 +- .../afdendpoints_client_example_test.go | 297 ------- .../cdn/armcdn/afdorigingroups_client.go | 30 +- .../afdorigingroups_client_example_test.go | 288 ------- .../cdn/armcdn/afdorigins_client.go | 26 +- .../armcdn/afdorigins_client_example_test.go | 215 ----- .../cdn/armcdn/afdprofiles_client.go | 22 +- .../armcdn/afdprofiles_client_example_test.go | 194 ----- .../cdn/armcdn/afdx_live_test.go | 2 +- sdk/resourcemanager/cdn/armcdn/autorest.md | 7 +- .../cdn/armcdn/cdn_live_test.go | 2 +- sdk/resourcemanager/cdn/armcdn/constants.go | 604 ++++--------- .../cdn/armcdn/customdomains_client.go | 32 +- .../customdomains_client_example_test.go | 262 ------ .../cdn/armcdn/edgenodes_client.go | 4 +- .../armcdn/edgenodes_client_example_test.go | 132 --- .../cdn/armcdn/endpoints_client.go | 58 +- .../armcdn/endpoints_client_example_test.go | 794 ----------------- .../armcdn/fake/afdcustomdomains_server.go | 2 +- .../cdn/armcdn/fake/afdendpoints_server.go | 2 +- .../cdn/armcdn/fake/afdorigingroups_server.go | 2 +- .../cdn/armcdn/fake/afdorigins_server.go | 2 +- .../cdn/armcdn/fake/afdprofiles_server.go | 2 +- .../cdn/armcdn/fake/customdomains_server.go | 2 +- .../cdn/armcdn/fake/edgenodes_server.go | 2 +- .../cdn/armcdn/fake/endpoints_server.go | 2 +- .../cdn/armcdn/fake/loganalytics_server.go | 2 +- .../cdn/armcdn/fake/managedrulesets_server.go | 2 +- .../cdn/armcdn/fake/management_server.go | 2 +- .../cdn/armcdn/fake/operations_server.go | 2 +- .../cdn/armcdn/fake/origingroups_server.go | 2 +- .../cdn/armcdn/fake/origins_server.go | 2 +- .../cdn/armcdn/fake/policies_server.go | 2 +- .../cdn/armcdn/fake/polymorphic_helpers.go | 2 +- .../cdn/armcdn/fake/profiles_server.go | 162 +++- .../cdn/armcdn/fake/resourceusage_server.go | 2 +- .../cdn/armcdn/fake/routes_server.go | 2 +- .../cdn/armcdn/fake/rules_server.go | 2 +- .../cdn/armcdn/fake/rulesets_server.go | 2 +- .../cdn/armcdn/fake/secrets_server.go | 2 +- .../armcdn/fake/securitypolicies_server.go | 2 +- sdk/resourcemanager/cdn/armcdn/go.mod | 4 +- sdk/resourcemanager/cdn/armcdn/interfaces.go | 46 +- .../cdn/armcdn/loganalytics_client.go | 24 +- .../loganalytics_client_example_test.go | 457 ---------- .../cdn/armcdn/managedrulesets_client.go | 4 +- .../managedrulesets_client_example_test.go | 82 -- .../cdn/armcdn/management_client.go | 16 +- .../armcdn/management_client_example_test.go | 131 --- sdk/resourcemanager/cdn/armcdn/models.go | 413 +++++++-- .../cdn/armcdn/models_serde.go | 233 ++++- .../cdn/armcdn/operations_client.go | 4 +- .../armcdn/operations_client_example_test.go | 126 --- sdk/resourcemanager/cdn/armcdn/options.go | 20 + .../cdn/armcdn/origingroups_client.go | 26 +- .../origingroups_client_example_test.go | 259 ------ .../cdn/armcdn/origins_client.go | 26 +- .../cdn/armcdn/origins_client_example_test.go | 232 ----- .../cdn/armcdn/policies_client.go | 24 +- .../armcdn/policies_client_example_test.go | 798 ------------------ .../cdn/armcdn/polymorphic_helpers.go | 30 +- .../cdn/armcdn/profiles_client.go | 297 ++++++- .../armcdn/profiles_client_example_test.go | 510 ----------- .../cdn/armcdn/resourceusage_client.go | 4 +- .../resourceusage_client_example_test.go | 52 -- sdk/resourcemanager/cdn/armcdn/responses.go | 17 + .../cdn/armcdn/routes_client.go | 26 +- .../cdn/armcdn/routes_client_example_test.go | 354 -------- .../cdn/armcdn/rules_client.go | 26 +- .../cdn/armcdn/rules_client_example_test.go | 311 ------- .../cdn/armcdn/rulesets_client.go | 22 +- .../armcdn/rulesets_client_example_test.go | 172 ---- .../cdn/armcdn/secrets_client.go | 20 +- .../cdn/armcdn/secrets_client_example_test.go | 209 ----- .../cdn/armcdn/securitypolicies_client.go | 26 +- .../securitypolicies_client_example_test.go | 286 ------- 80 files changed, 1628 insertions(+), 7354 deletions(-) delete mode 100644 sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/afdendpoints_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/afdorigingroups_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/afdorigins_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/afdprofiles_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/customdomains_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/edgenodes_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/endpoints_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/loganalytics_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/managedrulesets_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/management_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/origingroups_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/origins_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/policies_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/resourceusage_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/routes_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/rules_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/rulesets_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/secrets_client_example_test.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/securitypolicies_client_example_test.go diff --git a/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md b/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md index afc785f5bf48..32d716d776be 100644 --- a/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md +++ b/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md @@ -1,5 +1,157 @@ # Release History +## 3.0.0 (2024-11-15) +### 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 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 `MigrationEndpointMapping` +- New struct `MigrationToAfdParameters` + + ## 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 efd961445a19..a8f0f08408ba 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..44a9816e0d51 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go @@ -46,7 +46,7 @@ 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 2024-09-01 // - 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. @@ -75,7 +75,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 2024-09-01 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" @@ -121,7 +121,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, customDomain); err != nil { @@ -134,7 +134,7 @@ 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 2024-09-01 // - 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. @@ -163,7 +163,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 2024-09-01 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" @@ -209,7 +209,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -219,7 +219,7 @@ 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 2024-09-01 // - 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. @@ -271,7 +271,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,7 +288,7 @@ func (client *AFDCustomDomainsClient) getHandleResponse(resp *http.Response) (AF // NewListByProfilePager - Lists existing AzureFrontDoor domains. // -// Generated from API version 2024-02-01 +// Generated from API version 2024-09-01 // - 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. @@ -337,7 +337,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -355,7 +355,7 @@ 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 2024-09-01 // - 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. @@ -383,7 +383,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 2024-09-01 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" @@ -429,7 +429,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -438,7 +438,7 @@ 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 2024-09-01 // - 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. @@ -467,7 +467,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 2024-09-01 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" @@ -513,7 +513,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", "2024-09-01") 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..8e70c7186012 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go @@ -47,7 +47,7 @@ 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 2024-09-01 // - 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. @@ -77,7 +77,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 2024-09-01 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" @@ -123,7 +123,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, endpoint); err != nil { @@ -136,7 +136,7 @@ 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 2024-09-01 // - 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. @@ -165,7 +165,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 2024-09-01 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" @@ -211,7 +211,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -221,7 +221,7 @@ 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 2024-09-01 // - 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. @@ -273,7 +273,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -290,7 +290,7 @@ func (client *AFDEndpointsClient) getHandleResponse(resp *http.Response) (AFDEnd // NewListByProfilePager - Lists existing AzureFrontDoor endpoints. // -// Generated from API version 2024-02-01 +// Generated from API version 2024-09-01 // - 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. @@ -339,7 +339,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -356,7 +356,7 @@ 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 2024-09-01 // - 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. @@ -410,7 +410,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -428,7 +428,7 @@ 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 2024-09-01 // - 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. @@ -459,7 +459,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 2024-09-01 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" @@ -505,7 +505,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, contents); err != nil { @@ -520,7 +520,7 @@ 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 2024-09-01 // - 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. @@ -552,7 +552,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 2024-09-01 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" @@ -598,7 +598,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, endpointUpdateProperties); err != nil { @@ -611,7 +611,7 @@ 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 2024-09-01 // - 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. @@ -665,7 +665,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", "2024-09-01") 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..c46afbc5772d 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go @@ -46,7 +46,7 @@ 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 2024-09-01 // - 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. @@ -75,7 +75,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 2024-09-01 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" @@ -121,7 +121,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, originGroup); err != nil { @@ -133,7 +133,7 @@ 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 2024-09-01 // - 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. @@ -161,7 +161,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 2024-09-01 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" @@ -207,7 +207,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,7 +216,7 @@ 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 2024-09-01 // - 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. @@ -268,7 +268,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ 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 2024-09-01 // - 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. @@ -334,7 +334,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ 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 2024-09-01 // - 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. @@ -405,7 +405,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -423,7 +423,7 @@ 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 2024-09-01 // - 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. @@ -452,7 +452,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 2024-09-01 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" @@ -498,7 +498,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", "2024-09-01") 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..a442e31494f2 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go @@ -46,7 +46,7 @@ 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 2024-09-01 // - 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. @@ -75,7 +75,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 2024-09-01 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" @@ -125,7 +125,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, origin); err != nil { @@ -137,7 +137,7 @@ 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 2024-09-01 // - 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. @@ -165,7 +165,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 2024-09-01 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" @@ -215,7 +215,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,7 +224,7 @@ 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 2024-09-01 // - 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. @@ -281,7 +281,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +298,7 @@ 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 2024-09-01 // - 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. @@ -352,7 +352,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,7 +370,7 @@ 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 2024-09-01 // - 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. @@ -399,7 +399,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 2024-09-01 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" @@ -449,7 +449,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", "2024-09-01") 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..ce235cf3614f 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go @@ -47,7 +47,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 2024-09-01 // - 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. @@ -95,7 +95,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkEndpointNameAvailabilityInput); err != nil { @@ -117,7 +117,7 @@ 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 2024-09-01 // - 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. @@ -166,7 +166,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkHostNameAvailabilityInput); err != nil { @@ -186,7 +186,7 @@ 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 2024-09-01 // - 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. @@ -235,7 +235,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +253,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 2024-09-01 // - 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 +280,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 2024-09-01 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" @@ -322,7 +322,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, profileUpgradeParameters); err != nil { @@ -334,7 +334,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 2024-09-01 // - 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. @@ -382,7 +382,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", "2024-09-01") 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/constants.go b/sdk/resourcemanager/cdn/armcdn/constants.go index 9373b83d0cb1..3952e1f59376 100644 --- a/sdk/resourcemanager/cdn/armcdn/constants.go +++ b/sdk/resourcemanager/cdn/armcdn/constants.go @@ -10,7 +10,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. @@ -179,32 +179,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 +209,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 +225,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 +256,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 +288,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 +423,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 +710,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 +742,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 +760,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 +812,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 +841,16 @@ func PossibleIsDeviceOperatorValues() []IsDeviceOperator { } } -type KeyVaultCertificateSourceParametersTypeName string - -const ( - KeyVaultCertificateSourceParametersTypeNameKeyVaultCertificateSourceParameters KeyVaultCertificateSourceParametersTypeName = "KeyVaultCertificateSourceParameters" -) - -// PossibleKeyVaultCertificateSourceParametersTypeNameValues returns the possible values for the KeyVaultCertificateSourceParametersTypeName const type. -func PossibleKeyVaultCertificateSourceParametersTypeNameValues() []KeyVaultCertificateSourceParametersTypeName { - return []KeyVaultCertificateSourceParametersTypeName{ - KeyVaultCertificateSourceParametersTypeNameKeyVaultCertificateSourceParameters, - } -} - -type KeyVaultSigningKeyParametersTypeName string +type KeyVaultSigningKeyParametersType string const ( - KeyVaultSigningKeyParametersTypeNameKeyVaultSigningKeyParameters KeyVaultSigningKeyParametersTypeName = "KeyVaultSigningKeyParameters" + KeyVaultSigningKeyParametersTypeKeyVaultSigningKeyParameters KeyVaultSigningKeyParametersType = "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 +1191,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 +1368,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 +1584,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 +1636,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 +1654,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 +1686,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 +1718,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 +1757,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 +1771,18 @@ func PossibleRequestSchemeMatchConditionParametersOperatorValues() []RequestSche } } -type RequestSchemeMatchConditionParametersTypeName string - -const ( - RequestSchemeMatchConditionParametersTypeNameDeliveryRuleRequestSchemeConditionParameters RequestSchemeMatchConditionParametersTypeName = "DeliveryRuleRequestSchemeConditionParameters" -) - -// PossibleRequestSchemeMatchConditionParametersTypeNameValues returns the possible values for the RequestSchemeMatchConditionParametersTypeName const type. -func PossibleRequestSchemeMatchConditionParametersTypeNameValues() []RequestSchemeMatchConditionParametersTypeName { - return []RequestSchemeMatchConditionParametersTypeName{ - RequestSchemeMatchConditionParametersTypeNameDeliveryRuleRequestSchemeConditionParameters, - } -} - -type RequestURIMatchConditionParametersTypeName string +type RequestSchemeMatchValue string const ( - RequestURIMatchConditionParametersTypeNameDeliveryRuleRequestURIConditionParameters RequestURIMatchConditionParametersTypeName = "DeliveryRuleRequestUriConditionParameters" + RequestSchemeMatchValueHTTP RequestSchemeMatchValue = "HTTP" + RequestSchemeMatchValueHTTPS RequestSchemeMatchValue = "HTTPS" ) -// 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 +1866,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 +1980,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 +2077,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 +2132,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 +2216,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 +2248,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 +2280,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 +2314,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..cb39e775daed 100644 --- a/sdk/resourcemanager/cdn/armcdn/customdomains_client.go +++ b/sdk/resourcemanager/cdn/armcdn/customdomains_client.go @@ -46,7 +46,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 2024-09-01 // - 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 +74,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 2024-09-01 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" @@ -124,7 +124,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, customDomainProperties); err != nil { @@ -136,7 +136,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 2024-09-01 // - 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 +163,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 2024-09-01 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" @@ -213,7 +213,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -222,7 +222,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 2024-09-01 // - 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 +249,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 2024-09-01 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" @@ -299,7 +299,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,7 +308,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 2024-09-01 // - 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 +335,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 2024-09-01 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 +385,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CustomDomainHTTPSParameters != nil { @@ -400,7 +400,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 2024-09-01 // - 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. @@ -456,7 +456,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -473,7 +473,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 2024-09-01 // - 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. @@ -526,7 +526,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", "2024-09-01") 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..4fb976801036 100644 --- a/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go +++ b/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go @@ -39,7 +39,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 2024-09-01 // - 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]{ @@ -72,7 +72,7 @@ func (client *EdgeNodesClient) listCreateRequest(ctx context.Context, options *E return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2024-09-01") 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..02c52776efe2 100644 --- a/sdk/resourcemanager/cdn/armcdn/endpoints_client.go +++ b/sdk/resourcemanager/cdn/armcdn/endpoints_client.go @@ -47,7 +47,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 2024-09-01 // - 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 +74,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 2024-09-01 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" @@ -120,7 +120,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, endpoint); err != nil { @@ -133,7 +133,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 2024-09-01 // - 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 +159,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 2024-09-01 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" @@ -205,7 +205,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-09-01 // - 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. @@ -266,7 +266,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,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 2024-09-01 // - 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 @@ -331,7 +331,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +348,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 2024-09-01 // - 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. @@ -401,7 +401,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -419,7 +419,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 2024-09-01 // - 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 +447,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 2024-09-01 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" @@ -493,7 +493,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, contentFilePaths); err != nil { @@ -505,7 +505,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 2024-09-01 // - 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 +534,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 2024-09-01 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" @@ -580,7 +580,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, contentFilePaths); err != nil { @@ -592,7 +592,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 2024-09-01 // - 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 +617,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 2024-09-01 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" @@ -663,7 +663,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -672,7 +672,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 2024-09-01 // - 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 +697,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 2024-09-01 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" @@ -743,7 +743,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -755,7 +755,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 2024-09-01 // - 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 +784,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 2024-09-01 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" @@ -830,7 +830,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, endpointUpdateProperties); err != nil { @@ -842,7 +842,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 2024-09-01 // - 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. @@ -895,7 +895,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", "2024-09-01") 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..4bb46b088291 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdcustomdomains_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdcustomdomains_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/afdendpoints_server.go b/sdk/resourcemanager/cdn/armcdn/fake/afdendpoints_server.go index 0d41a8e7e868..e9b00697cb5a 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdendpoints_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdendpoints_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/afdorigingroups_server.go b/sdk/resourcemanager/cdn/armcdn/fake/afdorigingroups_server.go index eb9a62314d84..b705b75e4965 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdorigingroups_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdorigingroups_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/afdorigins_server.go b/sdk/resourcemanager/cdn/armcdn/fake/afdorigins_server.go index 0f078e43ba36..ac11172873f1 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdorigins_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdorigins_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/afdprofiles_server.go b/sdk/resourcemanager/cdn/armcdn/fake/afdprofiles_server.go index 2705d16fd7d0..ae80c577809b 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/afdprofiles_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/afdprofiles_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/customdomains_server.go b/sdk/resourcemanager/cdn/armcdn/fake/customdomains_server.go index c527697fda24..fa15102e5279 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/customdomains_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/customdomains_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/edgenodes_server.go b/sdk/resourcemanager/cdn/armcdn/fake/edgenodes_server.go index 74ab17437ce1..12e81e32b93f 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/edgenodes_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/edgenodes_server.go @@ -15,7 +15,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" ) diff --git a/sdk/resourcemanager/cdn/armcdn/fake/endpoints_server.go b/sdk/resourcemanager/cdn/armcdn/fake/endpoints_server.go index ba0342c7f429..afad9b314991 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/endpoints_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/endpoints_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/loganalytics_server.go b/sdk/resourcemanager/cdn/armcdn/fake/loganalytics_server.go index 9348004032ae..4bb922717b1f 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/loganalytics_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/loganalytics_server.go @@ -15,7 +15,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/managedrulesets_server.go b/sdk/resourcemanager/cdn/armcdn/fake/managedrulesets_server.go index 8c589742a302..68a445766c52 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/managedrulesets_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/managedrulesets_server.go @@ -15,7 +15,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" ) diff --git a/sdk/resourcemanager/cdn/armcdn/fake/management_server.go b/sdk/resourcemanager/cdn/armcdn/fake/management_server.go index d57afe006f70..cb7c0d49be6b 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/management_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/management_server.go @@ -15,7 +15,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/operations_server.go b/sdk/resourcemanager/cdn/armcdn/fake/operations_server.go index f4de089ed641..00b45d4bd644 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/operations_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/operations_server.go @@ -15,7 +15,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" ) diff --git a/sdk/resourcemanager/cdn/armcdn/fake/origingroups_server.go b/sdk/resourcemanager/cdn/armcdn/fake/origingroups_server.go index ac27d5136716..1f27febc1978 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/origingroups_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/origingroups_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/origins_server.go b/sdk/resourcemanager/cdn/armcdn/fake/origins_server.go index 57b03b604561..2029174847b3 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/origins_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/origins_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/policies_server.go b/sdk/resourcemanager/cdn/armcdn/fake/policies_server.go index 167722882268..2232cf23dbc4 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/policies_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/policies_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/polymorphic_helpers.go b/sdk/resourcemanager/cdn/armcdn/fake/polymorphic_helpers.go index 61a3ae012697..1d1f8b7b4d93 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/polymorphic_helpers.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/polymorphic_helpers.go @@ -10,7 +10,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..133060463e86 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/profiles_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/profiles_server.go @@ -16,7 +16,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 +28,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,6 +72,10 @@ 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.StatusAccepted + 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 BeginMigrationCommit func(ctx context.Context, resourceGroupName string, profileName string, options *armcdn.ProfilesClientBeginMigrationCommitOptions) (resp azfake.PollerResponder[armcdn.ProfilesClientMigrationCommitResponse], errResp azfake.ErrorResponder) @@ -80,12 +92,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 +111,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]] } @@ -120,6 +138,10 @@ func (p *ProfilesServerTransport) Do(req *http.Request) (*http.Response, error) switch method { case "ProfilesClient.BeginCanMigrate": resp, err = p.dispatchBeginCanMigrate(req) + case "ProfilesClient.BeginCdnCanMigrateToAfd": + resp, err = p.dispatchBeginCdnCanMigrateToAfd(req) + case "ProfilesClient.BeginCdnMigrateToAfd": + resp, err = p.dispatchBeginCdnMigrateToAfd(req) case "ProfilesClient.BeginCreate": resp, err = p.dispatchBeginCreate(req) case "ProfilesClient.BeginDelete": @@ -138,6 +160,8 @@ func (p *ProfilesServerTransport) Do(req *http.Request) (*http.Response, error) resp, err = p.dispatchListSupportedOptimizationTypes(req) case "ProfilesClient.BeginMigrate": resp, err = p.dispatchBeginMigrate(req) + case "ProfilesClient.BeginMigrationAbort": + resp, err = p.dispatchBeginMigrationAbort(req) case "ProfilesClient.BeginMigrationCommit": resp, err = p.dispatchBeginMigrationCommit(req) case "ProfilesClient.BeginUpdate": @@ -197,6 +221,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 +659,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.StatusAccepted}, resp.StatusCode) { + p.beginMigrationAbort.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", 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")} diff --git a/sdk/resourcemanager/cdn/armcdn/fake/resourceusage_server.go b/sdk/resourcemanager/cdn/armcdn/fake/resourceusage_server.go index dce9e421eb98..24d6764ed87b 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/resourceusage_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/resourceusage_server.go @@ -15,7 +15,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" ) diff --git a/sdk/resourcemanager/cdn/armcdn/fake/routes_server.go b/sdk/resourcemanager/cdn/armcdn/fake/routes_server.go index 443f17c01649..d266b083ba39 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/routes_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/routes_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/rules_server.go b/sdk/resourcemanager/cdn/armcdn/fake/rules_server.go index 7f14d5f6d60c..b0ebabef3760 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/rules_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/rules_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/rulesets_server.go b/sdk/resourcemanager/cdn/armcdn/fake/rulesets_server.go index bd7bcaa7a6d5..62028d3d516c 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/rulesets_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/rulesets_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/secrets_server.go b/sdk/resourcemanager/cdn/armcdn/fake/secrets_server.go index 56a948651d93..678f8a7dc677 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/secrets_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/secrets_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/fake/securitypolicies_server.go b/sdk/resourcemanager/cdn/armcdn/fake/securitypolicies_server.go index d4ce8961895d..f993d4c0d714 100644 --- a/sdk/resourcemanager/cdn/armcdn/fake/securitypolicies_server.go +++ b/sdk/resourcemanager/cdn/armcdn/fake/securitypolicies_server.go @@ -16,7 +16,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" diff --git a/sdk/resourcemanager/cdn/armcdn/go.mod b/sdk/resourcemanager/cdn/armcdn/go.mod index d5e7a13ce01a..cab8bfe22484 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.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/stretchr/testify v1.9.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // 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.2.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..6fa0fe2f5081 100644 --- a/sdk/resourcemanager/cdn/armcdn/interfaces.go +++ b/sdk/resourcemanager/cdn/armcdn/interfaces.go @@ -8,6 +8,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 +26,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 +61,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..555b47ae13ee 100644 --- a/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go +++ b/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go @@ -48,7 +48,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 2024-09-01 // - 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. @@ -96,7 +96,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,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 2024-09-01 // - 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 +162,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", "2024-09-01") if options != nil && options.Continents != nil { for _, qv := range options.Continents { reqQP.Add("continents", qv) @@ -207,7 +207,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 2024-09-01 // - 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 +255,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", "2024-09-01") if options != nil && options.CustomDomains != nil { for _, qv := range options.CustomDomains { reqQP.Add("customDomains", qv) @@ -287,7 +287,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 2024-09-01 // - 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. @@ -335,7 +335,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,7 +353,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 2024-09-01 // - 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 +406,7 @@ func (client *LogAnalyticsClient) getWafLogAnalyticsMetricsCreateRequest(ctx con reqQP.Add("actions", string(qv)) } } - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2024-09-01") reqQP.Set("dateTimeBegin", dateTimeBegin.Format(time.RFC3339Nano)) reqQP.Set("dateTimeEnd", dateTimeEnd.Format(time.RFC3339Nano)) reqQP.Set("granularity", string(granularity)) @@ -440,7 +440,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 2024-09-01 // - 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 +493,7 @@ func (client *LogAnalyticsClient) getWafLogAnalyticsRankingsCreateRequest(ctx co reqQP.Add("actions", string(qv)) } } - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2024-09-01") 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..ebe92f1f217f 100644 --- a/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go @@ -45,7 +45,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 2024-09-01 // - options - ManagedRuleSetsClientListOptions contains the optional parameters for the ManagedRuleSetsClient.NewListPager // method. func (client *ManagedRuleSetsClient) NewListPager(options *ManagedRuleSetsClientListOptions) *runtime.Pager[ManagedRuleSetsClientListResponse] { @@ -83,7 +83,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", "2024-09-01") 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..dbcaf7f77a86 100644 --- a/sdk/resourcemanager/cdn/armcdn/management_client.go +++ b/sdk/resourcemanager/cdn/armcdn/management_client.go @@ -47,7 +47,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 2024-09-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - checkEndpointNameAvailabilityInput - Input to check. // - options - ManagementClientCheckEndpointNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckEndpointNameAvailability @@ -90,7 +90,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkEndpointNameAvailabilityInput); err != nil { @@ -112,7 +112,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 2024-09-01 // - checkNameAvailabilityInput - Input to check. // - options - ManagementClientCheckNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckNameAvailability // method. @@ -146,7 +146,7 @@ func (client *ManagementClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { @@ -168,7 +168,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 2024-09-01 // - checkNameAvailabilityInput - Input to check. // - options - ManagementClientCheckNameAvailabilityWithSubscriptionOptions contains the optional parameters for the ManagementClient.CheckNameAvailabilityWithSubscription // method. @@ -206,7 +206,7 @@ func (client *ManagementClient) checkNameAvailabilityWithSubscriptionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { @@ -229,7 +229,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 2024-09-01 // - validateProbeInput - Input to check. // - options - ManagementClientValidateProbeOptions contains the optional parameters for the ManagementClient.ValidateProbe // method. @@ -267,7 +267,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", "2024-09-01") 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..b53e59f92688 100644 --- a/sdk/resourcemanager/cdn/armcdn/models.go +++ b/sdk/resourcemanager/cdn/armcdn/models.go @@ -488,24 +488,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 +553,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 +644,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 +656,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 +711,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 +726,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 +979,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 +993,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 +1032,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 +1070,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 +1212,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 +1292,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 +1309,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 +1697,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 +1709,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 +1725,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 +1759,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 +1771,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 +1796,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 +1808,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 +1831,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 +1843,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 +1865,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 +2180,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 +2221,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 +2349,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 +2368,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 +2553,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 +2568,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 +2713,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 +2725,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 +2791,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 +2804,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 +2829,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 +2857,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 +2882,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 +2907,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 +2932,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 +3030,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 +3039,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 +3179,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 +3252,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 +3294,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 +3306,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 +3467,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 +3479,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 +3520,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 +3532,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 +3578,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 +3590,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 +3615,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 +3640,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 +3669,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 +3690,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 +3723,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 +3755,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 +3764,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 +3791,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..3c2e25b15dab 100644 --- a/sdk/resourcemanager/cdn/armcdn/models_serde.go +++ b/sdk/resourcemanager/cdn/armcdn/models_serde.go @@ -1079,7 +1079,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 +1117,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 +1248,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 +1275,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 +1507,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 +1768,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 +2404,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 +2423,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 +2450,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 +2511,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 +2597,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 +2875,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 +3030,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 +3061,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 +3868,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 +3909,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 +3989,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 +4067,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 +4111,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 +5077,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 +5186,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 +5539,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 +5571,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 +5966,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 +6374,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 +6627,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 +6670,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 +6714,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 +6760,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 +6803,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 +6846,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 +7210,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 +7545,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 +7730,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 +7786,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 +8229,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 +8346,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 +8490,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 +8533,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 +8576,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 +8615,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 +8652,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 +8697,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 +8731,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 +8767,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 +8800,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..e9359a2e69ed 100644 --- a/sdk/resourcemanager/cdn/armcdn/operations_client.go +++ b/sdk/resourcemanager/cdn/armcdn/operations_client.go @@ -39,7 +39,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 2024-09-01 // - 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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-02-01") + reqQP.Set("api-version", "2024-09-01") 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..010561a0804d 100644 --- a/sdk/resourcemanager/cdn/armcdn/options.go +++ b/sdk/resourcemanager/cdn/armcdn/options.go @@ -460,6 +460,20 @@ type ProfilesClientBeginCanMigrateOptions struct { ResumeToken string } +// ProfilesClientBeginCdnCanMigrateToAfdOptions contains the optional parameters for the ProfilesClient.BeginCdnCanMigrateToAfd +// method. +type ProfilesClientBeginCdnCanMigrateToAfdOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ProfilesClientBeginCdnMigrateToAfdOptions contains the optional parameters for the ProfilesClient.BeginCdnMigrateToAfd +// method. +type ProfilesClientBeginCdnMigrateToAfdOptions struct { + // Resumes the LRO 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. @@ -478,6 +492,12 @@ type ProfilesClientBeginMigrateOptions struct { ResumeToken string } +// ProfilesClientBeginMigrationAbortOptions contains the optional parameters for the ProfilesClient.BeginMigrationAbort method. +type ProfilesClientBeginMigrationAbortOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ProfilesClientBeginMigrationCommitOptions contains the optional parameters for the ProfilesClient.BeginMigrationCommit // method. type ProfilesClientBeginMigrationCommitOptions struct { diff --git a/sdk/resourcemanager/cdn/armcdn/origingroups_client.go b/sdk/resourcemanager/cdn/armcdn/origingroups_client.go index c8943e2c27c7..7bcb8fde1a05 100644 --- a/sdk/resourcemanager/cdn/armcdn/origingroups_client.go +++ b/sdk/resourcemanager/cdn/armcdn/origingroups_client.go @@ -46,7 +46,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 2024-09-01 // - 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 +74,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 2024-09-01 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" @@ -124,7 +124,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, originGroup); err != nil { @@ -136,7 +136,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 2024-09-01 // - 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 +163,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 2024-09-01 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" @@ -213,7 +213,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -222,7 +222,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 2024-09-01 // - 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. @@ -278,7 +278,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -295,7 +295,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 2024-09-01 // - 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. @@ -348,7 +348,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -366,7 +366,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 2024-09-01 // - 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 +394,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 2024-09-01 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" @@ -444,7 +444,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", "2024-09-01") 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..830c2c48fc61 100644 --- a/sdk/resourcemanager/cdn/armcdn/origins_client.go +++ b/sdk/resourcemanager/cdn/armcdn/origins_client.go @@ -46,7 +46,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 2024-09-01 // - 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 +73,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 2024-09-01 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" @@ -123,7 +123,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, origin); err != nil { @@ -135,7 +135,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 2024-09-01 // - 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 +161,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 2024-09-01 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" @@ -211,7 +211,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,7 +220,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 2024-09-01 // - 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. @@ -276,7 +276,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,7 +293,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 2024-09-01 // - 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. @@ -346,7 +346,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +364,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 2024-09-01 // - 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 +391,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 2024-09-01 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" @@ -441,7 +441,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", "2024-09-01") 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..b38f3666792b 100644 --- a/sdk/resourcemanager/cdn/armcdn/policies_client.go +++ b/sdk/resourcemanager/cdn/armcdn/policies_client.go @@ -46,7 +46,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 2024-09-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - cdnWebApplicationFirewallPolicy - Policy to be created. @@ -72,7 +72,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 2024-09-01 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" @@ -114,7 +114,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cdnWebApplicationFirewallPolicy); err != nil { @@ -126,7 +126,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 2024-09-01 // - 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. @@ -171,7 +171,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,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 2024-09-01 // - 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. @@ -226,7 +226,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,7 +243,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 2024-09-01 // - 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] { @@ -285,7 +285,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +304,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 2024-09-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - cdnWebApplicationFirewallPolicyPatchParameters - CdnWebApplicationFirewallPolicy parameters to be patched. @@ -330,7 +330,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 2024-09-01 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" @@ -372,7 +372,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", "2024-09-01") 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..75adaf4afa3c 100644 --- a/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go +++ b/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go @@ -33,7 +33,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 +41,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 +70,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 +78,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..02082f93e563 100644 --- a/sdk/resourcemanager/cdn/armcdn/profiles_client.go +++ b/sdk/resourcemanager/cdn/armcdn/profiles_client.go @@ -46,7 +46,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 2024-09-01 // - 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 +72,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 2024-09-01 func (client *ProfilesClient) canMigrate(ctx context.Context, resourceGroupName string, canMigrateParameters CanMigrateParameters, options *ProfilesClientBeginCanMigrateOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginCanMigrate" @@ -110,7 +110,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, canMigrateParameters); err != nil { @@ -119,11 +119,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 2024-09-01 +// - 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 2024-09-01 +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, options *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", "2024-09-01") + 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 2024-09-01 +// - 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 2024-09-01 +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, options *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", "2024-09-01") + 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 2024-09-01 // - 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 +310,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 2024-09-01 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" @@ -192,7 +352,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, profile); err != nil { @@ -206,7 +366,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 2024-09-01 // - 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 +393,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 2024-09-01 func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginDelete" @@ -275,7 +435,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +447,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 2024-09-01 // - 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. @@ -333,7 +493,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +512,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 2024-09-01 // - 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. @@ -399,7 +559,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -416,7 +576,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 2024-09-01 // - 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]{ @@ -453,7 +613,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -471,7 +631,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 2024-09-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - options - ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.NewListByResourceGroupPager // method. @@ -514,7 +674,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -532,7 +692,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 2024-09-01 // - 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. @@ -581,7 +741,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -600,7 +760,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 2024-09-01 // - 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. @@ -648,7 +808,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -667,7 +827,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 2024-09-01 // - 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 +852,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 2024-09-01 func (client *ProfilesClient) migrate(ctx context.Context, resourceGroupName string, migrationParameters MigrationParameters, options *ProfilesClientBeginMigrateOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginMigrate" @@ -730,7 +890,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, migrationParameters); err != nil { @@ -739,10 +899,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 2024-09-01 +// - 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 2024-09-01 +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, options *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", "2024-09-01") + 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 2024-09-01 // - 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 +1005,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 2024-09-01 func (client *ProfilesClient) migrationCommit(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginMigrationCommitOptions) (*http.Response, error) { var err error const operationName = "ProfilesClient.BeginMigrationCommit" @@ -810,7 +1047,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -820,7 +1057,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 2024-09-01 // - 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 +1084,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 2024-09-01 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" @@ -889,7 +1126,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", "2024-09-01") 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..a9d8f6186b29 100644 --- a/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go +++ b/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go @@ -45,7 +45,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 2024-09-01 // - 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]{ @@ -82,7 +82,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", "2024-09-01") 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..6793b0ae583d 100644 --- a/sdk/resourcemanager/cdn/armcdn/responses.go +++ b/sdk/resourcemanager/cdn/armcdn/responses.go @@ -474,6 +474,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 +539,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..9d61d5752b72 100644 --- a/sdk/resourcemanager/cdn/armcdn/routes_client.go +++ b/sdk/resourcemanager/cdn/armcdn/routes_client.go @@ -47,7 +47,7 @@ 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 2024-09-01 // - 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. @@ -77,7 +77,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 2024-09-01 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" @@ -127,7 +127,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, route); err != nil { @@ -140,7 +140,7 @@ 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 2024-09-01 // - 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. @@ -169,7 +169,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 2024-09-01 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" @@ -219,7 +219,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,7 +229,7 @@ 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 2024-09-01 // - 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. @@ -286,7 +286,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +303,7 @@ 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 2024-09-01 // - 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. @@ -357,7 +357,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -376,7 +376,7 @@ 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 2024-09-01 // - 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. @@ -406,7 +406,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 2024-09-01 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" @@ -456,7 +456,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", "2024-09-01") 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..77aa64c919b6 100644 --- a/sdk/resourcemanager/cdn/armcdn/rules_client.go +++ b/sdk/resourcemanager/cdn/armcdn/rules_client.go @@ -46,7 +46,7 @@ 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 2024-09-01 // - 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. @@ -75,7 +75,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 2024-09-01 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" @@ -125,7 +125,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, rule); err != nil { @@ -137,7 +137,7 @@ 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 2024-09-01 // - 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. @@ -165,7 +165,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 2024-09-01 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" @@ -215,7 +215,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,7 +224,7 @@ 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 2024-09-01 // - 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. @@ -281,7 +281,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +298,7 @@ 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 2024-09-01 // - 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. @@ -351,7 +351,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -369,7 +369,7 @@ 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 2024-09-01 // - 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. @@ -398,7 +398,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 2024-09-01 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" @@ -448,7 +448,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", "2024-09-01") 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..a53c3abae571 100644 --- a/sdk/resourcemanager/cdn/armcdn/rulesets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/rulesets_client.go @@ -46,7 +46,7 @@ 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 2024-09-01 // - 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. @@ -98,7 +98,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ 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 2024-09-01 // - 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. @@ -145,7 +145,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 2024-09-01 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" @@ -191,7 +191,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ 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 2024-09-01 // - 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. @@ -253,7 +253,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ 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 2024-09-01 // - 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. @@ -319,7 +319,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,7 +336,7 @@ 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 2024-09-01 // - 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. @@ -390,7 +390,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", "2024-09-01") 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..0cbd62d142cf 100644 --- a/sdk/resourcemanager/cdn/armcdn/secrets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/secrets_client.go @@ -46,7 +46,7 @@ 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 2024-09-01 // - 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. @@ -74,7 +74,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 2024-09-01 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" @@ -120,7 +120,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, secret); err != nil { @@ -132,7 +132,7 @@ 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 2024-09-01 // - 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. @@ -159,7 +159,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 2024-09-01 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" @@ -205,7 +205,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ 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 2024-09-01 // - 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. @@ -266,7 +266,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *SecretsClient) getHandleResponse(resp *http.Response) (SecretsClie // NewListByProfilePager - Lists existing AzureFrontDoor secrets. // -// Generated from API version 2024-02-01 +// Generated from API version 2024-09-01 // - 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. @@ -332,7 +332,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", "2024-09-01") 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..0438b0b173d2 100644 --- a/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go +++ b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go @@ -46,7 +46,7 @@ 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 2024-09-01 // - 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. @@ -75,7 +75,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 2024-09-01 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" @@ -121,7 +121,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityPolicy); err != nil { @@ -133,7 +133,7 @@ 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 2024-09-01 // - 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. @@ -161,7 +161,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 2024-09-01 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" @@ -207,7 +207,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,7 +216,7 @@ 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 2024-09-01 // - 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. @@ -268,7 +268,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ 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 2024-09-01 // - 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. @@ -334,7 +334,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", "2024-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +352,7 @@ 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 2024-09-01 // - 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. @@ -381,7 +381,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 2024-09-01 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" @@ -427,7 +427,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", "2024-09-01") 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) - } -}