From 9789df917678f3cb34b3431c10310d4003c27561 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 9 Nov 2023 02:00:49 +0000 Subject: [PATCH] CodeGen from PR 26619 in Azure/azure-rest-api-specs Merge b341dc814e0069eebbf32ca59f9b32603c85eb53 into ed84b11847785792767b0b84cc6f98f4ea08ca77 --- sdk/resourcemanager/cdn/armcdn/CHANGELOG.md | 141 ++++ .../afdcustomdomains_client_example_test.go | 294 ------- .../afdendpoints_client_example_test.go | 297 ------- .../afdorigingroups_client_example_test.go | 288 ------- .../armcdn/afdorigins_client_example_test.go | 215 ----- .../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 | 490 +++++------ .../customdomains_client_example_test.go | 262 ------ .../armcdn/edgenodes_client_example_test.go | 132 --- .../armcdn/endpoints_client_example_test.go | 794 ----------------- sdk/resourcemanager/cdn/armcdn/go.mod | 4 +- sdk/resourcemanager/cdn/armcdn/interfaces.go | 12 +- .../loganalytics_client_example_test.go | 457 ---------- .../managedrulesets_client_example_test.go | 82 -- .../armcdn/management_client_example_test.go | 131 --- sdk/resourcemanager/cdn/armcdn/models.go | 156 ++-- .../cdn/armcdn/models_serde.go | 32 +- .../armcdn/operations_client_example_test.go | 126 --- .../origingroups_client_example_test.go | 259 ------ .../cdn/armcdn/origins_client_example_test.go | 232 ----- .../armcdn/policies_client_example_test.go | 798 ------------------ .../cdn/armcdn/polymorphic_helpers.go | 30 +- .../armcdn/profiles_client_example_test.go | 480 ----------- .../resourceusage_client_example_test.go | 52 -- .../cdn/armcdn/routes_client_example_test.go | 354 -------- .../cdn/armcdn/rules_client_example_test.go | 311 ------- .../armcdn/rulesets_client_example_test.go | 172 ---- .../cdn/armcdn/secrets_client_example_test.go | 209 ----- .../securitypolicies_client_example_test.go | 286 ------- 32 files changed, 507 insertions(+), 6794 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 b69d10a60f37..bfd04d258dd6 100644 --- a/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md +++ b/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md @@ -1,5 +1,146 @@ # Release History +## 3.0.0 (2023-11-09) +### Breaking Changes + +- Type of `CacheExpirationActionParameters.TypeName` has been changed from `*CacheExpirationActionParametersTypeName` to `*CacheExpirationActionParametersType` +- Type of `CacheKeyQueryStringActionParameters.TypeName` has been changed from `*CacheKeyQueryStringActionParametersTypeName` to `*CacheKeyQueryStringActionParametersType` +- Type of `CertificateSourceParameters.TypeName` has been changed from `*CdnCertificateSourceParametersTypeName` to `*CdnCertificateSourceParametersType` +- Type of `ClientPortMatchConditionParameters.TypeName` has been changed from `*ClientPortMatchConditionParametersTypeName` to `*ClientPortMatchConditionParametersType` +- Type of `CookiesMatchConditionParameters.TypeName` has been changed from `*CookiesMatchConditionParametersTypeName` to `*CookiesMatchConditionParametersType` +- 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 `*HTTPVersionMatchConditionParametersType` +- Type of `HeaderActionParameters.TypeName` has been changed from `*HeaderActionParametersTypeName` to `*HeaderActionParametersType` +- Type of `HostNameMatchConditionParameters.TypeName` has been changed from `*HostNameMatchConditionParametersTypeName` to `*HostNameMatchConditionParametersType` +- Type of `IsDeviceMatchConditionParameters.MatchValues` has been changed from `[]*IsDeviceMatchConditionParametersMatchValuesItem` to `[]*IsDeviceMatchValue` +- Type of `IsDeviceMatchConditionParameters.TypeName` has been changed from `*IsDeviceMatchConditionParametersTypeName` to `*IsDeviceMatchConditionParametersType` +- Type of `KeyVaultCertificateSourceParameters.TypeName` has been changed from `*KeyVaultCertificateSourceParametersTypeName` to `*KeyVaultCertificateSourceParametersType` +- 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 `*OriginGroupOverrideActionParametersType` +- Type of `PostArgsMatchConditionParameters.TypeName` has been changed from `*PostArgsMatchConditionParametersTypeName` to `*PostArgsMatchConditionParametersType` +- Type of `QueryStringMatchConditionParameters.TypeName` has been changed from `*QueryStringMatchConditionParametersTypeName` to `*QueryStringMatchConditionParametersType` +- Type of `RemoteAddressMatchConditionParameters.TypeName` has been changed from `*RemoteAddressMatchConditionParametersTypeName` to `*RemoteAddressMatchConditionParametersType` +- Type of `RequestBodyMatchConditionParameters.TypeName` has been changed from `*RequestBodyMatchConditionParametersTypeName` to `*RequestBodyMatchConditionParametersType` +- Type of `RequestHeaderMatchConditionParameters.TypeName` has been changed from `*RequestHeaderMatchConditionParametersTypeName` to `*RequestHeaderMatchConditionParametersType` +- Type of `RequestMethodMatchConditionParameters.MatchValues` has been changed from `[]*RequestMethodMatchConditionParametersMatchValuesItem` to `[]*RequestMethodMatchValue` +- Type of `RequestMethodMatchConditionParameters.TypeName` has been changed from `*RequestMethodMatchConditionParametersTypeName` to `*RequestMethodMatchConditionParametersType` +- Type of `RequestSchemeMatchConditionParameters.MatchValues` has been changed from `[]*RequestSchemeMatchConditionParametersMatchValuesItem` to `[]*RequestSchemeMatchValue` +- Type of `RequestSchemeMatchConditionParameters.TypeName` has been changed from `*RequestSchemeMatchConditionParametersTypeName` to `*RequestSchemeMatchConditionParametersType` +- Type of `RequestURIMatchConditionParameters.TypeName` has been changed from `*RequestURIMatchConditionParametersTypeName` to `*RequestURIMatchConditionParametersType` +- Type of `RouteConfigurationOverrideActionParameters.TypeName` has been changed from `*RouteConfigurationOverrideActionParametersTypeName` to `*RouteConfigurationOverrideActionParametersType` +- 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 `*SSLProtocolMatchConditionParametersType` +- Type of `ServerPortMatchConditionParameters.TypeName` has been changed from `*ServerPortMatchConditionParametersTypeName` to `*ServerPortMatchConditionParametersType` +- Type of `SocketAddrMatchConditionParameters.TypeName` has been changed from `*SocketAddrMatchConditionParametersTypeName` to `*SocketAddrMatchConditionParametersType` +- Type of `URLFileExtensionMatchConditionParameters.TypeName` has been changed from `*URLFileExtensionMatchConditionParametersTypeName` to `*URLFileExtensionMatchConditionParametersType` +- Type of `URLFileNameMatchConditionParameters.TypeName` has been changed from `*URLFileNameMatchConditionParametersTypeName` to `*URLFileNameMatchConditionParametersType` +- Type of `URLPathMatchConditionParameters.TypeName` has been changed from `*URLPathMatchConditionParametersTypeName` to `*URLPathMatchConditionParametersType` +- Type of `URLRedirectAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `URLRedirectActionParameters.TypeName` has been changed from `*URLRedirectActionParametersTypeName` to `*URLRedirectActionParametersType` +- Type of `URLRewriteAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `URLRewriteActionParameters.TypeName` has been changed from `*URLRewriteActionParametersTypeName` to `*URLRewriteActionParametersType` +- Type of `URLSigningAction.Name` has been changed from `*DeliveryRuleAction` to `*DeliveryRuleActionName` +- Type of `URLSigningActionParameters.TypeName` has been changed from `*URLSigningActionParametersTypeName` to `*URLSigningActionParametersType` +- 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 `CacheExpirationActionParametersType` with values `CacheExpirationActionParametersTypeDeliveryRuleCacheExpirationActionParameters` +- New enum type `CacheKeyQueryStringActionParametersType` with values `CacheKeyQueryStringActionParametersTypeDeliveryRuleCacheKeyQueryStringBehaviorActionParameters` +- New enum type `CdnCertificateSourceParametersType` with values `CdnCertificateSourceParametersTypeCdnCertificateSourceParameters` +- New enum type `ClientPortMatchConditionParametersType` with values `ClientPortMatchConditionParametersTypeDeliveryRuleClientPortConditionParameters` +- New enum type `CookiesMatchConditionParametersType` with values `CookiesMatchConditionParametersTypeDeliveryRuleCookiesConditionParameters` +- New enum type `DeliveryRuleActionName` with values `DeliveryRuleActionNameCacheExpiration`, `DeliveryRuleActionNameCacheKeyQueryString`, `DeliveryRuleActionNameModifyRequestHeader`, `DeliveryRuleActionNameModifyResponseHeader`, `DeliveryRuleActionNameOriginGroupOverride`, `DeliveryRuleActionNameRouteConfigurationOverride`, `DeliveryRuleActionNameURLRedirect`, `DeliveryRuleActionNameURLRewrite`, `DeliveryRuleActionNameURLSigning` +- New enum type `HTTPVersionMatchConditionParametersType` with values `HTTPVersionMatchConditionParametersTypeDeliveryRuleHTTPVersionConditionParameters` +- New enum type `HeaderActionParametersType` with values `HeaderActionParametersTypeDeliveryRuleHeaderActionParameters` +- New enum type `HostNameMatchConditionParametersType` with values `HostNameMatchConditionParametersTypeDeliveryRuleHostNameConditionParameters` +- New enum type `IsDeviceMatchConditionParametersType` with values `IsDeviceMatchConditionParametersTypeDeliveryRuleIsDeviceConditionParameters` +- New enum type `IsDeviceMatchValue` with values `IsDeviceMatchValueDesktop`, `IsDeviceMatchValueMobile` +- New enum type `KeyVaultCertificateSourceParametersType` with values `KeyVaultCertificateSourceParametersTypeKeyVaultCertificateSourceParameters` +- New enum type `KeyVaultSigningKeyParametersType` with values `KeyVaultSigningKeyParametersTypeKeyVaultSigningKeyParameters` +- New enum type `OriginGroupOverrideActionParametersType` with values `OriginGroupOverrideActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters` +- New enum type `PostArgsMatchConditionParametersType` with values `PostArgsMatchConditionParametersTypeDeliveryRulePostArgsConditionParameters` +- New enum type `QueryStringMatchConditionParametersType` with values `QueryStringMatchConditionParametersTypeDeliveryRuleQueryStringConditionParameters` +- New enum type `RemoteAddressMatchConditionParametersType` with values `RemoteAddressMatchConditionParametersTypeDeliveryRuleRemoteAddressConditionParameters` +- New enum type `RequestBodyMatchConditionParametersType` with values `RequestBodyMatchConditionParametersTypeDeliveryRuleRequestBodyConditionParameters` +- New enum type `RequestHeaderMatchConditionParametersType` with values `RequestHeaderMatchConditionParametersTypeDeliveryRuleRequestHeaderConditionParameters` +- New enum type `RequestMethodMatchConditionParametersType` with values `RequestMethodMatchConditionParametersTypeDeliveryRuleRequestMethodConditionParameters` +- New enum type `RequestMethodMatchValue` with values `RequestMethodMatchValueDELETE`, `RequestMethodMatchValueGET`, `RequestMethodMatchValueHEAD`, `RequestMethodMatchValueOPTIONS`, `RequestMethodMatchValuePOST`, `RequestMethodMatchValuePUT`, `RequestMethodMatchValueTRACE` +- New enum type `RequestSchemeMatchConditionParametersType` with values `RequestSchemeMatchConditionParametersTypeDeliveryRuleRequestSchemeConditionParameters` +- New enum type `RequestSchemeMatchValue` with values `RequestSchemeMatchValueHTTP`, `RequestSchemeMatchValueHTTPS` +- New enum type `RequestURIMatchConditionParametersType` with values `RequestURIMatchConditionParametersTypeDeliveryRuleRequestURIConditionParameters` +- New enum type `RouteConfigurationOverrideActionParametersType` with values `RouteConfigurationOverrideActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters` +- New enum type `SSLProtocolMatchConditionParametersType` with values `SSLProtocolMatchConditionParametersTypeDeliveryRuleSSLProtocolConditionParameters` +- New enum type `ServerPortMatchConditionParametersType` with values `ServerPortMatchConditionParametersTypeDeliveryRuleServerPortConditionParameters` +- New enum type `SocketAddrMatchConditionParametersType` with values `SocketAddrMatchConditionParametersTypeDeliveryRuleSocketAddrConditionParameters` +- New enum type `URLFileExtensionMatchConditionParametersType` with values `URLFileExtensionMatchConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters` +- New enum type `URLFileNameMatchConditionParametersType` with values `URLFileNameMatchConditionParametersTypeDeliveryRuleURLFilenameConditionParameters` +- New enum type `URLPathMatchConditionParametersType` with values `URLPathMatchConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters` +- New enum type `URLRedirectActionParametersType` with values `URLRedirectActionParametersTypeDeliveryRuleURLRedirectActionParameters` +- New enum type `URLRewriteActionParametersType` with values `URLRewriteActionParametersTypeDeliveryRuleURLRewriteActionParameters` +- New enum type `URLSigningActionParametersType` with values `URLSigningActionParametersTypeDeliveryRuleURLSigningActionParameters` +- New function `*DeliveryRuleAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleCacheExpirationAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleCacheKeyQueryStringAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleRequestHeaderAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleResponseHeaderAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*DeliveryRuleRouteConfigurationOverrideAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*OriginGroupOverrideAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*URLRedirectAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*URLRewriteAction.GetDeliveryRuleAction() *DeliveryRuleAction` +- New function `*URLSigningAction.GetDeliveryRuleAction() *DeliveryRuleAction` + + ## 2.0.0 (2023-10-27) ### Breaking Changes 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 adb2dad28df0..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client_example_test.go deleted file mode 100644 index b9af5ebc963b..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client_example_test.go deleted file mode 100644 index c20a0584622a..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdorigins_client_example_test.go deleted file mode 100644 index 8c635ee6523f..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client_example_test.go deleted file mode 100644 index 50a301c7ad5c..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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 089d897d4b7f..10941b6b02ec 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/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cdn/armcdn/autorest.md b/sdk/resourcemanager/cdn/armcdn/autorest.md index fee20f2508f2..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/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.0.0 +module-version: 3.0.0 modelerfour: lenient-model-deduplication: true -tag: package-2023-05 ``` \ 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 c52fe6da2859..5a936ffbc4d5 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/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cdn/armcdn/constants.go b/sdk/resourcemanager/cdn/armcdn/constants.go index ca2ea36f414c..2a4ee7a19b71 100644 --- a/sdk/resourcemanager/cdn/armcdn/constants.go +++ b/sdk/resourcemanager/cdn/armcdn/constants.go @@ -10,7 +10,7 @@ package armcdn const ( moduleName = "armcdn" - moduleVersion = "v2.0.0" + moduleVersion = "v3.0.0" ) // AFDEndpointProtocols - Supported protocols for the customer's endpoint. @@ -179,29 +179,29 @@ func PossibleCacheBehaviorValues() []CacheBehavior { } } -type CacheExpirationActionParametersTypeName string +type CacheExpirationActionParametersType string const ( - CacheExpirationActionParametersTypeNameDeliveryRuleCacheExpirationActionParameters CacheExpirationActionParametersTypeName = "DeliveryRuleCacheExpirationActionParameters" + CacheExpirationActionParametersTypeDeliveryRuleCacheExpirationActionParameters CacheExpirationActionParametersType = "DeliveryRuleCacheExpirationActionParameters" ) -// PossibleCacheExpirationActionParametersTypeNameValues returns the possible values for the CacheExpirationActionParametersTypeName const type. -func PossibleCacheExpirationActionParametersTypeNameValues() []CacheExpirationActionParametersTypeName { - return []CacheExpirationActionParametersTypeName{ - CacheExpirationActionParametersTypeNameDeliveryRuleCacheExpirationActionParameters, +// PossibleCacheExpirationActionParametersTypeValues returns the possible values for the CacheExpirationActionParametersType const type. +func PossibleCacheExpirationActionParametersTypeValues() []CacheExpirationActionParametersType { + return []CacheExpirationActionParametersType{ + CacheExpirationActionParametersTypeDeliveryRuleCacheExpirationActionParameters, } } -type CacheKeyQueryStringActionParametersTypeName string +type CacheKeyQueryStringActionParametersType string const ( - CacheKeyQueryStringActionParametersTypeNameDeliveryRuleCacheKeyQueryStringBehaviorActionParameters CacheKeyQueryStringActionParametersTypeName = "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" + CacheKeyQueryStringActionParametersTypeDeliveryRuleCacheKeyQueryStringBehaviorActionParameters CacheKeyQueryStringActionParametersType = "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters" ) -// PossibleCacheKeyQueryStringActionParametersTypeNameValues returns the possible values for the CacheKeyQueryStringActionParametersTypeName const type. -func PossibleCacheKeyQueryStringActionParametersTypeNameValues() []CacheKeyQueryStringActionParametersTypeName { - return []CacheKeyQueryStringActionParametersTypeName{ - CacheKeyQueryStringActionParametersTypeNameDeliveryRuleCacheKeyQueryStringBehaviorActionParameters, +// PossibleCacheKeyQueryStringActionParametersTypeValues returns the possible values for the CacheKeyQueryStringActionParametersType const type. +func PossibleCacheKeyQueryStringActionParametersTypeValues() []CacheKeyQueryStringActionParametersType { + return []CacheKeyQueryStringActionParametersType{ + CacheKeyQueryStringActionParametersTypeDeliveryRuleCacheKeyQueryStringBehaviorActionParameters, } } @@ -235,16 +235,16 @@ func PossibleCanMigrateDefaultSKUValues() []CanMigrateDefaultSKU { } } -type CdnCertificateSourceParametersTypeName string +type CdnCertificateSourceParametersType string const ( - CdnCertificateSourceParametersTypeNameCdnCertificateSourceParameters CdnCertificateSourceParametersTypeName = "CdnCertificateSourceParameters" + CdnCertificateSourceParametersTypeCdnCertificateSourceParameters CdnCertificateSourceParametersType = "CdnCertificateSourceParameters" ) -// PossibleCdnCertificateSourceParametersTypeNameValues returns the possible values for the CdnCertificateSourceParametersTypeName const type. -func PossibleCdnCertificateSourceParametersTypeNameValues() []CdnCertificateSourceParametersTypeName { - return []CdnCertificateSourceParametersTypeName{ - CdnCertificateSourceParametersTypeNameCdnCertificateSourceParameters, +// PossibleCdnCertificateSourceParametersTypeValues returns the possible values for the CdnCertificateSourceParametersType const type. +func PossibleCdnCertificateSourceParametersTypeValues() []CdnCertificateSourceParametersType { + return []CdnCertificateSourceParametersType{ + CdnCertificateSourceParametersTypeCdnCertificateSourceParameters, } } @@ -280,16 +280,16 @@ func PossibleCertificateTypeValues() []CertificateType { } } -type ClientPortMatchConditionParametersTypeName string +type ClientPortMatchConditionParametersType string const ( - ClientPortMatchConditionParametersTypeNameDeliveryRuleClientPortConditionParameters ClientPortMatchConditionParametersTypeName = "DeliveryRuleClientPortConditionParameters" + ClientPortMatchConditionParametersTypeDeliveryRuleClientPortConditionParameters ClientPortMatchConditionParametersType = "DeliveryRuleClientPortConditionParameters" ) -// PossibleClientPortMatchConditionParametersTypeNameValues returns the possible values for the ClientPortMatchConditionParametersTypeName const type. -func PossibleClientPortMatchConditionParametersTypeNameValues() []ClientPortMatchConditionParametersTypeName { - return []ClientPortMatchConditionParametersTypeName{ - ClientPortMatchConditionParametersTypeNameDeliveryRuleClientPortConditionParameters, +// PossibleClientPortMatchConditionParametersTypeValues returns the possible values for the ClientPortMatchConditionParametersType const type. +func PossibleClientPortMatchConditionParametersTypeValues() []ClientPortMatchConditionParametersType { + return []ClientPortMatchConditionParametersType{ + ClientPortMatchConditionParametersTypeDeliveryRuleClientPortConditionParameters, } } @@ -325,16 +325,16 @@ func PossibleClientPortOperatorValues() []ClientPortOperator { } } -type CookiesMatchConditionParametersTypeName string +type CookiesMatchConditionParametersType string const ( - CookiesMatchConditionParametersTypeNameDeliveryRuleCookiesConditionParameters CookiesMatchConditionParametersTypeName = "DeliveryRuleCookiesConditionParameters" + CookiesMatchConditionParametersTypeDeliveryRuleCookiesConditionParameters CookiesMatchConditionParametersType = "DeliveryRuleCookiesConditionParameters" ) -// PossibleCookiesMatchConditionParametersTypeNameValues returns the possible values for the CookiesMatchConditionParametersTypeName const type. -func PossibleCookiesMatchConditionParametersTypeNameValues() []CookiesMatchConditionParametersTypeName { - return []CookiesMatchConditionParametersTypeName{ - CookiesMatchConditionParametersTypeNameDeliveryRuleCookiesConditionParameters, +// PossibleCookiesMatchConditionParametersTypeValues returns the possible values for the CookiesMatchConditionParametersType const type. +func PossibleCookiesMatchConditionParametersTypeValues() []CookiesMatchConditionParametersType { + return []CookiesMatchConditionParametersType{ + CookiesMatchConditionParametersTypeDeliveryRuleCookiesConditionParameters, } } @@ -473,33 +473,33 @@ func PossibleDeleteRuleValues() []DeleteRule { } } -// DeliveryRuleAction - The name of the action for the delivery rule. -type DeliveryRuleAction string +// DeliveryRuleActionName - The name of the action for the delivery rule. +type DeliveryRuleActionName 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" + 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" ) -// PossibleDeliveryRuleActionValues returns the possible values for the DeliveryRuleAction const type. -func PossibleDeliveryRuleActionValues() []DeliveryRuleAction { - return []DeliveryRuleAction{ - DeliveryRuleActionCacheExpiration, - DeliveryRuleActionCacheKeyQueryString, - DeliveryRuleActionModifyRequestHeader, - DeliveryRuleActionModifyResponseHeader, - DeliveryRuleActionOriginGroupOverride, - DeliveryRuleActionRouteConfigurationOverride, - DeliveryRuleActionURLRedirect, - DeliveryRuleActionURLRewrite, - DeliveryRuleActionURLSigning, +// PossibleDeliveryRuleActionNameValues returns the possible values for the DeliveryRuleActionName const type. +func PossibleDeliveryRuleActionNameValues() []DeliveryRuleActionName { + return []DeliveryRuleActionName{ + DeliveryRuleActionNameCacheExpiration, + DeliveryRuleActionNameCacheKeyQueryString, + DeliveryRuleActionNameModifyRequestHeader, + DeliveryRuleActionNameModifyResponseHeader, + DeliveryRuleActionNameOriginGroupOverride, + DeliveryRuleActionNameRouteConfigurationOverride, + DeliveryRuleActionNameURLRedirect, + DeliveryRuleActionNameURLRewrite, + DeliveryRuleActionNameURLSigning, } } @@ -684,16 +684,16 @@ func PossibleHTTPSRedirectValues() []HTTPSRedirect { } } -type HTTPVersionMatchConditionParametersTypeName string +type HTTPVersionMatchConditionParametersType string const ( - HTTPVersionMatchConditionParametersTypeNameDeliveryRuleHTTPVersionConditionParameters HTTPVersionMatchConditionParametersTypeName = "DeliveryRuleHttpVersionConditionParameters" + HTTPVersionMatchConditionParametersTypeDeliveryRuleHTTPVersionConditionParameters HTTPVersionMatchConditionParametersType = "DeliveryRuleHttpVersionConditionParameters" ) -// PossibleHTTPVersionMatchConditionParametersTypeNameValues returns the possible values for the HTTPVersionMatchConditionParametersTypeName const type. -func PossibleHTTPVersionMatchConditionParametersTypeNameValues() []HTTPVersionMatchConditionParametersTypeName { - return []HTTPVersionMatchConditionParametersTypeName{ - HTTPVersionMatchConditionParametersTypeNameDeliveryRuleHTTPVersionConditionParameters, +// PossibleHTTPVersionMatchConditionParametersTypeValues returns the possible values for the HTTPVersionMatchConditionParametersType const type. +func PossibleHTTPVersionMatchConditionParametersTypeValues() []HTTPVersionMatchConditionParametersType { + return []HTTPVersionMatchConditionParametersType{ + HTTPVersionMatchConditionParametersTypeDeliveryRuleHTTPVersionConditionParameters, } } @@ -729,16 +729,16 @@ func PossibleHeaderActionValues() []HeaderAction { } } -type HeaderActionParametersTypeName string +type HeaderActionParametersType string const ( - HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters HeaderActionParametersTypeName = "DeliveryRuleHeaderActionParameters" + HeaderActionParametersTypeDeliveryRuleHeaderActionParameters HeaderActionParametersType = "DeliveryRuleHeaderActionParameters" ) -// PossibleHeaderActionParametersTypeNameValues returns the possible values for the HeaderActionParametersTypeName const type. -func PossibleHeaderActionParametersTypeNameValues() []HeaderActionParametersTypeName { - return []HeaderActionParametersTypeName{ - HeaderActionParametersTypeNameDeliveryRuleHeaderActionParameters, +// PossibleHeaderActionParametersTypeValues returns the possible values for the HeaderActionParametersType const type. +func PossibleHeaderActionParametersTypeValues() []HeaderActionParametersType { + return []HeaderActionParametersType{ + HeaderActionParametersTypeDeliveryRuleHeaderActionParameters, } } @@ -760,16 +760,16 @@ func PossibleHealthProbeRequestTypeValues() []HealthProbeRequestType { } } -type HostNameMatchConditionParametersTypeName string +type HostNameMatchConditionParametersType string const ( - HostNameMatchConditionParametersTypeNameDeliveryRuleHostNameConditionParameters HostNameMatchConditionParametersTypeName = "DeliveryRuleHostNameConditionParameters" + HostNameMatchConditionParametersTypeDeliveryRuleHostNameConditionParameters HostNameMatchConditionParametersType = "DeliveryRuleHostNameConditionParameters" ) -// PossibleHostNameMatchConditionParametersTypeNameValues returns the possible values for the HostNameMatchConditionParametersTypeName const type. -func PossibleHostNameMatchConditionParametersTypeNameValues() []HostNameMatchConditionParametersTypeName { - return []HostNameMatchConditionParametersTypeName{ - HostNameMatchConditionParametersTypeNameDeliveryRuleHostNameConditionParameters, +// PossibleHostNameMatchConditionParametersTypeValues returns the possible values for the HostNameMatchConditionParametersType const type. +func PossibleHostNameMatchConditionParametersTypeValues() []HostNameMatchConditionParametersType { + return []HostNameMatchConditionParametersType{ + HostNameMatchConditionParametersTypeDeliveryRuleHostNameConditionParameters, } } @@ -825,31 +825,31 @@ func PossibleIdentityTypeValues() []IdentityType { } } -type IsDeviceMatchConditionParametersMatchValuesItem string +type IsDeviceMatchConditionParametersType string const ( - IsDeviceMatchConditionParametersMatchValuesItemDesktop IsDeviceMatchConditionParametersMatchValuesItem = "Desktop" - IsDeviceMatchConditionParametersMatchValuesItemMobile IsDeviceMatchConditionParametersMatchValuesItem = "Mobile" + IsDeviceMatchConditionParametersTypeDeliveryRuleIsDeviceConditionParameters IsDeviceMatchConditionParametersType = "DeliveryRuleIsDeviceConditionParameters" ) -// PossibleIsDeviceMatchConditionParametersMatchValuesItemValues returns the possible values for the IsDeviceMatchConditionParametersMatchValuesItem const type. -func PossibleIsDeviceMatchConditionParametersMatchValuesItemValues() []IsDeviceMatchConditionParametersMatchValuesItem { - return []IsDeviceMatchConditionParametersMatchValuesItem{ - IsDeviceMatchConditionParametersMatchValuesItemDesktop, - IsDeviceMatchConditionParametersMatchValuesItemMobile, +// PossibleIsDeviceMatchConditionParametersTypeValues returns the possible values for the IsDeviceMatchConditionParametersType const type. +func PossibleIsDeviceMatchConditionParametersTypeValues() []IsDeviceMatchConditionParametersType { + return []IsDeviceMatchConditionParametersType{ + IsDeviceMatchConditionParametersTypeDeliveryRuleIsDeviceConditionParameters, } } -type IsDeviceMatchConditionParametersTypeName string +type IsDeviceMatchValue string const ( - IsDeviceMatchConditionParametersTypeNameDeliveryRuleIsDeviceConditionParameters IsDeviceMatchConditionParametersTypeName = "DeliveryRuleIsDeviceConditionParameters" + IsDeviceMatchValueDesktop IsDeviceMatchValue = "Desktop" + IsDeviceMatchValueMobile IsDeviceMatchValue = "Mobile" ) -// 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 +867,29 @@ func PossibleIsDeviceOperatorValues() []IsDeviceOperator { } } -type KeyVaultCertificateSourceParametersTypeName string +type KeyVaultCertificateSourceParametersType string const ( - KeyVaultCertificateSourceParametersTypeNameKeyVaultCertificateSourceParameters KeyVaultCertificateSourceParametersTypeName = "KeyVaultCertificateSourceParameters" + KeyVaultCertificateSourceParametersTypeKeyVaultCertificateSourceParameters KeyVaultCertificateSourceParametersType = "KeyVaultCertificateSourceParameters" ) -// PossibleKeyVaultCertificateSourceParametersTypeNameValues returns the possible values for the KeyVaultCertificateSourceParametersTypeName const type. -func PossibleKeyVaultCertificateSourceParametersTypeNameValues() []KeyVaultCertificateSourceParametersTypeName { - return []KeyVaultCertificateSourceParametersTypeName{ - KeyVaultCertificateSourceParametersTypeNameKeyVaultCertificateSourceParameters, +// PossibleKeyVaultCertificateSourceParametersTypeValues returns the possible values for the KeyVaultCertificateSourceParametersType const type. +func PossibleKeyVaultCertificateSourceParametersTypeValues() []KeyVaultCertificateSourceParametersType { + return []KeyVaultCertificateSourceParametersType{ + KeyVaultCertificateSourceParametersTypeKeyVaultCertificateSourceParameters, } } -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,16 +1230,16 @@ func PossibleOptimizationTypeValues() []OptimizationType { } } -type OriginGroupOverrideActionParametersTypeName string +type OriginGroupOverrideActionParametersType string const ( - OriginGroupOverrideActionParametersTypeNameDeliveryRuleOriginGroupOverrideActionParameters OriginGroupOverrideActionParametersTypeName = "DeliveryRuleOriginGroupOverrideActionParameters" + OriginGroupOverrideActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters OriginGroupOverrideActionParametersType = "DeliveryRuleOriginGroupOverrideActionParameters" ) -// PossibleOriginGroupOverrideActionParametersTypeNameValues returns the possible values for the OriginGroupOverrideActionParametersTypeName const type. -func PossibleOriginGroupOverrideActionParametersTypeNameValues() []OriginGroupOverrideActionParametersTypeName { - return []OriginGroupOverrideActionParametersTypeName{ - OriginGroupOverrideActionParametersTypeNameDeliveryRuleOriginGroupOverrideActionParameters, +// PossibleOriginGroupOverrideActionParametersTypeValues returns the possible values for the OriginGroupOverrideActionParametersType const type. +func PossibleOriginGroupOverrideActionParametersTypeValues() []OriginGroupOverrideActionParametersType { + return []OriginGroupOverrideActionParametersType{ + OriginGroupOverrideActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters, } } @@ -1420,16 +1420,16 @@ func PossiblePolicySettingsDefaultCustomBlockResponseStatusCodeValues() []Policy } } -type PostArgsMatchConditionParametersTypeName string +type PostArgsMatchConditionParametersType string const ( - PostArgsMatchConditionParametersTypeNameDeliveryRulePostArgsConditionParameters PostArgsMatchConditionParametersTypeName = "DeliveryRulePostArgsConditionParameters" + PostArgsMatchConditionParametersTypeDeliveryRulePostArgsConditionParameters PostArgsMatchConditionParametersType = "DeliveryRulePostArgsConditionParameters" ) -// PossiblePostArgsMatchConditionParametersTypeNameValues returns the possible values for the PostArgsMatchConditionParametersTypeName const type. -func PossiblePostArgsMatchConditionParametersTypeNameValues() []PostArgsMatchConditionParametersTypeName { - return []PostArgsMatchConditionParametersTypeName{ - PostArgsMatchConditionParametersTypeNameDeliveryRulePostArgsConditionParameters, +// PossiblePostArgsMatchConditionParametersTypeValues returns the possible values for the PostArgsMatchConditionParametersType const type. +func PossiblePostArgsMatchConditionParametersTypeValues() []PostArgsMatchConditionParametersType { + return []PostArgsMatchConditionParametersType{ + PostArgsMatchConditionParametersTypeDeliveryRulePostArgsConditionParameters, } } @@ -1633,16 +1633,16 @@ func PossibleQueryStringCachingBehaviorValues() []QueryStringCachingBehavior { } } -type QueryStringMatchConditionParametersTypeName string +type QueryStringMatchConditionParametersType string const ( - QueryStringMatchConditionParametersTypeNameDeliveryRuleQueryStringConditionParameters QueryStringMatchConditionParametersTypeName = "DeliveryRuleQueryStringConditionParameters" + QueryStringMatchConditionParametersTypeDeliveryRuleQueryStringConditionParameters QueryStringMatchConditionParametersType = "DeliveryRuleQueryStringConditionParameters" ) -// PossibleQueryStringMatchConditionParametersTypeNameValues returns the possible values for the QueryStringMatchConditionParametersTypeName const type. -func PossibleQueryStringMatchConditionParametersTypeNameValues() []QueryStringMatchConditionParametersTypeName { - return []QueryStringMatchConditionParametersTypeName{ - QueryStringMatchConditionParametersTypeNameDeliveryRuleQueryStringConditionParameters, +// PossibleQueryStringMatchConditionParametersTypeValues returns the possible values for the QueryStringMatchConditionParametersType const type. +func PossibleQueryStringMatchConditionParametersTypeValues() []QueryStringMatchConditionParametersType { + return []QueryStringMatchConditionParametersType{ + QueryStringMatchConditionParametersTypeDeliveryRuleQueryStringConditionParameters, } } @@ -1698,16 +1698,16 @@ func PossibleRedirectTypeValues() []RedirectType { } } -type RemoteAddressMatchConditionParametersTypeName string +type RemoteAddressMatchConditionParametersType string const ( - RemoteAddressMatchConditionParametersTypeNameDeliveryRuleRemoteAddressConditionParameters RemoteAddressMatchConditionParametersTypeName = "DeliveryRuleRemoteAddressConditionParameters" + RemoteAddressMatchConditionParametersTypeDeliveryRuleRemoteAddressConditionParameters RemoteAddressMatchConditionParametersType = "DeliveryRuleRemoteAddressConditionParameters" ) -// PossibleRemoteAddressMatchConditionParametersTypeNameValues returns the possible values for the RemoteAddressMatchConditionParametersTypeName const type. -func PossibleRemoteAddressMatchConditionParametersTypeNameValues() []RemoteAddressMatchConditionParametersTypeName { - return []RemoteAddressMatchConditionParametersTypeName{ - RemoteAddressMatchConditionParametersTypeNameDeliveryRuleRemoteAddressConditionParameters, +// PossibleRemoteAddressMatchConditionParametersTypeValues returns the possible values for the RemoteAddressMatchConditionParametersType const type. +func PossibleRemoteAddressMatchConditionParametersTypeValues() []RemoteAddressMatchConditionParametersType { + return []RemoteAddressMatchConditionParametersType{ + RemoteAddressMatchConditionParametersTypeDeliveryRuleRemoteAddressConditionParameters, } } @@ -1729,16 +1729,16 @@ func PossibleRemoteAddressOperatorValues() []RemoteAddressOperator { } } -type RequestBodyMatchConditionParametersTypeName string +type RequestBodyMatchConditionParametersType string const ( - RequestBodyMatchConditionParametersTypeNameDeliveryRuleRequestBodyConditionParameters RequestBodyMatchConditionParametersTypeName = "DeliveryRuleRequestBodyConditionParameters" + RequestBodyMatchConditionParametersTypeDeliveryRuleRequestBodyConditionParameters RequestBodyMatchConditionParametersType = "DeliveryRuleRequestBodyConditionParameters" ) -// PossibleRequestBodyMatchConditionParametersTypeNameValues returns the possible values for the RequestBodyMatchConditionParametersTypeName const type. -func PossibleRequestBodyMatchConditionParametersTypeNameValues() []RequestBodyMatchConditionParametersTypeName { - return []RequestBodyMatchConditionParametersTypeName{ - RequestBodyMatchConditionParametersTypeNameDeliveryRuleRequestBodyConditionParameters, +// PossibleRequestBodyMatchConditionParametersTypeValues returns the possible values for the RequestBodyMatchConditionParametersType const type. +func PossibleRequestBodyMatchConditionParametersTypeValues() []RequestBodyMatchConditionParametersType { + return []RequestBodyMatchConditionParametersType{ + RequestBodyMatchConditionParametersTypeDeliveryRuleRequestBodyConditionParameters, } } @@ -1774,16 +1774,16 @@ func PossibleRequestBodyOperatorValues() []RequestBodyOperator { } } -type RequestHeaderMatchConditionParametersTypeName string +type RequestHeaderMatchConditionParametersType string const ( - RequestHeaderMatchConditionParametersTypeNameDeliveryRuleRequestHeaderConditionParameters RequestHeaderMatchConditionParametersTypeName = "DeliveryRuleRequestHeaderConditionParameters" + RequestHeaderMatchConditionParametersTypeDeliveryRuleRequestHeaderConditionParameters RequestHeaderMatchConditionParametersType = "DeliveryRuleRequestHeaderConditionParameters" ) -// PossibleRequestHeaderMatchConditionParametersTypeNameValues returns the possible values for the RequestHeaderMatchConditionParametersTypeName const type. -func PossibleRequestHeaderMatchConditionParametersTypeNameValues() []RequestHeaderMatchConditionParametersTypeName { - return []RequestHeaderMatchConditionParametersTypeName{ - RequestHeaderMatchConditionParametersTypeNameDeliveryRuleRequestHeaderConditionParameters, +// PossibleRequestHeaderMatchConditionParametersTypeValues returns the possible values for the RequestHeaderMatchConditionParametersType const type. +func PossibleRequestHeaderMatchConditionParametersTypeValues() []RequestHeaderMatchConditionParametersType { + return []RequestHeaderMatchConditionParametersType{ + RequestHeaderMatchConditionParametersTypeDeliveryRuleRequestHeaderConditionParameters, } } @@ -1819,41 +1819,41 @@ func PossibleRequestHeaderOperatorValues() []RequestHeaderOperator { } } -type RequestMethodMatchConditionParametersMatchValuesItem string +type RequestMethodMatchConditionParametersType string const ( - RequestMethodMatchConditionParametersMatchValuesItemDELETE RequestMethodMatchConditionParametersMatchValuesItem = "DELETE" - RequestMethodMatchConditionParametersMatchValuesItemGET RequestMethodMatchConditionParametersMatchValuesItem = "GET" - RequestMethodMatchConditionParametersMatchValuesItemHEAD RequestMethodMatchConditionParametersMatchValuesItem = "HEAD" - RequestMethodMatchConditionParametersMatchValuesItemOPTIONS RequestMethodMatchConditionParametersMatchValuesItem = "OPTIONS" - RequestMethodMatchConditionParametersMatchValuesItemPOST RequestMethodMatchConditionParametersMatchValuesItem = "POST" - RequestMethodMatchConditionParametersMatchValuesItemPUT RequestMethodMatchConditionParametersMatchValuesItem = "PUT" - RequestMethodMatchConditionParametersMatchValuesItemTRACE RequestMethodMatchConditionParametersMatchValuesItem = "TRACE" + RequestMethodMatchConditionParametersTypeDeliveryRuleRequestMethodConditionParameters RequestMethodMatchConditionParametersType = "DeliveryRuleRequestMethodConditionParameters" ) -// PossibleRequestMethodMatchConditionParametersMatchValuesItemValues returns the possible values for the RequestMethodMatchConditionParametersMatchValuesItem const type. -func PossibleRequestMethodMatchConditionParametersMatchValuesItemValues() []RequestMethodMatchConditionParametersMatchValuesItem { - return []RequestMethodMatchConditionParametersMatchValuesItem{ - RequestMethodMatchConditionParametersMatchValuesItemDELETE, - RequestMethodMatchConditionParametersMatchValuesItemGET, - RequestMethodMatchConditionParametersMatchValuesItemHEAD, - RequestMethodMatchConditionParametersMatchValuesItemOPTIONS, - RequestMethodMatchConditionParametersMatchValuesItemPOST, - RequestMethodMatchConditionParametersMatchValuesItemPUT, - RequestMethodMatchConditionParametersMatchValuesItemTRACE, +// PossibleRequestMethodMatchConditionParametersTypeValues returns the possible values for the RequestMethodMatchConditionParametersType const type. +func PossibleRequestMethodMatchConditionParametersTypeValues() []RequestMethodMatchConditionParametersType { + return []RequestMethodMatchConditionParametersType{ + RequestMethodMatchConditionParametersTypeDeliveryRuleRequestMethodConditionParameters, } } -type RequestMethodMatchConditionParametersTypeName string +type RequestMethodMatchValue string const ( - RequestMethodMatchConditionParametersTypeNameDeliveryRuleRequestMethodConditionParameters RequestMethodMatchConditionParametersTypeName = "DeliveryRuleRequestMethodConditionParameters" + RequestMethodMatchValueDELETE RequestMethodMatchValue = "DELETE" + RequestMethodMatchValueGET RequestMethodMatchValue = "GET" + RequestMethodMatchValueHEAD RequestMethodMatchValue = "HEAD" + RequestMethodMatchValueOPTIONS RequestMethodMatchValue = "OPTIONS" + RequestMethodMatchValuePOST RequestMethodMatchValue = "POST" + RequestMethodMatchValuePUT RequestMethodMatchValue = "PUT" + RequestMethodMatchValueTRACE RequestMethodMatchValue = "TRACE" ) -// 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, } } @@ -1871,21 +1871,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 @@ -1900,29 +1885,44 @@ func PossibleRequestSchemeMatchConditionParametersOperatorValues() []RequestSche } } -type RequestSchemeMatchConditionParametersTypeName string +type RequestSchemeMatchConditionParametersType string + +const ( + RequestSchemeMatchConditionParametersTypeDeliveryRuleRequestSchemeConditionParameters RequestSchemeMatchConditionParametersType = "DeliveryRuleRequestSchemeConditionParameters" +) + +// PossibleRequestSchemeMatchConditionParametersTypeValues returns the possible values for the RequestSchemeMatchConditionParametersType const type. +func PossibleRequestSchemeMatchConditionParametersTypeValues() []RequestSchemeMatchConditionParametersType { + return []RequestSchemeMatchConditionParametersType{ + RequestSchemeMatchConditionParametersTypeDeliveryRuleRequestSchemeConditionParameters, + } +} + +type RequestSchemeMatchValue string const ( - RequestSchemeMatchConditionParametersTypeNameDeliveryRuleRequestSchemeConditionParameters RequestSchemeMatchConditionParametersTypeName = "DeliveryRuleRequestSchemeConditionParameters" + RequestSchemeMatchValueHTTP RequestSchemeMatchValue = "HTTP" + RequestSchemeMatchValueHTTPS RequestSchemeMatchValue = "HTTPS" ) -// PossibleRequestSchemeMatchConditionParametersTypeNameValues returns the possible values for the RequestSchemeMatchConditionParametersTypeName const type. -func PossibleRequestSchemeMatchConditionParametersTypeNameValues() []RequestSchemeMatchConditionParametersTypeName { - return []RequestSchemeMatchConditionParametersTypeName{ - RequestSchemeMatchConditionParametersTypeNameDeliveryRuleRequestSchemeConditionParameters, +// PossibleRequestSchemeMatchValueValues returns the possible values for the RequestSchemeMatchValue const type. +func PossibleRequestSchemeMatchValueValues() []RequestSchemeMatchValue { + return []RequestSchemeMatchValue{ + RequestSchemeMatchValueHTTP, + RequestSchemeMatchValueHTTPS, } } -type RequestURIMatchConditionParametersTypeName string +type RequestURIMatchConditionParametersType string const ( - RequestURIMatchConditionParametersTypeNameDeliveryRuleRequestURIConditionParameters RequestURIMatchConditionParametersTypeName = "DeliveryRuleRequestUriConditionParameters" + RequestURIMatchConditionParametersTypeDeliveryRuleRequestURIConditionParameters RequestURIMatchConditionParametersType = "DeliveryRuleRequestUriConditionParameters" ) -// PossibleRequestURIMatchConditionParametersTypeNameValues returns the possible values for the RequestURIMatchConditionParametersTypeName const type. -func PossibleRequestURIMatchConditionParametersTypeNameValues() []RequestURIMatchConditionParametersTypeName { - return []RequestURIMatchConditionParametersTypeName{ - RequestURIMatchConditionParametersTypeNameDeliveryRuleRequestURIConditionParameters, +// PossibleRequestURIMatchConditionParametersTypeValues returns the possible values for the RequestURIMatchConditionParametersType const type. +func PossibleRequestURIMatchConditionParametersTypeValues() []RequestURIMatchConditionParametersType { + return []RequestURIMatchConditionParametersType{ + RequestURIMatchConditionParametersTypeDeliveryRuleRequestURIConditionParameters, } } @@ -2006,16 +2006,16 @@ func PossibleResponseBasedDetectedErrorTypesValues() []ResponseBasedDetectedErro } } -type RouteConfigurationOverrideActionParametersTypeName string +type RouteConfigurationOverrideActionParametersType string const ( - RouteConfigurationOverrideActionParametersTypeNameDeliveryRuleRouteConfigurationOverrideActionParameters RouteConfigurationOverrideActionParametersTypeName = "DeliveryRuleRouteConfigurationOverrideActionParameters" + RouteConfigurationOverrideActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters RouteConfigurationOverrideActionParametersType = "DeliveryRuleRouteConfigurationOverrideActionParameters" ) -// PossibleRouteConfigurationOverrideActionParametersTypeNameValues returns the possible values for the RouteConfigurationOverrideActionParametersTypeName const type. -func PossibleRouteConfigurationOverrideActionParametersTypeNameValues() []RouteConfigurationOverrideActionParametersTypeName { - return []RouteConfigurationOverrideActionParametersTypeName{ - RouteConfigurationOverrideActionParametersTypeNameDeliveryRuleRouteConfigurationOverrideActionParameters, +// PossibleRouteConfigurationOverrideActionParametersTypeValues returns the possible values for the RouteConfigurationOverrideActionParametersType const type. +func PossibleRouteConfigurationOverrideActionParametersTypeValues() []RouteConfigurationOverrideActionParametersType { + return []RouteConfigurationOverrideActionParametersType{ + RouteConfigurationOverrideActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters, } } @@ -2133,16 +2133,16 @@ func PossibleSSLProtocolValues() []SSLProtocol { } } -type SSLProtocolMatchConditionParametersTypeName string +type SSLProtocolMatchConditionParametersType string const ( - SSLProtocolMatchConditionParametersTypeNameDeliveryRuleSSLProtocolConditionParameters SSLProtocolMatchConditionParametersTypeName = "DeliveryRuleSslProtocolConditionParameters" + SSLProtocolMatchConditionParametersTypeDeliveryRuleSSLProtocolConditionParameters SSLProtocolMatchConditionParametersType = "DeliveryRuleSslProtocolConditionParameters" ) -// PossibleSSLProtocolMatchConditionParametersTypeNameValues returns the possible values for the SSLProtocolMatchConditionParametersTypeName const type. -func PossibleSSLProtocolMatchConditionParametersTypeNameValues() []SSLProtocolMatchConditionParametersTypeName { - return []SSLProtocolMatchConditionParametersTypeName{ - SSLProtocolMatchConditionParametersTypeNameDeliveryRuleSSLProtocolConditionParameters, +// PossibleSSLProtocolMatchConditionParametersTypeValues returns the possible values for the SSLProtocolMatchConditionParametersType const type. +func PossibleSSLProtocolMatchConditionParametersTypeValues() []SSLProtocolMatchConditionParametersType { + return []SSLProtocolMatchConditionParametersType{ + SSLProtocolMatchConditionParametersTypeDeliveryRuleSSLProtocolConditionParameters, } } @@ -2194,16 +2194,16 @@ func PossibleSecurityPolicyTypeValues() []SecurityPolicyType { } } -type ServerPortMatchConditionParametersTypeName string +type ServerPortMatchConditionParametersType string const ( - ServerPortMatchConditionParametersTypeNameDeliveryRuleServerPortConditionParameters ServerPortMatchConditionParametersTypeName = "DeliveryRuleServerPortConditionParameters" + ServerPortMatchConditionParametersTypeDeliveryRuleServerPortConditionParameters ServerPortMatchConditionParametersType = "DeliveryRuleServerPortConditionParameters" ) -// PossibleServerPortMatchConditionParametersTypeNameValues returns the possible values for the ServerPortMatchConditionParametersTypeName const type. -func PossibleServerPortMatchConditionParametersTypeNameValues() []ServerPortMatchConditionParametersTypeName { - return []ServerPortMatchConditionParametersTypeName{ - ServerPortMatchConditionParametersTypeNameDeliveryRuleServerPortConditionParameters, +// PossibleServerPortMatchConditionParametersTypeValues returns the possible values for the ServerPortMatchConditionParametersType const type. +func PossibleServerPortMatchConditionParametersTypeValues() []ServerPortMatchConditionParametersType { + return []ServerPortMatchConditionParametersType{ + ServerPortMatchConditionParametersTypeDeliveryRuleServerPortConditionParameters, } } @@ -2262,16 +2262,16 @@ func PossibleSharedPrivateLinkResourceStatusValues() []SharedPrivateLinkResource } } -type SocketAddrMatchConditionParametersTypeName string +type SocketAddrMatchConditionParametersType string const ( - SocketAddrMatchConditionParametersTypeNameDeliveryRuleSocketAddrConditionParameters SocketAddrMatchConditionParametersTypeName = "DeliveryRuleSocketAddrConditionParameters" + SocketAddrMatchConditionParametersTypeDeliveryRuleSocketAddrConditionParameters SocketAddrMatchConditionParametersType = "DeliveryRuleSocketAddrConditionParameters" ) -// PossibleSocketAddrMatchConditionParametersTypeNameValues returns the possible values for the SocketAddrMatchConditionParametersTypeName const type. -func PossibleSocketAddrMatchConditionParametersTypeNameValues() []SocketAddrMatchConditionParametersTypeName { - return []SocketAddrMatchConditionParametersTypeName{ - SocketAddrMatchConditionParametersTypeNameDeliveryRuleSocketAddrConditionParameters, +// PossibleSocketAddrMatchConditionParametersTypeValues returns the possible values for the SocketAddrMatchConditionParametersType const type. +func PossibleSocketAddrMatchConditionParametersTypeValues() []SocketAddrMatchConditionParametersType { + return []SocketAddrMatchConditionParametersType{ + SocketAddrMatchConditionParametersTypeDeliveryRuleSocketAddrConditionParameters, } } @@ -2359,16 +2359,16 @@ func PossibleTransformTypeValues() []TransformType { } } -type URLFileExtensionMatchConditionParametersTypeName string +type URLFileExtensionMatchConditionParametersType string const ( - URLFileExtensionMatchConditionParametersTypeNameDeliveryRuleURLFileExtensionMatchConditionParameters URLFileExtensionMatchConditionParametersTypeName = "DeliveryRuleUrlFileExtensionMatchConditionParameters" + URLFileExtensionMatchConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters URLFileExtensionMatchConditionParametersType = "DeliveryRuleUrlFileExtensionMatchConditionParameters" ) -// PossibleURLFileExtensionMatchConditionParametersTypeNameValues returns the possible values for the URLFileExtensionMatchConditionParametersTypeName const type. -func PossibleURLFileExtensionMatchConditionParametersTypeNameValues() []URLFileExtensionMatchConditionParametersTypeName { - return []URLFileExtensionMatchConditionParametersTypeName{ - URLFileExtensionMatchConditionParametersTypeNameDeliveryRuleURLFileExtensionMatchConditionParameters, +// PossibleURLFileExtensionMatchConditionParametersTypeValues returns the possible values for the URLFileExtensionMatchConditionParametersType const type. +func PossibleURLFileExtensionMatchConditionParametersTypeValues() []URLFileExtensionMatchConditionParametersType { + return []URLFileExtensionMatchConditionParametersType{ + URLFileExtensionMatchConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters, } } @@ -2404,16 +2404,16 @@ func PossibleURLFileExtensionOperatorValues() []URLFileExtensionOperator { } } -type URLFileNameMatchConditionParametersTypeName string +type URLFileNameMatchConditionParametersType string const ( - URLFileNameMatchConditionParametersTypeNameDeliveryRuleURLFilenameConditionParameters URLFileNameMatchConditionParametersTypeName = "DeliveryRuleUrlFilenameConditionParameters" + URLFileNameMatchConditionParametersTypeDeliveryRuleURLFilenameConditionParameters URLFileNameMatchConditionParametersType = "DeliveryRuleUrlFilenameConditionParameters" ) -// PossibleURLFileNameMatchConditionParametersTypeNameValues returns the possible values for the URLFileNameMatchConditionParametersTypeName const type. -func PossibleURLFileNameMatchConditionParametersTypeNameValues() []URLFileNameMatchConditionParametersTypeName { - return []URLFileNameMatchConditionParametersTypeName{ - URLFileNameMatchConditionParametersTypeNameDeliveryRuleURLFilenameConditionParameters, +// PossibleURLFileNameMatchConditionParametersTypeValues returns the possible values for the URLFileNameMatchConditionParametersType const type. +func PossibleURLFileNameMatchConditionParametersTypeValues() []URLFileNameMatchConditionParametersType { + return []URLFileNameMatchConditionParametersType{ + URLFileNameMatchConditionParametersTypeDeliveryRuleURLFilenameConditionParameters, } } @@ -2449,16 +2449,16 @@ func PossibleURLFileNameOperatorValues() []URLFileNameOperator { } } -type URLPathMatchConditionParametersTypeName string +type URLPathMatchConditionParametersType string const ( - URLPathMatchConditionParametersTypeNameDeliveryRuleURLPathMatchConditionParameters URLPathMatchConditionParametersTypeName = "DeliveryRuleUrlPathMatchConditionParameters" + URLPathMatchConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters URLPathMatchConditionParametersType = "DeliveryRuleUrlPathMatchConditionParameters" ) -// PossibleURLPathMatchConditionParametersTypeNameValues returns the possible values for the URLPathMatchConditionParametersTypeName const type. -func PossibleURLPathMatchConditionParametersTypeNameValues() []URLPathMatchConditionParametersTypeName { - return []URLPathMatchConditionParametersTypeName{ - URLPathMatchConditionParametersTypeNameDeliveryRuleURLPathMatchConditionParameters, +// PossibleURLPathMatchConditionParametersTypeValues returns the possible values for the URLPathMatchConditionParametersType const type. +func PossibleURLPathMatchConditionParametersTypeValues() []URLPathMatchConditionParametersType { + return []URLPathMatchConditionParametersType{ + URLPathMatchConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters, } } @@ -2496,42 +2496,42 @@ func PossibleURLPathOperatorValues() []URLPathOperator { } } -type URLRedirectActionParametersTypeName string +type URLRedirectActionParametersType string const ( - URLRedirectActionParametersTypeNameDeliveryRuleURLRedirectActionParameters URLRedirectActionParametersTypeName = "DeliveryRuleUrlRedirectActionParameters" + URLRedirectActionParametersTypeDeliveryRuleURLRedirectActionParameters URLRedirectActionParametersType = "DeliveryRuleUrlRedirectActionParameters" ) -// PossibleURLRedirectActionParametersTypeNameValues returns the possible values for the URLRedirectActionParametersTypeName const type. -func PossibleURLRedirectActionParametersTypeNameValues() []URLRedirectActionParametersTypeName { - return []URLRedirectActionParametersTypeName{ - URLRedirectActionParametersTypeNameDeliveryRuleURLRedirectActionParameters, +// PossibleURLRedirectActionParametersTypeValues returns the possible values for the URLRedirectActionParametersType const type. +func PossibleURLRedirectActionParametersTypeValues() []URLRedirectActionParametersType { + return []URLRedirectActionParametersType{ + URLRedirectActionParametersTypeDeliveryRuleURLRedirectActionParameters, } } -type URLRewriteActionParametersTypeName string +type URLRewriteActionParametersType string const ( - URLRewriteActionParametersTypeNameDeliveryRuleURLRewriteActionParameters URLRewriteActionParametersTypeName = "DeliveryRuleUrlRewriteActionParameters" + URLRewriteActionParametersTypeDeliveryRuleURLRewriteActionParameters URLRewriteActionParametersType = "DeliveryRuleUrlRewriteActionParameters" ) -// PossibleURLRewriteActionParametersTypeNameValues returns the possible values for the URLRewriteActionParametersTypeName const type. -func PossibleURLRewriteActionParametersTypeNameValues() []URLRewriteActionParametersTypeName { - return []URLRewriteActionParametersTypeName{ - URLRewriteActionParametersTypeNameDeliveryRuleURLRewriteActionParameters, +// PossibleURLRewriteActionParametersTypeValues returns the possible values for the URLRewriteActionParametersType const type. +func PossibleURLRewriteActionParametersTypeValues() []URLRewriteActionParametersType { + return []URLRewriteActionParametersType{ + URLRewriteActionParametersTypeDeliveryRuleURLRewriteActionParameters, } } -type URLSigningActionParametersTypeName string +type URLSigningActionParametersType string const ( - URLSigningActionParametersTypeNameDeliveryRuleURLSigningActionParameters URLSigningActionParametersTypeName = "DeliveryRuleUrlSigningActionParameters" + URLSigningActionParametersTypeDeliveryRuleURLSigningActionParameters URLSigningActionParametersType = "DeliveryRuleUrlSigningActionParameters" ) -// PossibleURLSigningActionParametersTypeNameValues returns the possible values for the URLSigningActionParametersTypeName const type. -func PossibleURLSigningActionParametersTypeNameValues() []URLSigningActionParametersTypeName { - return []URLSigningActionParametersTypeName{ - URLSigningActionParametersTypeNameDeliveryRuleURLSigningActionParameters, +// PossibleURLSigningActionParametersTypeValues returns the possible values for the URLSigningActionParametersType const type. +func PossibleURLSigningActionParametersTypeValues() []URLSigningActionParametersType { + return []URLSigningActionParametersType{ + URLSigningActionParametersTypeDeliveryRuleURLSigningActionParameters, } } 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 f3b6d352852f..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/edgenodes_client_example_test.go deleted file mode 100644 index 258c88b11ee5..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/endpoints_client_example_test.go deleted file mode 100644 index 675a9dd81bdd..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/go.mod b/sdk/resourcemanager/cdn/armcdn/go.mod index 7cbcdcbde013..f075aad767be 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.6.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // 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..928fb210944a 100644 --- a/sdk/resourcemanager/cdn/armcdn/interfaces.go +++ b/sdk/resourcemanager/cdn/armcdn/interfaces.go @@ -17,15 +17,15 @@ 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 } // DeliveryRuleConditionClassification provides polymorphic access to related types. 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 5766b05ad767..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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-04T12:30:27.554+08:00"); return t}()), - // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T13:00:27.554+08:00"); 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+00:00"); return t}()), - // Value: to.Ptr[float32](4250), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:40:00+00:00"); return t}()), - // Value: to.Ptr[float32](3120), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:45:00+00:00"); return t}()), - // Value: to.Ptr[float32](2221), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:50:00+00:00"); return t}()), - // Value: to.Ptr[float32](2466), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T04:55:00+00:00"); return t}()), - // Value: to.Ptr[float32](2654), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T05:00:00+00:00"); 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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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-04T14:49:27.554+08:00"); return t}()), - // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T17:49:27.554+08:00"); 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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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-04T14:30:27.554+08:00"); return t}()), - // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T17:00:27.554+08:00"); 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+00:00"); return t}()), - // Value: to.Ptr[float32](2), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:10:00+00:00"); return t}()), - // Value: to.Ptr[float32](32), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:15:00+00:00"); return t}()), - // Value: to.Ptr[float32](31), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:20:00+00:00"); return t}()), - // Value: to.Ptr[float32](63), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:25:00+00:00"); return t}()), - // Value: to.Ptr[float32](50), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:30:00+00:00"); return t}()), - // Value: to.Ptr[float32](12), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:35:00+00:00"); return t}()), - // Value: to.Ptr[float32](8), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:40:00+00:00"); return t}()), - // Value: to.Ptr[float32](21), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:45:00+00:00"); return t}()), - // Value: to.Ptr[float32](30), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:50:00+00:00"); return t}()), - // Value: to.Ptr[float32](18), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T07:55:00+00:00"); return t}()), - // Value: to.Ptr[float32](28), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:00:00+00:00"); return t}()), - // Value: to.Ptr[float32](3), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:05:00+00:00"); return t}()), - // Value: to.Ptr[float32](58), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:10:00+00:00"); return t}()), - // Value: to.Ptr[float32](42), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:15:00+00:00"); return t}()), - // Value: to.Ptr[float32](17), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:20:00+00:00"); return t}()), - // Value: to.Ptr[float32](21), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:25:00+00:00"); return t}()), - // Value: to.Ptr[float32](41), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:30:00+00:00"); return t}()), - // Value: to.Ptr[float32](8), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:35:00+00:00"); return t}()), - // Value: to.Ptr[float32](15), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:40:00+00:00"); return t}()), - // Value: to.Ptr[float32](25), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:45:00+00:00"); return t}()), - // Value: to.Ptr[float32](13), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:50:00+00:00"); return t}()), - // Value: to.Ptr[float32](17), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T08:55:00+00:00"); return t}()), - // Value: to.Ptr[float32](29), - // }, - // { - // DateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T09:00:00+00:00"); 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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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-04T14:49:27.554+08:00"); return t}()), - // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T17:49:27.554+08:00"); return t}()), - // Groups: []*string{ - // to.Ptr("ruleId")}, - // } -} 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 1dd4c2299f10..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/management_client_example_test.go deleted file mode 100644 index c5f680758d35..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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 508f5d582157..ca0540bb0a5b 100644 --- a/sdk/resourcemanager/cdn/armcdn/models.go +++ b/sdk/resourcemanager/cdn/armcdn/models.go @@ -488,7 +488,7 @@ type CacheExpirationActionParameters struct { CacheType *CacheType // REQUIRED - TypeName *CacheExpirationActionParametersTypeName + TypeName *CacheExpirationActionParametersType // The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss CacheDuration *string @@ -500,7 +500,7 @@ type CacheKeyQueryStringActionParameters struct { QueryStringBehavior *QueryStringBehavior // REQUIRED - TypeName *CacheKeyQueryStringActionParametersTypeName + TypeName *CacheKeyQueryStringActionParametersType // query parameters to include or exclude (comma separated). QueryParameters *string @@ -539,7 +539,7 @@ type CertificateSourceParameters struct { CertificateType *CertificateType // REQUIRED - TypeName *CdnCertificateSourceParametersTypeName + TypeName *CdnCertificateSourceParametersType } // CheckEndpointNameAvailabilityInput - Input of CheckNameAvailability API. @@ -612,7 +612,7 @@ type ClientPortMatchConditionParameters struct { Operator *ClientPortOperator // REQUIRED - TypeName *ClientPortMatchConditionParametersTypeName + TypeName *ClientPortMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -672,7 +672,7 @@ type CookiesMatchConditionParameters struct { Operator *CookiesOperator // REQUIRED - TypeName *CookiesMatchConditionParametersTypeName + TypeName *CookiesMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -933,7 +933,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 +947,27 @@ 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 } -// GetDeliveryRuleActionAutoGenerated implements the DeliveryRuleActionAutoGeneratedClassification interface for type DeliveryRuleActionAutoGenerated. -func (d *DeliveryRuleActionAutoGenerated) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated { - return d -} +// GetDeliveryRuleAction implements the DeliveryRuleActionClassification interface for type DeliveryRuleAction. +func (d *DeliveryRuleAction) GetDeliveryRuleAction() *DeliveryRuleAction { 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 +975,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, } } @@ -1146,15 +1144,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 +1224,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 +1241,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 +1629,7 @@ type HTTPVersionMatchConditionParameters struct { Operator *HTTPVersionOperator // REQUIRED - TypeName *HTTPVersionMatchConditionParametersTypeName + TypeName *HTTPVersionMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -1652,7 +1650,7 @@ type HeaderActionParameters struct { HeaderName *string // REQUIRED - TypeName *HeaderActionParametersTypeName + TypeName *HeaderActionParametersType // Value for the specified action Value *string @@ -1679,7 +1677,7 @@ type HostNameMatchConditionParameters struct { Operator *HostNameOperator // REQUIRED - TypeName *HostNameMatchConditionParametersTypeName + TypeName *HostNameMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -1709,10 +1707,10 @@ type IsDeviceMatchConditionParameters struct { Operator *IsDeviceOperator // REQUIRED - TypeName *IsDeviceMatchConditionParametersTypeName + TypeName *IsDeviceMatchConditionParametersType // The match value for the condition of the delivery rule - MatchValues []*IsDeviceMatchConditionParametersMatchValuesItem + MatchValues []*IsDeviceMatchValue // Describes if this is negate condition or not NegateCondition *bool @@ -1737,7 +1735,7 @@ type KeyVaultCertificateSourceParameters struct { SubscriptionID *string // REQUIRED - TypeName *KeyVaultCertificateSourceParametersTypeName + TypeName *KeyVaultCertificateSourceParametersType // REQUIRED; Describes the action that shall be taken when the certificate is updated in Key Vault. UpdateRule *UpdateRule @@ -1764,7 +1762,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 @@ -2229,15 +2227,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 +2246,7 @@ type OriginGroupOverrideActionParameters struct { OriginGroup *ResourceReference // REQUIRED - TypeName *OriginGroupOverrideActionParametersTypeName + TypeName *OriginGroupOverrideActionParametersType } // OriginGroupProperties - The JSON object that contains the properties of the origin group. @@ -2426,7 +2424,7 @@ type PostArgsMatchConditionParameters struct { Operator *PostArgsOperator // REQUIRED - TypeName *PostArgsMatchConditionParametersTypeName + TypeName *PostArgsMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2548,7 +2546,7 @@ type QueryStringMatchConditionParameters struct { Operator *QueryStringOperator // REQUIRED - TypeName *QueryStringMatchConditionParametersTypeName + TypeName *QueryStringMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2619,7 +2617,7 @@ type RemoteAddressMatchConditionParameters struct { Operator *RemoteAddressOperator // REQUIRED - TypeName *RemoteAddressMatchConditionParametersTypeName + TypeName *RemoteAddressMatchConditionParametersType // 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. @@ -2638,7 +2636,7 @@ type RequestBodyMatchConditionParameters struct { Operator *RequestBodyOperator // REQUIRED - TypeName *RequestBodyMatchConditionParametersTypeName + TypeName *RequestBodyMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2656,7 +2654,7 @@ type RequestHeaderMatchConditionParameters struct { Operator *RequestHeaderOperator // REQUIRED - TypeName *RequestHeaderMatchConditionParametersTypeName + TypeName *RequestHeaderMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2677,10 +2675,10 @@ type RequestMethodMatchConditionParameters struct { Operator *RequestMethodOperator // REQUIRED - TypeName *RequestMethodMatchConditionParametersTypeName + TypeName *RequestMethodMatchConditionParametersType // The match value for the condition of the delivery rule - MatchValues []*RequestMethodMatchConditionParametersMatchValuesItem + MatchValues []*RequestMethodMatchValue // Describes if this is negate condition or not NegateCondition *bool @@ -2695,10 +2693,10 @@ type RequestSchemeMatchConditionParameters struct { Operator *RequestSchemeMatchConditionParametersOperator // REQUIRED - TypeName *RequestSchemeMatchConditionParametersTypeName + TypeName *RequestSchemeMatchConditionParametersType // The match value for the condition of the delivery rule - MatchValues []*RequestSchemeMatchConditionParametersMatchValuesItem + MatchValues []*RequestSchemeMatchValue // Describes if this is negate condition or not NegateCondition *bool @@ -2713,7 +2711,7 @@ type RequestURIMatchConditionParameters struct { Operator *RequestURIOperator // REQUIRED - TypeName *RequestURIMatchConditionParametersTypeName + TypeName *RequestURIMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -2816,7 +2814,7 @@ type Route struct { // RouteConfigurationOverrideActionParameters - Defines the parameters for the route configuration override action. type RouteConfigurationOverrideActionParameters struct { // REQUIRED - TypeName *RouteConfigurationOverrideActionParametersTypeName + TypeName *RouteConfigurationOverrideActionParametersType // The caching configuration associated with this rule. To disable caching, do not provide a cacheConfiguration object. CacheConfiguration *CacheConfiguration @@ -2958,7 +2956,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 @@ -3031,7 +3029,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 @@ -3073,7 +3071,7 @@ type SSLProtocolMatchConditionParameters struct { Operator *SSLProtocolOperator // REQUIRED - TypeName *SSLProtocolMatchConditionParametersTypeName + TypeName *SSLProtocolMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*SSLProtocol @@ -3239,7 +3237,7 @@ type ServerPortMatchConditionParameters struct { Operator *ServerPortOperator // REQUIRED - TypeName *ServerPortMatchConditionParametersTypeName + TypeName *ServerPortMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3285,7 +3283,7 @@ type SocketAddrMatchConditionParameters struct { Operator *SocketAddrOperator // REQUIRED - TypeName *SocketAddrMatchConditionParametersTypeName + TypeName *SocketAddrMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3336,7 +3334,7 @@ type URLFileExtensionMatchConditionParameters struct { Operator *URLFileExtensionOperator // REQUIRED - TypeName *URLFileExtensionMatchConditionParametersTypeName + TypeName *URLFileExtensionMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3354,7 +3352,7 @@ type URLFileNameMatchConditionParameters struct { Operator *URLFileNameOperator // REQUIRED - TypeName *URLFileNameMatchConditionParametersTypeName + TypeName *URLFileNameMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3372,7 +3370,7 @@ type URLPathMatchConditionParameters struct { Operator *URLPathOperator // REQUIRED - TypeName *URLPathMatchConditionParametersTypeName + TypeName *URLPathMatchConditionParametersType // The match value for the condition of the delivery rule MatchValues []*string @@ -3387,15 +3385,15 @@ type URLPathMatchConditionParameters struct { // 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, } } @@ -3406,7 +3404,7 @@ type URLRedirectActionParameters struct { RedirectType *RedirectType // REQUIRED - TypeName *URLRedirectActionParametersTypeName + TypeName *URLRedirectActionParametersType // Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. CustomFragment *string @@ -3430,15 +3428,15 @@ type URLRedirectActionParameters struct { // 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, } } @@ -3453,7 +3451,7 @@ type URLRewriteActionParameters struct { SourcePattern *string // REQUIRED - TypeName *URLRewriteActionParametersTypeName + TypeName *URLRewriteActionParametersType // Whether to preserve unmatched path. Default value is true. PreserveUnmatchedPath *bool @@ -3462,15 +3460,15 @@ type URLRewriteActionParameters struct { // 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, } } @@ -3478,7 +3476,7 @@ func (u *URLSigningAction) GetDeliveryRuleActionAutoGenerated() *DeliveryRuleAct // URLSigningActionParameters - Defines the parameters for the Url Signing action. type URLSigningActionParameters struct { // REQUIRED - TypeName *URLSigningActionParametersTypeName + TypeName *URLSigningActionParametersType // Algorithm to use for URL signing Algorithm *Algorithm diff --git a/sdk/resourcemanager/cdn/armcdn/models_serde.go b/sdk/resourcemanager/cdn/armcdn/models_serde.go index 9f0a9a81cb30..b6e98e278951 100644 --- a/sdk/resourcemanager/cdn/armcdn/models_serde.go +++ b/sdk/resourcemanager/cdn/armcdn/models_serde.go @@ -2377,7 +2377,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 +2396,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) @@ -2426,7 +2426,7 @@ func (d *DeliveryRuleActionAutoGenerated) UnmarshalJSON(data []byte) error { // 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 +2457,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) } @@ -2794,7 +2794,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 +2949,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 +2980,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) } @@ -5396,7 +5396,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) } @@ -7324,7 +7324,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) @@ -7509,7 +7509,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) @@ -8394,7 +8394,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) } @@ -8476,7 +8476,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) } @@ -8546,7 +8546,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) } 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 538cca556524..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/origingroups_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/origingroups_client_example_test.go deleted file mode 100644 index 894fa444bba6..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/origins_client_example_test.go deleted file mode 100644 index 444459d47245..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/policies_client_example_test.go deleted file mode 100644 index af5a3c10d668..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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 e6ea07af0b72..3385822e08e6 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 { 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 { 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_example_test.go b/sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go deleted file mode 100644 index 008dc86271d4..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go +++ /dev/null @@ -1,480 +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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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"), - // 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"), - // 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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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"), - // 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"), - // 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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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"), - // 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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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"), - // 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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/resourceusage_client_example_test.go deleted file mode 100644 index 11f03e8211f0..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/routes_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/routes_client_example_test.go deleted file mode 100644 index b44a03fe5287..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/rules_client_example_test.go deleted file mode 100644 index eebdc01edfaf..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/rulesets_client_example_test.go deleted file mode 100644 index 699c87db5688..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/secrets_client_example_test.go deleted file mode 100644 index deeb88930cdd..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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_example_test.go b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client_example_test.go deleted file mode 100644 index a66a44f7dd23..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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-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) - } -}