diff --git a/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md b/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md index 32ab4dd8fe40..3891ed1a3c9c 100644 --- a/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md +++ b/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md @@ -1,5 +1,116 @@ # Release History +## 2.0.0-beta.1 (2022-10-19) +### Breaking Changes + +- Type of `MetricsResponse.Granularity` has been changed from `*MetricsResponseGranularity` to `*MetricsGranularity` +- Type of `EndpointProperties.CustomDomains` has been changed from `[]*CustomDomain` to `[]*DeepCreatedCustomDomain` +- Type of `WafMetricsResponse.Granularity` has been changed from `*WafMetricsResponseGranularity` to `*WafMetricsGranularity` +- Type of `MetricsResponseSeriesItem.Unit` has been changed from `*MetricsResponseSeriesItemUnit` to `*MetricsSeriesUnit` +- Type of `WafMetricsResponseSeriesItem.Unit` has been changed from `*WafMetricsResponseSeriesItemUnit` to `*WafMetricsSeriesUnit` +- Const `WafMetricsResponseGranularityPT1H` has been removed +- Const `MetricsResponseSeriesItemUnitBytes` has been removed +- Const `MetricsResponseSeriesItemUnitCount` has been removed +- Const `WafMetricsResponseGranularityPT5M` has been removed +- Const `WafMetricsResponseGranularityP1D` has been removed +- Const `MetricsResponseSeriesItemUnitMilliSeconds` has been removed +- Const `MetricsResponseSeriesItemUnitBitsPerSecond` has been removed +- Const `MetricsResponseGranularityPT5M` has been removed +- Const `WafMetricsResponseSeriesItemUnitCount` has been removed +- Const `MetricsResponseGranularityPT1H` has been removed +- Const `MetricsResponseGranularityP1D` has been removed +- Type alias `MetricsResponseGranularity` has been removed +- Type alias `WafMetricsResponseSeriesItemUnit` has been removed +- Type alias `MetricsResponseSeriesItemUnit` has been removed +- Type alias `WafMetricsResponseGranularity` has been removed +- Function `PossibleMetricsResponseSeriesItemUnitValues` has been removed +- Function `*CustomDomainsClient.EnableCustomHTTPS` has been removed +- Function `PossibleWafMetricsResponseSeriesItemUnitValues` has been removed +- Function `NewValidateClient` has been removed +- Function `PossibleWafMetricsResponseGranularityValues` has been removed +- Function `*CustomDomainsClient.DisableCustomHTTPS` has been removed +- Function `PossibleMetricsResponseGranularityValues` has been removed +- Function `*ValidateClient.Secret` has been removed +- Struct `CustomDomainsClientDisableCustomHTTPSOptions` has been removed +- Struct `CustomDomainsClientEnableCustomHTTPSOptions` has been removed +- Struct `ValidateClient` has been removed +- Struct `ValidateClientSecretOptions` has been removed +- Struct `ValidateClientSecretResponse` has been removed + +### Features Added + +- New const `WafMetricsGranularityPT5M` +- New const `ManagedServiceIdentityTypeNone` +- New const `MetricsGranularityP1D` +- New const `ProfileResourceStateMigrating` +- New const `ProfileResourceStateMigrated` +- New const `ProfileResourceStatePendingMigrationCommit` +- New const `MetricsSeriesUnitBytes` +- New const `MetricsGranularityPT5M` +- New const `CanMigrateDefaultSKUPremiumAzureFrontDoor` +- New const `WafMetricsGranularityP1D` +- New const `MetricsSeriesUnitBitsPerSecond` +- New const `ManagedServiceIdentityTypeSystemAssigned` +- New const `ManagedServiceIdentityTypeSystemAssignedUserAssigned` +- New const `MetricsGranularityPT1H` +- New const `MetricsSeriesUnitCount` +- New const `MetricsSeriesUnitMilliSeconds` +- New const `CanMigrateDefaultSKUStandardAzureFrontDoor` +- New const `ManagedServiceIdentityTypeUserAssigned` +- New const `ProfileResourceStateAbortingMigration` +- New const `ProfileResourceStateCommittingMigration` +- New const `WafMetricsSeriesUnitCount` +- New const `WafMetricsGranularityPT1H` +- New type alias `WafMetricsSeriesUnit` +- New type alias `CanMigrateDefaultSKU` +- New type alias `MetricsSeriesUnit` +- New type alias `ManagedServiceIdentityType` +- New type alias `WafMetricsGranularity` +- New type alias `MetricsGranularity` +- New function `*CustomDomainsClient.BeginDisableCustomHTTPS(context.Context, string, string, string, string, *CustomDomainsClientBeginDisableCustomHTTPSOptions) (*runtime.Poller[CustomDomainsClientDisableCustomHTTPSResponse], error)` +- New function `PossibleMetricsGranularityValues() []MetricsGranularity` +- New function `*ProfilesClient.CanMigrate(context.Context, string, CanMigrateParameters, *ProfilesClientCanMigrateOptions) (ProfilesClientCanMigrateResponse, error)` +- New function `PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType` +- New function `*ProfilesClient.BeginMigrate(context.Context, string, MigrationParameters, *ProfilesClientBeginMigrateOptions) (*runtime.Poller[ProfilesClientMigrateResponse], error)` +- New function `*CustomDomainsClient.BeginEnableCustomHTTPS(context.Context, string, string, string, string, *CustomDomainsClientBeginEnableCustomHTTPSOptions) (*runtime.Poller[CustomDomainsClientEnableCustomHTTPSResponse], error)` +- New function `PossibleWafMetricsSeriesUnitValues() []WafMetricsSeriesUnit` +- New function `PossibleMetricsSeriesUnitValues() []MetricsSeriesUnit` +- New function `PossibleWafMetricsGranularityValues() []WafMetricsGranularity` +- New function `*ProfilesClient.BeginMigrationCommit(context.Context, string, string, *ProfilesClientBeginMigrationCommitOptions) (*runtime.Poller[ProfilesClientMigrationCommitResponse], error)` +- New function `PossibleCanMigrateDefaultSKUValues() []CanMigrateDefaultSKU` +- New function `*AFDProfilesClient.ValidateSecret(context.Context, string, string, ValidateSecretInput, *AFDProfilesClientValidateSecretOptions) (AFDProfilesClientValidateSecretResponse, error)` +- New function `*AFDProfilesClient.BeginUpgrade(context.Context, string, string, ProfileUpgradeParameters, *AFDProfilesClientBeginUpgradeOptions) (*runtime.Poller[AFDProfilesClientUpgradeResponse], error)` +- New struct `AFDProfilesClientBeginUpgradeOptions` +- New struct `AFDProfilesClientUpgradeResponse` +- New struct `AFDProfilesClientValidateSecretOptions` +- New struct `AFDProfilesClientValidateSecretResponse` +- New struct `CanMigrateParameters` +- New struct `CanMigrateResult` +- New struct `CustomDomainsClientBeginDisableCustomHTTPSOptions` +- New struct `CustomDomainsClientBeginEnableCustomHTTPSOptions` +- New struct `DeepCreatedCustomDomain` +- New struct `DeepCreatedCustomDomainProperties` +- New struct `ManagedServiceIdentity` +- New struct `MigrateResult` +- New struct `MigrationErrorType` +- New struct `MigrationParameters` +- New struct `MigrationWebApplicationFirewallMapping` +- New struct `ProfileChangeSKUWafMapping` +- New struct `ProfileUpgradeParameters` +- New struct `ProfilesClientBeginMigrateOptions` +- New struct `ProfilesClientBeginMigrationCommitOptions` +- New struct `ProfilesClientCanMigrateOptions` +- New struct `ProfilesClientCanMigrateResponse` +- New struct `ProfilesClientMigrateResponse` +- New struct `ProfilesClientMigrationCommitResponse` +- New struct `UserAssignedIdentity` +- New field `ExtendedProperties` in struct `ProfileProperties` +- New field `ExtendedProperties` in struct `WebApplicationFirewallPolicyProperties` +- New field `Identity` in struct `Profile` +- New field `ExtendedProperties` in struct `AFDDomainProperties` +- New field `Identity` in struct `ProfileUpdateParameters` + + ## 1.0.0 (2022-05-17) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdcustomdomains_client.go b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_afdcustomdomains_client.go rename to sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go index 5d4f0c94eb26..7a7a9014e5c5 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdcustomdomains_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewAFDCustomDomainsClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Creates a new domain within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -80,7 +81,7 @@ func (client *AFDCustomDomainsClient) BeginCreate(ctx context.Context, resourceG // Create - Creates a new domain within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDCustomDomainsClient) create(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomain AFDDomain, options *AFDCustomDomainsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, customDomainName, customDomain, options) if err != nil { @@ -120,7 +121,7 @@ func (client *AFDCustomDomainsClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, customDomain) @@ -129,7 +130,7 @@ func (client *AFDCustomDomainsClient) createCreateRequest(ctx context.Context, r // BeginDelete - Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -153,7 +154,7 @@ func (client *AFDCustomDomainsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource // group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, customDomainName, options) if err != nil { @@ -193,7 +194,7 @@ func (client *AFDCustomDomainsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +203,7 @@ func (client *AFDCustomDomainsClient) deleteCreateRequest(ctx context.Context, r // Get - Gets an existing AzureFrontDoor domain with the specified domain name under the specified subscription, resource // group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -247,7 +248,7 @@ func (client *AFDCustomDomainsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,11 +264,10 @@ func (client *AFDCustomDomainsClient) getHandleResponse(resp *http.Response) (AF } // NewListByProfilePager - Lists existing AzureFrontDoor domains. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. -// profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile or CDN profile which is unique -// within the resource group. +// profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource +// group. // options - AFDCustomDomainsClientListByProfileOptions contains the optional parameters for the AFDCustomDomainsClient.ListByProfile // method. func (client *AFDCustomDomainsClient) NewListByProfilePager(resourceGroupName string, profileName string, options *AFDCustomDomainsClientListByProfileOptions) *runtime.Pager[AFDCustomDomainsClientListByProfileResponse] { @@ -318,7 +318,7 @@ func (client *AFDCustomDomainsClient) listByProfileCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +335,7 @@ func (client *AFDCustomDomainsClient) listByProfileHandleResponse(resp *http.Res // BeginRefreshValidationToken - Updates the domain validation token. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -358,7 +358,7 @@ func (client *AFDCustomDomainsClient) BeginRefreshValidationToken(ctx context.Co // RefreshValidationToken - Updates the domain validation token. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDCustomDomainsClient) refreshValidationToken(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientBeginRefreshValidationTokenOptions) (*http.Response, error) { req, err := client.refreshValidationTokenCreateRequest(ctx, resourceGroupName, profileName, customDomainName, options) if err != nil { @@ -398,7 +398,7 @@ func (client *AFDCustomDomainsClient) refreshValidationTokenCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -406,7 +406,7 @@ func (client *AFDCustomDomainsClient) refreshValidationTokenCreateRequest(ctx co // BeginUpdate - Updates an existing domain within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -430,7 +430,7 @@ func (client *AFDCustomDomainsClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates an existing domain within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDCustomDomainsClient) update(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomainUpdateProperties AFDDomainUpdateParameters, options *AFDCustomDomainsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, customDomainName, customDomainUpdateProperties, options) if err != nil { @@ -470,7 +470,7 @@ func (client *AFDCustomDomainsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, customDomainUpdateProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdendpoints_client.go b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_afdendpoints_client.go rename to sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go index 2e91e03e2917..14d1974d0801 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdendpoints_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ func NewAFDEndpointsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -82,7 +83,7 @@ func (client *AFDEndpointsClient) BeginCreate(ctx context.Context, resourceGroup // Create - Creates a new AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource // group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDEndpointsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint AFDEndpoint, options *AFDEndpointsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, endpoint, options) if err != nil { @@ -122,7 +123,7 @@ func (client *AFDEndpointsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, endpoint) @@ -131,7 +132,7 @@ func (client *AFDEndpointsClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -155,7 +156,7 @@ func (client *AFDEndpointsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *AFDEndpointsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { @@ -195,7 +196,7 @@ func (client *AFDEndpointsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +205,7 @@ func (client *AFDEndpointsClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, resource // group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -249,7 +250,7 @@ func (client *AFDEndpointsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,8 +266,7 @@ func (client *AFDEndpointsClient) getHandleResponse(resp *http.Response) (AFDEnd } // NewListByProfilePager - Lists existing AzureFrontDoor endpoints. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -320,7 +320,7 @@ func (client *AFDEndpointsClient) listByProfileCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,10 +335,8 @@ func (client *AFDEndpointsClient) listByProfileHandleResponse(resp *http.Respons return result, nil } -// NewListResourceUsagePager - Checks the quota and actual usage of the given AzureFrontDoor endpoint under the given CDN -// profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile. +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -397,7 +395,7 @@ func (client *AFDEndpointsClient) listResourceUsageCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -414,7 +412,7 @@ func (client *AFDEndpointsClient) listResourceUsageHandleResponse(resp *http.Res // BeginPurgeContent - Removes a content from AzureFrontDoor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -440,7 +438,7 @@ func (client *AFDEndpointsClient) BeginPurgeContent(ctx context.Context, resourc // PurgeContent - Removes a content from AzureFrontDoor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDEndpointsClient) purgeContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contents AfdPurgeParameters, options *AFDEndpointsClientBeginPurgeContentOptions) (*http.Response, error) { req, err := client.purgeContentCreateRequest(ctx, resourceGroupName, profileName, endpointName, contents, options) if err != nil { @@ -480,7 +478,7 @@ func (client *AFDEndpointsClient) purgeContentCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, contents) @@ -491,7 +489,7 @@ func (client *AFDEndpointsClient) purgeContentCreateRequest(ctx context.Context, // update origins, use the Update Origin operation. To update origin groups, use the Update Origin group operation. To update // domains, use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -518,7 +516,7 @@ func (client *AFDEndpointsClient) BeginUpdate(ctx context.Context, resourceGroup // update origins, use the Update Origin operation. To update origin groups, use the Update Origin group operation. To update // domains, use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDEndpointsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties AFDEndpointUpdateParameters, options *AFDEndpointsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, endpointUpdateProperties, options) if err != nil { @@ -558,16 +556,16 @@ func (client *AFDEndpointsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, endpointUpdateProperties) } -// ValidateCustomDomain - Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.This api -// isn't work for apex domain. +// ValidateCustomDomain - Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint in +// DNS. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -614,7 +612,7 @@ func (client *AFDEndpointsClient) validateCustomDomainCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, customDomainProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdorigingroups_client.go b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_afdorigingroups_client.go rename to sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go index fe71c334ac50..3e81d76eabcf 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdorigingroups_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewAFDOriginGroupsClient(subscriptionID string, credential azcore.TokenCred // BeginCreate - Creates a new origin group within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -80,7 +81,7 @@ func (client *AFDOriginGroupsClient) BeginCreate(ctx context.Context, resourceGr // Create - Creates a new origin group within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDOriginGroupsClient) create(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroup AFDOriginGroup, options *AFDOriginGroupsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originGroup, options) if err != nil { @@ -120,7 +121,7 @@ func (client *AFDOriginGroupsClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, originGroup) @@ -128,7 +129,7 @@ func (client *AFDOriginGroupsClient) createCreateRequest(ctx context.Context, re // BeginDelete - Deletes an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -151,7 +152,7 @@ func (client *AFDOriginGroupsClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDOriginGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, options *AFDOriginGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, originGroupName, options) if err != nil { @@ -191,7 +192,7 @@ func (client *AFDOriginGroupsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +200,7 @@ func (client *AFDOriginGroupsClient) deleteCreateRequest(ctx context.Context, re // Get - Gets an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -244,7 +245,7 @@ func (client *AFDOriginGroupsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,8 +261,7 @@ func (client *AFDOriginGroupsClient) getHandleResponse(resp *http.Response) (AFD } // NewListByProfilePager - Lists all of the existing origin groups within a profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -315,7 +315,7 @@ func (client *AFDOriginGroupsClient) listByProfileCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,10 +330,8 @@ func (client *AFDOriginGroupsClient) listByProfileHandleResponse(resp *http.Resp return result, nil } -// NewListResourceUsagePager - Checks the quota and actual usage of the given AzureFrontDoor origin group under the given -// CDN profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -392,7 +390,7 @@ func (client *AFDOriginGroupsClient) listResourceUsageCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -409,7 +407,7 @@ func (client *AFDOriginGroupsClient) listResourceUsageHandleResponse(resp *http. // BeginUpdate - Updates an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -433,7 +431,7 @@ func (client *AFDOriginGroupsClient) BeginUpdate(ctx context.Context, resourceGr // Update - Updates an existing origin group within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDOriginGroupsClient) update(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroupUpdateProperties AFDOriginGroupUpdateParameters, options *AFDOriginGroupsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originGroupUpdateProperties, options) if err != nil { @@ -473,7 +471,7 @@ func (client *AFDOriginGroupsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, originGroupUpdateProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdorigins_client.go b/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_afdorigins_client.go rename to sdk/resourcemanager/cdn/armcdn/afdorigins_client.go index c0a00507a357..856bef7ece28 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdorigins_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewAFDOriginsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Creates a new origin within the specified origin group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -80,7 +81,7 @@ func (client *AFDOriginsClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Creates a new origin within the specified origin group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDOriginsClient) create(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, origin AFDOrigin, options *AFDOriginsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originName, origin, options) if err != nil { @@ -124,7 +125,7 @@ func (client *AFDOriginsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, origin) @@ -132,7 +133,7 @@ func (client *AFDOriginsClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Deletes an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -155,7 +156,7 @@ func (client *AFDOriginsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDOriginsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, options *AFDOriginsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originName, options) if err != nil { @@ -199,7 +200,7 @@ func (client *AFDOriginsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +208,7 @@ func (client *AFDOriginsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -257,7 +258,7 @@ func (client *AFDOriginsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,8 +274,7 @@ func (client *AFDOriginsClient) getHandleResponse(resp *http.Response) (AFDOrigi } // NewListByOriginGroupPager - Lists all of the existing origins within an origin group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -333,7 +333,7 @@ func (client *AFDOriginsClient) listByOriginGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +350,7 @@ func (client *AFDOriginsClient) listByOriginGroupHandleResponse(resp *http.Respo // BeginUpdate - Updates an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -374,7 +374,7 @@ func (client *AFDOriginsClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates an existing origin within an origin group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *AFDOriginsClient) update(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, originUpdateProperties AFDOriginUpdateParameters, options *AFDOriginsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originName, originUpdateProperties, options) if err != nil { @@ -418,7 +418,7 @@ func (client *AFDOriginsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, originUpdateProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdprofiles_client.go b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go similarity index 54% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_afdprofiles_client.go rename to sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go index 7d6a9dc2c525..e4a4cf986be0 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_afdprofiles_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go @@ -5,6 +5,7 @@ // 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 @@ -54,12 +55,13 @@ func NewAFDProfilesClient(subscriptionID string, credential azcore.TokenCredenti return client, nil } -// CheckHostNameAvailability - Check the name availability of a host name. +// CheckHostNameAvailability - Validates the custom domain mapping to ensure it maps to the correct Azure Front Door endpoint +// in DNS. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. -// profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the -// resource group. +// profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource +// group. // checkHostNameAvailabilityInput - Custom domain to be validated. // options - AFDProfilesClientCheckHostNameAvailabilityOptions contains the optional parameters for the AFDProfilesClient.CheckHostNameAvailability // method. @@ -98,7 +100,7 @@ func (client *AFDProfilesClient) checkHostNameAvailabilityCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkHostNameAvailabilityInput) @@ -113,12 +115,11 @@ func (client *AFDProfilesClient) checkHostNameAvailabilityHandleResponse(resp *h return result, nil } -// NewListResourceUsagePager - Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile. +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. -// profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the -// resource group. +// profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource +// group. // options - AFDProfilesClientListResourceUsageOptions contains the optional parameters for the AFDProfilesClient.ListResourceUsage // method. func (client *AFDProfilesClient) NewListResourceUsagePager(resourceGroupName string, profileName string, options *AFDProfilesClientListResourceUsageOptions) *runtime.Pager[AFDProfilesClientListResourceUsageResponse] { @@ -169,7 +170,7 @@ func (client *AFDProfilesClient) listResourceUsageCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,3 +184,127 @@ func (client *AFDProfilesClient) listResourceUsageHandleResponse(resp *http.Resp } return result, nil } + +// BeginUpgrade - Upgrade a profile from StandardAzureFrontDoor to PremiumAzureFrontDoor. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +// resourceGroupName - Name of the Resource group within the Azure subscription. +// profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. +// profileUpgradeParameters - Profile upgrade input parameter. +// options - AFDProfilesClientBeginUpgradeOptions contains the optional parameters for the AFDProfilesClient.BeginUpgrade +// method. +func (client *AFDProfilesClient) BeginUpgrade(ctx context.Context, resourceGroupName string, profileName string, profileUpgradeParameters ProfileUpgradeParameters, options *AFDProfilesClientBeginUpgradeOptions) (*runtime.Poller[AFDProfilesClientUpgradeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.upgrade(ctx, resourceGroupName, profileName, profileUpgradeParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AFDProfilesClientUpgradeResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[AFDProfilesClientUpgradeResponse](options.ResumeToken, client.pl, nil) + } +} + +// Upgrade - Upgrade a profile from StandardAzureFrontDoor to PremiumAzureFrontDoor. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +func (client *AFDProfilesClient) upgrade(ctx context.Context, resourceGroupName string, profileName string, profileUpgradeParameters ProfileUpgradeParameters, options *AFDProfilesClientBeginUpgradeOptions) (*http.Response, error) { + req, err := client.upgradeCreateRequest(ctx, resourceGroupName, profileName, profileUpgradeParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// upgradeCreateRequest creates the Upgrade request. +func (client *AFDProfilesClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, profileName string, profileUpgradeParameters ProfileUpgradeParameters, options *AFDProfilesClientBeginUpgradeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/upgrade" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, profileUpgradeParameters) +} + +// ValidateSecret - Validate a Secret in the profile. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +// resourceGroupName - Name of the Resource group within the Azure subscription. +// profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. +// validateSecretInput - The Secret source. +// options - AFDProfilesClientValidateSecretOptions contains the optional parameters for the AFDProfilesClient.ValidateSecret +// method. +func (client *AFDProfilesClient) ValidateSecret(ctx context.Context, resourceGroupName string, profileName string, validateSecretInput ValidateSecretInput, options *AFDProfilesClientValidateSecretOptions) (AFDProfilesClientValidateSecretResponse, error) { + req, err := client.validateSecretCreateRequest(ctx, resourceGroupName, profileName, validateSecretInput, options) + if err != nil { + return AFDProfilesClientValidateSecretResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AFDProfilesClientValidateSecretResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AFDProfilesClientValidateSecretResponse{}, runtime.NewResponseError(resp) + } + return client.validateSecretHandleResponse(resp) +} + +// validateSecretCreateRequest creates the ValidateSecret request. +func (client *AFDProfilesClient) validateSecretCreateRequest(ctx context.Context, resourceGroupName string, profileName string, validateSecretInput ValidateSecretInput, options *AFDProfilesClientValidateSecretOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/validateSecret" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, validateSecretInput) +} + +// validateSecretHandleResponse handles the ValidateSecret response. +func (client *AFDProfilesClient) validateSecretHandleResponse(resp *http.Response) (AFDProfilesClientValidateSecretResponse, error) { + result := AFDProfilesClientValidateSecretResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ValidateSecretOutput); err != nil { + return AFDProfilesClientValidateSecretResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cdn/armcdn/autorest.md b/sdk/resourcemanager/cdn/armcdn/autorest.md index 6f610b7f4e9c..65d9a7d22b95 100644 --- a/sdk/resourcemanager/cdn/armcdn/autorest.md +++ b/sdk/resourcemanager/cdn/armcdn/autorest.md @@ -5,10 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/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: 1.0.0 +module-version: 2.0.0-beta.1 modelerfour: lenient-model-deduplication: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_constants.go b/sdk/resourcemanager/cdn/armcdn/constants.go similarity index 95% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_constants.go rename to sdk/resourcemanager/cdn/armcdn/constants.go index 80022afd6882..c9b082686b7a 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_constants.go +++ b/sdk/resourcemanager/cdn/armcdn/constants.go @@ -5,12 +5,13 @@ // 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 const ( moduleName = "armcdn" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) // AFDEndpointProtocols - Supported protocols for the customer's endpoint. @@ -219,6 +220,22 @@ func PossibleCacheTypeValues() []CacheType { } } +// CanMigrateDefaultSKU - Recommended sku for the migration +type CanMigrateDefaultSKU string + +const ( + CanMigrateDefaultSKUPremiumAzureFrontDoor CanMigrateDefaultSKU = "Premium_AzureFrontDoor" + CanMigrateDefaultSKUStandardAzureFrontDoor CanMigrateDefaultSKU = "Standard_AzureFrontDoor" +) + +// PossibleCanMigrateDefaultSKUValues returns the possible values for the CanMigrateDefaultSKU const type. +func PossibleCanMigrateDefaultSKUValues() []CanMigrateDefaultSKU { + return []CanMigrateDefaultSKU{ + CanMigrateDefaultSKUPremiumAzureFrontDoor, + CanMigrateDefaultSKUStandardAzureFrontDoor, + } +} + type CdnCertificateSourceParametersTypeName string const ( @@ -1014,6 +1031,26 @@ func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { } } +// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +type ManagedServiceIdentityType string + +const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeUserAssigned, + } +} + // MatchProcessingBehavior - If this rule is a match should the rules engine continue running the remaining rules or stop. // If not present, defaults to Continue. type MatchProcessingBehavior string @@ -1081,39 +1118,39 @@ func PossibleMatchVariableValues() []MatchVariable { } } -type MetricsResponseGranularity string +type MetricsGranularity string const ( - MetricsResponseGranularityP1D MetricsResponseGranularity = "P1D" - MetricsResponseGranularityPT1H MetricsResponseGranularity = "PT1H" - MetricsResponseGranularityPT5M MetricsResponseGranularity = "PT5M" + MetricsGranularityP1D MetricsGranularity = "P1D" + MetricsGranularityPT1H MetricsGranularity = "PT1H" + MetricsGranularityPT5M MetricsGranularity = "PT5M" ) -// PossibleMetricsResponseGranularityValues returns the possible values for the MetricsResponseGranularity const type. -func PossibleMetricsResponseGranularityValues() []MetricsResponseGranularity { - return []MetricsResponseGranularity{ - MetricsResponseGranularityP1D, - MetricsResponseGranularityPT1H, - MetricsResponseGranularityPT5M, +// PossibleMetricsGranularityValues returns the possible values for the MetricsGranularity const type. +func PossibleMetricsGranularityValues() []MetricsGranularity { + return []MetricsGranularity{ + MetricsGranularityP1D, + MetricsGranularityPT1H, + MetricsGranularityPT5M, } } -type MetricsResponseSeriesItemUnit string +type MetricsSeriesUnit string const ( - MetricsResponseSeriesItemUnitBitsPerSecond MetricsResponseSeriesItemUnit = "bitsPerSecond" - MetricsResponseSeriesItemUnitBytes MetricsResponseSeriesItemUnit = "bytes" - MetricsResponseSeriesItemUnitCount MetricsResponseSeriesItemUnit = "count" - MetricsResponseSeriesItemUnitMilliSeconds MetricsResponseSeriesItemUnit = "milliSeconds" + MetricsSeriesUnitBitsPerSecond MetricsSeriesUnit = "bitsPerSecond" + MetricsSeriesUnitBytes MetricsSeriesUnit = "bytes" + MetricsSeriesUnitCount MetricsSeriesUnit = "count" + MetricsSeriesUnitMilliSeconds MetricsSeriesUnit = "milliSeconds" ) -// PossibleMetricsResponseSeriesItemUnitValues returns the possible values for the MetricsResponseSeriesItemUnit const type. -func PossibleMetricsResponseSeriesItemUnitValues() []MetricsResponseSeriesItemUnit { - return []MetricsResponseSeriesItemUnit{ - MetricsResponseSeriesItemUnitBitsPerSecond, - MetricsResponseSeriesItemUnitBytes, - MetricsResponseSeriesItemUnitCount, - MetricsResponseSeriesItemUnitMilliSeconds, +// PossibleMetricsSeriesUnitValues returns the possible values for the MetricsSeriesUnit const type. +func PossibleMetricsSeriesUnitValues() []MetricsSeriesUnit { + return []MetricsSeriesUnit{ + MetricsSeriesUnitBitsPerSecond, + MetricsSeriesUnitBytes, + MetricsSeriesUnitCount, + MetricsSeriesUnitMilliSeconds, } } @@ -1495,19 +1532,29 @@ func PossibleProfileProvisioningStateValues() []ProfileProvisioningState { type ProfileResourceState string const ( - ProfileResourceStateActive ProfileResourceState = "Active" - ProfileResourceStateCreating ProfileResourceState = "Creating" - ProfileResourceStateDeleting ProfileResourceState = "Deleting" - ProfileResourceStateDisabled ProfileResourceState = "Disabled" + ProfileResourceStateAbortingMigration ProfileResourceState = "AbortingMigration" + ProfileResourceStateActive ProfileResourceState = "Active" + ProfileResourceStateCommittingMigration ProfileResourceState = "CommittingMigration" + ProfileResourceStateCreating ProfileResourceState = "Creating" + ProfileResourceStateDeleting ProfileResourceState = "Deleting" + ProfileResourceStateDisabled ProfileResourceState = "Disabled" + ProfileResourceStateMigrated ProfileResourceState = "Migrated" + ProfileResourceStateMigrating ProfileResourceState = "Migrating" + ProfileResourceStatePendingMigrationCommit ProfileResourceState = "PendingMigrationCommit" ) // PossibleProfileResourceStateValues returns the possible values for the ProfileResourceState const type. func PossibleProfileResourceStateValues() []ProfileResourceState { return []ProfileResourceState{ + ProfileResourceStateAbortingMigration, ProfileResourceStateActive, + ProfileResourceStateCommittingMigration, ProfileResourceStateCreating, ProfileResourceStateDeleting, ProfileResourceStateDisabled, + ProfileResourceStateMigrated, + ProfileResourceStateMigrating, + ProfileResourceStatePendingMigrationCommit, } } @@ -2596,33 +2643,33 @@ func PossibleWafMetricValues() []WafMetric { } } -type WafMetricsResponseGranularity string +type WafMetricsGranularity string const ( - WafMetricsResponseGranularityP1D WafMetricsResponseGranularity = "P1D" - WafMetricsResponseGranularityPT1H WafMetricsResponseGranularity = "PT1H" - WafMetricsResponseGranularityPT5M WafMetricsResponseGranularity = "PT5M" + WafMetricsGranularityP1D WafMetricsGranularity = "P1D" + WafMetricsGranularityPT1H WafMetricsGranularity = "PT1H" + WafMetricsGranularityPT5M WafMetricsGranularity = "PT5M" ) -// PossibleWafMetricsResponseGranularityValues returns the possible values for the WafMetricsResponseGranularity const type. -func PossibleWafMetricsResponseGranularityValues() []WafMetricsResponseGranularity { - return []WafMetricsResponseGranularity{ - WafMetricsResponseGranularityP1D, - WafMetricsResponseGranularityPT1H, - WafMetricsResponseGranularityPT5M, +// PossibleWafMetricsGranularityValues returns the possible values for the WafMetricsGranularity const type. +func PossibleWafMetricsGranularityValues() []WafMetricsGranularity { + return []WafMetricsGranularity{ + WafMetricsGranularityP1D, + WafMetricsGranularityPT1H, + WafMetricsGranularityPT5M, } } -type WafMetricsResponseSeriesItemUnit string +type WafMetricsSeriesUnit string const ( - WafMetricsResponseSeriesItemUnitCount WafMetricsResponseSeriesItemUnit = "count" + WafMetricsSeriesUnitCount WafMetricsSeriesUnit = "count" ) -// PossibleWafMetricsResponseSeriesItemUnitValues returns the possible values for the WafMetricsResponseSeriesItemUnit const type. -func PossibleWafMetricsResponseSeriesItemUnitValues() []WafMetricsResponseSeriesItemUnit { - return []WafMetricsResponseSeriesItemUnit{ - WafMetricsResponseSeriesItemUnitCount, +// PossibleWafMetricsSeriesUnitValues returns the possible values for the WafMetricsSeriesUnit const type. +func PossibleWafMetricsSeriesUnitValues() []WafMetricsSeriesUnit { + return []WafMetricsSeriesUnit{ + WafMetricsSeriesUnitCount, } } diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_customdomains_client.go b/sdk/resourcemanager/cdn/armcdn/customdomains_client.go similarity index 86% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_customdomains_client.go rename to sdk/resourcemanager/cdn/armcdn/customdomains_client.go index 596fede60c57..4df9c2c05e24 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_customdomains_client.go +++ b/sdk/resourcemanager/cdn/armcdn/customdomains_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewCustomDomainsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreate - Creates a new custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -78,7 +79,7 @@ func (client *CustomDomainsClient) BeginCreate(ctx context.Context, resourceGrou // Create - Creates a new custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *CustomDomainsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters, options *CustomDomainsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, options) if err != nil { @@ -122,7 +123,7 @@ func (client *CustomDomainsClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, customDomainProperties) @@ -130,7 +131,7 @@ func (client *CustomDomainsClient) createCreateRequest(ctx context.Context, reso // BeginDelete - Deletes an existing custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -151,7 +152,7 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes an existing custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainName, options) if err != nil { @@ -195,38 +196,53 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// DisableCustomHTTPS - Disable https delivery of the custom domain. +// BeginDisableCustomHTTPS - Disable https delivery of the custom domain. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. // customDomainName - Name of the custom domain within an endpoint. -// options - CustomDomainsClientDisableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.DisableCustomHTTPS +// options - CustomDomainsClientBeginDisableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.BeginDisableCustomHTTPS // method. -func (client *CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientDisableCustomHTTPSOptions) (CustomDomainsClientDisableCustomHTTPSResponse, error) { +func (client *CustomDomainsClient) BeginDisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDisableCustomHTTPSOptions) (*runtime.Poller[CustomDomainsClientDisableCustomHTTPSResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.disableCustomHTTPS(ctx, resourceGroupName, profileName, endpointName, customDomainName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[CustomDomainsClientDisableCustomHTTPSResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[CustomDomainsClientDisableCustomHTTPSResponse](options.ResumeToken, client.pl, nil) + } +} + +// DisableCustomHTTPS - Disable https delivery of the custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +func (client *CustomDomainsClient) disableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDisableCustomHTTPSOptions) (*http.Response, error) { req, err := client.disableCustomHTTPSCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainName, options) if err != nil { - return CustomDomainsClientDisableCustomHTTPSResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return CustomDomainsClientDisableCustomHTTPSResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return CustomDomainsClientDisableCustomHTTPSResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.disableCustomHTTPSHandleResponse(resp) + return resp, nil } // disableCustomHTTPSCreateRequest creates the DisableCustomHTTPS request. -func (client *CustomDomainsClient) disableCustomHTTPSCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientDisableCustomHTTPSOptions) (*policy.Request, error) { +func (client *CustomDomainsClient) disableCustomHTTPSCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDisableCustomHTTPSOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -253,47 +269,53 @@ func (client *CustomDomainsClient) disableCustomHTTPSCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// disableCustomHTTPSHandleResponse handles the DisableCustomHTTPS response. -func (client *CustomDomainsClient) disableCustomHTTPSHandleResponse(resp *http.Response) (CustomDomainsClientDisableCustomHTTPSResponse, error) { - result := CustomDomainsClientDisableCustomHTTPSResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CustomDomain); err != nil { - return CustomDomainsClientDisableCustomHTTPSResponse{}, err - } - return result, nil -} - -// EnableCustomHTTPS - Enable https delivery of the custom domain. +// BeginEnableCustomHTTPS - Enable https delivery of the custom domain. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. // customDomainName - Name of the custom domain within an endpoint. -// options - CustomDomainsClientEnableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.EnableCustomHTTPS +// options - CustomDomainsClientBeginEnableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.BeginEnableCustomHTTPS // method. -func (client *CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientEnableCustomHTTPSOptions) (CustomDomainsClientEnableCustomHTTPSResponse, error) { +func (client *CustomDomainsClient) BeginEnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginEnableCustomHTTPSOptions) (*runtime.Poller[CustomDomainsClientEnableCustomHTTPSResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.enableCustomHTTPS(ctx, resourceGroupName, profileName, endpointName, customDomainName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[CustomDomainsClientEnableCustomHTTPSResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[CustomDomainsClientEnableCustomHTTPSResponse](options.ResumeToken, client.pl, nil) + } +} + +// EnableCustomHTTPS - Enable https delivery of the custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +func (client *CustomDomainsClient) enableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginEnableCustomHTTPSOptions) (*http.Response, error) { req, err := client.enableCustomHTTPSCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainName, options) if err != nil { - return CustomDomainsClientEnableCustomHTTPSResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return CustomDomainsClientEnableCustomHTTPSResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return CustomDomainsClientEnableCustomHTTPSResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.enableCustomHTTPSHandleResponse(resp) + return resp, nil } // enableCustomHTTPSCreateRequest creates the EnableCustomHTTPS request. -func (client *CustomDomainsClient) enableCustomHTTPSCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientEnableCustomHTTPSOptions) (*policy.Request, error) { +func (client *CustomDomainsClient) enableCustomHTTPSCreateRequest(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginEnableCustomHTTPSOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -320,7 +342,7 @@ func (client *CustomDomainsClient) enableCustomHTTPSCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CustomDomainHTTPSParameters != nil { @@ -329,18 +351,9 @@ func (client *CustomDomainsClient) enableCustomHTTPSCreateRequest(ctx context.Co return req, nil } -// enableCustomHTTPSHandleResponse handles the EnableCustomHTTPS response. -func (client *CustomDomainsClient) enableCustomHTTPSHandleResponse(resp *http.Response) (CustomDomainsClientEnableCustomHTTPSResponse, error) { - result := CustomDomainsClientEnableCustomHTTPSResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.CustomDomain); err != nil { - return CustomDomainsClientEnableCustomHTTPSResponse{}, err - } - return result, nil -} - // Get - Gets an existing custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -389,7 +402,7 @@ func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -405,8 +418,7 @@ func (client *CustomDomainsClient) getHandleResponse(resp *http.Response) (Custo } // NewListByEndpointPager - Lists all of the existing custom domains within an endpoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -464,7 +476,7 @@ func (client *CustomDomainsClient) listByEndpointCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_edgenodes_client.go b/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_edgenodes_client.go rename to sdk/resourcemanager/cdn/armcdn/edgenodes_client.go index 494f64ce9497..1720315d7f5a 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_edgenodes_client.go +++ b/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go @@ -5,6 +5,7 @@ // 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 @@ -49,8 +50,7 @@ func NewEdgeNodesClient(credential azcore.TokenCredential, options *arm.ClientOp } // NewListPager - Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // options - EdgeNodesClientListOptions contains the optional parameters for the EdgeNodesClient.List method. func (client *EdgeNodesClient) NewListPager(options *EdgeNodesClientListOptions) *runtime.Pager[EdgeNodesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[EdgeNodesClientListResponse]{ @@ -88,7 +88,7 @@ func (client *EdgeNodesClient) listCreateRequest(ctx context.Context, options *E return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_endpoints_client.go b/sdk/resourcemanager/cdn/armcdn/endpoints_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_endpoints_client.go rename to sdk/resourcemanager/cdn/armcdn/endpoints_client.go index 944e0ea3d83c..5dbfd39f5c26 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_endpoints_client.go +++ b/sdk/resourcemanager/cdn/armcdn/endpoints_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ func NewEndpointsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreate - Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group // and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -78,7 +79,7 @@ func (client *EndpointsClient) BeginCreate(ctx context.Context, resourceGroupNam // Create - Creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group and // profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *EndpointsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint Endpoint, options *EndpointsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, endpoint, options) if err != nil { @@ -118,7 +119,7 @@ func (client *EndpointsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, endpoint) @@ -127,7 +128,7 @@ func (client *EndpointsClient) createCreateRequest(ctx context.Context, resource // BeginDelete - Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource // group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -147,7 +148,7 @@ func (client *EndpointsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group // and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *EndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { @@ -187,7 +188,7 @@ func (client *EndpointsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +197,7 @@ func (client *EndpointsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group and // profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -240,7 +241,7 @@ func (client *EndpointsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,8 +257,7 @@ func (client *EndpointsClient) getHandleResponse(resp *http.Response) (Endpoints } // NewListByProfilePager - Lists existing CDN endpoints. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // options - EndpointsClientListByProfileOptions contains the optional parameters for the EndpointsClient.ListByProfile method. @@ -309,7 +309,7 @@ func (client *EndpointsClient) listByProfileCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,8 +325,7 @@ func (client *EndpointsClient) listByProfileHandleResponse(resp *http.Response) } // NewListResourceUsagePager - Checks the quota and usage of geo filters and custom domains under the given endpoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -384,7 +383,7 @@ func (client *EndpointsClient) listResourceUsageCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -401,7 +400,7 @@ func (client *EndpointsClient) listResourceUsageHandleResponse(resp *http.Respon // BeginLoadContent - Pre-loads a content to CDN. Available for Verizon Profiles. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -423,7 +422,7 @@ func (client *EndpointsClient) BeginLoadContent(ctx context.Context, resourceGro // LoadContent - Pre-loads a content to CDN. Available for Verizon Profiles. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *EndpointsClient) loadContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters, options *EndpointsClientBeginLoadContentOptions) (*http.Response, error) { req, err := client.loadContentCreateRequest(ctx, resourceGroupName, profileName, endpointName, contentFilePaths, options) if err != nil { @@ -463,7 +462,7 @@ func (client *EndpointsClient) loadContentCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, contentFilePaths) @@ -471,7 +470,7 @@ func (client *EndpointsClient) loadContentCreateRequest(ctx context.Context, res // BeginPurgeContent - Removes a content from CDN. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -494,7 +493,7 @@ func (client *EndpointsClient) BeginPurgeContent(ctx context.Context, resourceGr // PurgeContent - Removes a content from CDN. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *EndpointsClient) purgeContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters, options *EndpointsClientBeginPurgeContentOptions) (*http.Response, error) { req, err := client.purgeContentCreateRequest(ctx, resourceGroupName, profileName, endpointName, contentFilePaths, options) if err != nil { @@ -534,7 +533,7 @@ func (client *EndpointsClient) purgeContentCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, contentFilePaths) @@ -542,7 +541,7 @@ func (client *EndpointsClient) purgeContentCreateRequest(ctx context.Context, re // BeginStart - Starts an existing CDN endpoint that is on a stopped state. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -561,7 +560,7 @@ func (client *EndpointsClient) BeginStart(ctx context.Context, resourceGroupName // Start - Starts an existing CDN endpoint that is on a stopped state. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *EndpointsClient) start(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { @@ -601,7 +600,7 @@ func (client *EndpointsClient) startCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -609,7 +608,7 @@ func (client *EndpointsClient) startCreateRequest(ctx context.Context, resourceG // BeginStop - Stops an existing running CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -628,7 +627,7 @@ func (client *EndpointsClient) BeginStop(ctx context.Context, resourceGroupName // Stop - Stops an existing running CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *EndpointsClient) stop(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { @@ -668,7 +667,7 @@ func (client *EndpointsClient) stopCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -679,7 +678,7 @@ func (client *EndpointsClient) stopCreateRequest(ctx context.Context, resourceGr // use the Update Origin operation. To update origin groups, use the Update Origin group operation. To update custom domains, // use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -702,7 +701,7 @@ func (client *EndpointsClient) BeginUpdate(ctx context.Context, resourceGroupNam // use the Update Origin operation. To update origin groups, use the Update Origin group operation. To update custom domains, // use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *EndpointsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters, options *EndpointsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, endpointUpdateProperties, options) if err != nil { @@ -742,7 +741,7 @@ func (client *EndpointsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, endpointUpdateProperties) @@ -750,7 +749,7 @@ func (client *EndpointsClient) updateCreateRequest(ctx context.Context, resource // ValidateCustomDomain - Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -796,7 +795,7 @@ func (client *EndpointsClient) validateCustomDomainCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, customDomainProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/go.mod b/sdk/resourcemanager/cdn/armcdn/go.mod index c7a2fe733261..9ddad6e85893 100644 --- a/sdk/resourcemanager/cdn/armcdn/go.mod +++ b/sdk/resourcemanager/cdn/armcdn/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/cdn/armcdn/go.sum b/sdk/resourcemanager/cdn/armcdn/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/cdn/armcdn/go.sum +++ b/sdk/resourcemanager/cdn/armcdn/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_loganalytics_client.go b/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go similarity index 97% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_loganalytics_client.go rename to sdk/resourcemanager/cdn/armcdn/loganalytics_client.go index 3f8d55dcf588..e80e44b75dff 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_loganalytics_client.go +++ b/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go @@ -5,6 +5,7 @@ // 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 @@ -58,7 +59,7 @@ func NewLogAnalyticsClient(subscriptionID string, credential azcore.TokenCredent // GetLogAnalyticsLocations - Get all available location names for AFD log analytics report. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -99,7 +100,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsLocationsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +117,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsLocationsHandleResponse(resp *h // GetLogAnalyticsMetrics - Get log report for AFD profile // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -157,7 +158,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsMetricsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") for _, qv := range metrics { reqQP.Add("metrics", string(qv)) } @@ -201,7 +202,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsMetricsHandleResponse(resp *htt // GetLogAnalyticsRankings - Get log analytics ranking report for AFD profile // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -242,7 +243,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsRankingsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") for _, qv := range rankings { reqQP.Add("rankings", string(qv)) } @@ -273,7 +274,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsRankingsHandleResponse(resp *ht // GetLogAnalyticsResources - Get all endpoints and custom domains available for AFD log report // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -314,7 +315,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsResourcesCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +332,7 @@ func (client *LogAnalyticsClient) getLogAnalyticsResourcesHandleResponse(resp *h // GetWafLogAnalyticsMetrics - Get Waf related log analytics report for AFD profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -372,7 +373,7 @@ func (client *LogAnalyticsClient) getWafLogAnalyticsMetricsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") for _, qv := range metrics { reqQP.Add("metrics", string(qv)) } @@ -410,7 +411,7 @@ func (client *LogAnalyticsClient) getWafLogAnalyticsMetricsHandleResponse(resp * // GetWafLogAnalyticsRankings - Get WAF log analytics charts for AFD profile // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. @@ -451,7 +452,7 @@ func (client *LogAnalyticsClient) getWafLogAnalyticsRankingsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") for _, qv := range metrics { reqQP.Add("metrics", string(qv)) } diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_managedrulesets_client.go b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_managedrulesets_client.go rename to sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go index 8a4f3ba280e4..273bf3061bfe 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_managedrulesets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go @@ -5,6 +5,7 @@ // 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 @@ -55,8 +56,7 @@ func NewManagedRuleSetsClient(subscriptionID string, credential azcore.TokenCred } // NewListPager - Lists all available managed rule sets. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // options - ManagedRuleSetsClientListOptions contains the optional parameters for the ManagedRuleSetsClient.List method. func (client *ManagedRuleSetsClient) NewListPager(options *ManagedRuleSetsClientListOptions) *runtime.Pager[ManagedRuleSetsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedRuleSetsClientListResponse]{ @@ -98,7 +98,7 @@ func (client *ManagedRuleSetsClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_management_client.go b/sdk/resourcemanager/cdn/armcdn/management_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_management_client.go rename to sdk/resourcemanager/cdn/armcdn/management_client.go index 2179a2b3e46f..4c8d144d43c0 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_management_client.go +++ b/sdk/resourcemanager/cdn/armcdn/management_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // CheckEndpointNameAvailability - Check the availability of a resource name. This is needed for resources where name is globally // unique, such as a afdx endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // checkEndpointNameAvailabilityInput - Input to check. // options - ManagementClientCheckEndpointNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckEndpointNameAvailability @@ -93,7 +94,7 @@ func (client *ManagementClient) checkEndpointNameAvailabilityCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkEndpointNameAvailabilityInput) @@ -111,7 +112,7 @@ func (client *ManagementClient) checkEndpointNameAvailabilityHandleResponse(resp // CheckNameAvailability - Check the availability of a resource name. This is needed for resources where name is globally // unique, such as a CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // checkNameAvailabilityInput - Input to check. // options - ManagementClientCheckNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckNameAvailability // method. @@ -138,7 +139,7 @@ func (client *ManagementClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkNameAvailabilityInput) @@ -156,7 +157,7 @@ func (client *ManagementClient) checkNameAvailabilityHandleResponse(resp *http.R // CheckNameAvailabilityWithSubscription - Check the availability of a resource name. This is needed for resources where name // is globally unique, such as a CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // checkNameAvailabilityInput - Input to check. // options - ManagementClientCheckNameAvailabilityWithSubscriptionOptions contains the optional parameters for the ManagementClient.CheckNameAvailabilityWithSubscription // method. @@ -187,7 +188,7 @@ func (client *ManagementClient) checkNameAvailabilityWithSubscriptionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkNameAvailabilityInput) @@ -206,7 +207,7 @@ func (client *ManagementClient) checkNameAvailabilityWithSubscriptionHandleRespo // hosted on the origin server to help accelerate the delivery of dynamic content via the CDN // endpoint. This path is relative to the origin path specified in the endpoint configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // validateProbeInput - Input to check. // options - ManagementClientValidateProbeOptions contains the optional parameters for the ManagementClient.ValidateProbe // method. @@ -237,7 +238,7 @@ func (client *ManagementClient) validateProbeCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, validateProbeInput) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_models.go b/sdk/resourcemanager/cdn/armcdn/models.go similarity index 95% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_models.go rename to sdk/resourcemanager/cdn/armcdn/models.go index d6a56bb7ad18..ebeee6a35547 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_models.go +++ b/sdk/resourcemanager/cdn/armcdn/models.go @@ -5,6 +5,7 @@ // 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 @@ -95,6 +96,9 @@ type AFDDomainProperties struct { // Resource reference to the Azure DNS zone AzureDNSZone *ResourceReference `json:"azureDnsZone,omitempty"` + // Key-Value pair representing migration properties for domains. + ExtendedProperties map[string]*string `json:"extendedProperties,omitempty"` + // Resource reference to the Azure resource where custom domain ownership was prevalidated PreValidatedCustomDomainResourceID *ResourceReference `json:"preValidatedCustomDomainResourceId,omitempty"` @@ -143,9 +147,9 @@ type AFDDomainUpdatePropertiesParameters struct { ProfileName *string `json:"profileName,omitempty" azure:"ro"` } -// AFDEndpoint - CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, -// content caching and delivery behavior. The AzureFrontDoor endpoint uses the URL format -// .azureedge.net. +// AFDEndpoint - Azure Front Door endpoint is the entity within a Azure Front Door profile containing configuration information +// such as origin, protocol, content caching and delivery behavior. The AzureFrontDoor +// endpoint uses the URL format .azureedge.net. type AFDEndpoint struct { // REQUIRED; Resource location. Location *string `json:"location,omitempty"` @@ -265,9 +269,9 @@ type AFDEndpointsClientValidateCustomDomainOptions struct { // placeholder for future optional parameters } -// AFDOrigin - CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint -// do not have the requested content cached, they attempt to fetch it from one or more of -// the configured origins. +// AFDOrigin - Azure Front Door origin is the source of the content being delivered via Azure Front Door. When the edge nodes +// represented by an endpoint do not have the requested content cached, they attempt to +// fetch it from one or more of the configured origins. type AFDOrigin struct { // The JSON object that contains the properties of the origin. Properties *AFDOriginProperties `json:"properties,omitempty"` @@ -286,7 +290,7 @@ type AFDOrigin struct { } // AFDOriginGroup - AFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be -// served from CDN. +// served from Azure Front Door. type AFDOriginGroup struct { // The JSON object that contains the properties of the origin group. Properties *AFDOriginGroupProperties `json:"properties,omitempty"` @@ -310,7 +314,7 @@ type AFDOriginGroupListResult struct { // URL to get the next set of origin objects if there are any. NextLink *string `json:"nextLink,omitempty"` - // READ-ONLY; List of CDN origin groups within an endpoint + // READ-ONLY; List of Azure Front Door origin groups within an Azure Front Door endpoint Value []*AFDOriginGroup `json:"value,omitempty" azure:"ro"` } @@ -405,7 +409,7 @@ type AFDOriginListResult struct { // URL to get the next set of origin objects if there are any. NextLink *string `json:"nextLink,omitempty"` - // READ-ONLY; List of CDN origins within an endpoint + // READ-ONLY; List of Azure Front Door origins within an Azure Front Door endpoint Value []*AFDOrigin `json:"value,omitempty" azure:"ro"` } @@ -432,8 +436,9 @@ type AFDOriginProperties struct { HostName *string `json:"hostName,omitempty"` // The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this - // value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services - // require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint + // value. Azure Front Door origins, such as Web Apps, Blob Storage, and Cloud + // Services require this host header value to match the origin hostname by default. This overrides the host header defined + // at Endpoint OriginHostHeader *string `json:"originHostHeader,omitempty"` // Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any @@ -485,8 +490,9 @@ type AFDOriginUpdatePropertiesParameters struct { HostName *string `json:"hostName,omitempty"` // The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this - // value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services - // require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint + // value. Azure Front Door origins, such as Web Apps, Blob Storage, and Cloud + // Services require this host header value to match the origin hostname by default. This overrides the host header defined + // at Endpoint OriginHostHeader *string `json:"originHostHeader,omitempty"` // Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any @@ -531,6 +537,12 @@ type AFDOriginsClientListByOriginGroupOptions struct { // placeholder for future optional parameters } +// AFDProfilesClientBeginUpgradeOptions contains the optional parameters for the AFDProfilesClient.BeginUpgrade method. +type AFDProfilesClientBeginUpgradeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // AFDProfilesClientCheckHostNameAvailabilityOptions contains the optional parameters for the AFDProfilesClient.CheckHostNameAvailability // method. type AFDProfilesClientCheckHostNameAvailabilityOptions struct { @@ -543,6 +555,11 @@ type AFDProfilesClientListResourceUsageOptions struct { // placeholder for future optional parameters } +// AFDProfilesClientValidateSecretOptions contains the optional parameters for the AFDProfilesClient.ValidateSecret method. +type AFDProfilesClientValidateSecretOptions struct { + // placeholder for future optional parameters +} + // AFDStateProperties - The tracking states for afd resources. type AFDStateProperties struct { // READ-ONLY @@ -669,6 +686,23 @@ type CacheKeyQueryStringActionParameters struct { QueryParameters *string `json:"queryParameters,omitempty"` } +// CanMigrateParameters - Request body for CanMigrate operation. +type CanMigrateParameters struct { + // REQUIRED; Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + ClassicResourceReference *ResourceReference `json:"classicResourceReference,omitempty"` +} + +// CanMigrateResult - Result for canMigrate operation. +type CanMigrateResult struct { + Errors []*MigrationErrorType `json:"errors,omitempty"` + + // READ-ONLY; Flag that says if the profile can be migrated + CanMigrate *bool `json:"canMigrate,omitempty" azure:"ro"` + + // READ-ONLY; Recommended sku for the migration + DefaultSKU *CanMigrateDefaultSKU `json:"defaultSku,omitempty" azure:"ro"` +} + // Certificate used for https type Certificate struct { // The type of the secret resource. @@ -939,19 +973,22 @@ type CustomDomainsClientBeginDeleteOptions struct { ResumeToken string } -// CustomDomainsClientDisableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.DisableCustomHTTPS +// CustomDomainsClientBeginDisableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.BeginDisableCustomHTTPS // method. -type CustomDomainsClientDisableCustomHTTPSOptions struct { - // placeholder for future optional parameters +type CustomDomainsClientBeginDisableCustomHTTPSOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// CustomDomainsClientEnableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.EnableCustomHTTPS +// CustomDomainsClientBeginEnableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.BeginEnableCustomHTTPS // method. -type CustomDomainsClientEnableCustomHTTPSOptions struct { +type CustomDomainsClientBeginEnableCustomHTTPSOptions struct { // The configuration specifying how to enable HTTPS for the custom domain - using CDN managed certificate or user's own certificate. // If not specified, enabling ssl uses CDN managed certificate by // default. CustomDomainHTTPSParameters CustomDomainHTTPSParametersClassification + // Resumes the LRO from the provided token. + ResumeToken string } // CustomDomainsClientGetOptions contains the optional parameters for the CustomDomainsClient.Get method. @@ -1057,6 +1094,25 @@ func (c *CustomerCertificateParameters) GetSecretParameters() *SecretParameters } } +// DeepCreatedCustomDomain - Custom domains created on the CDN endpoint. +type DeepCreatedCustomDomain struct { + // REQUIRED; Custom domain name. + Name *string `json:"name,omitempty"` + + // Properties of the custom domain created on the CDN endpoint. + Properties *DeepCreatedCustomDomainProperties `json:"properties,omitempty"` +} + +// DeepCreatedCustomDomainProperties - Properties of the custom domain created on the CDN endpoint. +type DeepCreatedCustomDomainProperties struct { + // REQUIRED; The host name of the custom domain. Must be a domain name. + HostName *string `json:"hostName,omitempty"` + + // Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP + // license number of a custom domain is required to deliver content in China. + ValidationData *string `json:"validationData,omitempty"` +} + // DeepCreatedOrigin - The main origin of CDN content which is added when creating a CDN endpoint. type DeepCreatedOrigin struct { // REQUIRED; Origin name which must be unique within the endpoint. @@ -1743,7 +1799,7 @@ type EndpointProperties struct { WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` // READ-ONLY; The custom domains under the endpoint. - CustomDomains []*CustomDomain `json:"customDomains,omitempty" azure:"ro"` + CustomDomains []*DeepCreatedCustomDomain `json:"customDomains,omitempty" azure:"ro"` // READ-ONLY; The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net HostName *string `json:"hostName,omitempty" azure:"ro"` @@ -2263,7 +2319,7 @@ type ManagedRuleGroupOverride struct { // REQUIRED; Describes the managed rule group within the rule set to override RuleGroupName *string `json:"ruleGroupName,omitempty"` - // List of rules that will be disabled. If none specified, all rules in the group will be disabled. + // List of rules that will be enabled. If none specified, all rules in the group will be disabled. Rules []*ManagedRuleOverride `json:"rules,omitempty"` } @@ -2350,6 +2406,26 @@ type ManagedRuleSetsClientListOptions struct { // placeholder for future optional parameters } +// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type ManagedServiceIdentity struct { + // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + Type *ManagedServiceIdentityType `json:"type,omitempty"` + + // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + // resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + // The dictionary values can be empty objects ({}) in + // requests. + UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` + + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` +} + // ManagementClientCheckEndpointNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckEndpointNameAvailability // method. type ManagementClientCheckEndpointNameAvailabilityOptions struct { @@ -2440,7 +2516,7 @@ type MetricSpecification struct { type MetricsResponse struct { DateTimeBegin *time.Time `json:"dateTimeBegin,omitempty"` DateTimeEnd *time.Time `json:"dateTimeEnd,omitempty"` - Granularity *MetricsResponseGranularity `json:"granularity,omitempty"` + Granularity *MetricsGranularity `json:"granularity,omitempty"` Series []*MetricsResponseSeriesItem `json:"series,omitempty"` } @@ -2448,7 +2524,7 @@ type MetricsResponseSeriesItem struct { Data []*Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems `json:"data,omitempty"` Groups []*MetricsResponseSeriesPropertiesItemsItem `json:"groups,omitempty"` Metric *string `json:"metric,omitempty"` - Unit *MetricsResponseSeriesItemUnit `json:"unit,omitempty"` + Unit *MetricsSeriesUnit `json:"unit,omitempty"` } type MetricsResponseSeriesPropertiesItemsItem struct { @@ -2456,6 +2532,54 @@ type MetricsResponseSeriesPropertiesItemsItem struct { Value *string `json:"value,omitempty"` } +// MigrateResult - Result for migrate operation. +type MigrateResult struct { + Errors []*MigrationErrorType `json:"errors,omitempty"` + + // READ-ONLY; Arm resource id of the migrated profile + MigratedProfileResourceID *ResourceReference `json:"migratedProfileResourceId,omitempty" azure:"ro"` +} + +// MigrationErrorType - Error response indicates CDN service is not able to process the incoming request. The reason is provided +// in the error message. +type MigrationErrorType struct { + // READ-ONLY; Error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; Error message indicating why the operation failed. + ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + + // READ-ONLY; Describes what needs to be done to fix the problem + NextSteps *string `json:"nextSteps,omitempty" azure:"ro"` + + // READ-ONLY; Resource which has the problem. + ResourceName *string `json:"resourceName,omitempty" azure:"ro"` +} + +// MigrationParameters - Request body for Migrate operation. +type MigrationParameters struct { + // REQUIRED; Resource reference of the classic cdn profile or classic frontdoor that need to be migrated. + ClassicResourceReference *ResourceReference `json:"classicResourceReference,omitempty"` + + // REQUIRED; Name of the new profile that need to be created. + ProfileName *string `json:"profileName,omitempty"` + + // REQUIRED; Sku for the migration + SKU *SKU `json:"sku,omitempty"` + + // Waf mapping for the migrated profile + MigrationWebApplicationFirewallMappings []*MigrationWebApplicationFirewallMapping `json:"migrationWebApplicationFirewallMappings,omitempty"` +} + +// MigrationWebApplicationFirewallMapping - Web Application Firewall Mapping +type MigrationWebApplicationFirewallMapping struct { + // Migration From Waf policy + MigratedFrom *ResourceReference `json:"migratedFrom,omitempty"` + + // Migration to Waf policy + MigratedTo *ResourceReference `json:"migratedTo,omitempty"` +} + // Operation - CDN REST API operation type Operation struct { // The object that represents the operation. @@ -2875,6 +2999,9 @@ type Profile struct { // profile. SKU *SKU `json:"sku,omitempty"` + // Managed service identity (system assigned and/or user assigned identities). + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The JSON object that contains the properties required to create a profile. Properties *ProfileProperties `json:"properties,omitempty"` @@ -2897,6 +3024,15 @@ type Profile struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ProfileChangeSKUWafMapping - Parameters required for profile upgrade. +type ProfileChangeSKUWafMapping struct { + // REQUIRED; The new waf resource for the security policy to use. + ChangeToWafPolicy *ResourceReference `json:"changeToWafPolicy,omitempty"` + + // REQUIRED; The security policy name. + SecurityPolicyName *string `json:"securityPolicyName,omitempty"` +} + // ProfileListResult - Result of the request to list profiles. It contains a list of profile objects and a URL link to get // the next set of results. type ProfileListResult struct { @@ -2909,6 +3045,9 @@ type ProfileListResult struct { // ProfileProperties - The JSON object that contains the properties required to create a profile. type ProfileProperties struct { + // Key-Value pair representing additional properties for profiles. + ExtendedProperties map[string]*string `json:"extendedProperties,omitempty"` + // Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and returns. OriginResponseTimeoutSeconds *int32 `json:"originResponseTimeoutSeconds,omitempty"` @@ -2930,6 +3069,9 @@ type ProfilePropertiesUpdateParameters struct { // ProfileUpdateParameters - Properties required to update a profile. type ProfileUpdateParameters struct { + // Managed service identity (system assigned and/or user assigned identities). + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The JSON object containing profile update parameters. Properties *ProfilePropertiesUpdateParameters `json:"properties,omitempty"` @@ -2937,6 +3079,12 @@ type ProfileUpdateParameters struct { Tags map[string]*string `json:"tags,omitempty"` } +// ProfileUpgradeParameters - Parameters required for profile upgrade. +type ProfileUpgradeParameters struct { + // REQUIRED; Web Application Firewall (WAF) and security policy mapping for the profile upgrade + WafMappingList []*ProfileChangeSKUWafMapping `json:"wafMappingList,omitempty"` +} + // ProfilesClientBeginCreateOptions contains the optional parameters for the ProfilesClient.BeginCreate method. type ProfilesClientBeginCreateOptions struct { // Resumes the LRO from the provided token. @@ -2949,12 +3097,30 @@ type ProfilesClientBeginDeleteOptions struct { ResumeToken string } +// ProfilesClientBeginMigrateOptions contains the optional parameters for the ProfilesClient.BeginMigrate method. +type ProfilesClientBeginMigrateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ProfilesClientBeginMigrationCommitOptions contains the optional parameters for the ProfilesClient.BeginMigrationCommit +// method. +type ProfilesClientBeginMigrationCommitOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ProfilesClientBeginUpdateOptions contains the optional parameters for the ProfilesClient.BeginUpdate method. type ProfilesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } +// ProfilesClientCanMigrateOptions contains the optional parameters for the ProfilesClient.CanMigrate method. +type ProfilesClientCanMigrateOptions struct { + // placeholder for future optional parameters +} + // ProfilesClientGenerateSsoURIOptions contains the optional parameters for the ProfilesClient.GenerateSsoURI method. type ProfilesClientGenerateSsoURIOptions struct { // placeholder for future optional parameters @@ -4225,6 +4391,15 @@ type UsagesListResult struct { Value []*Usage `json:"value,omitempty"` } +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. + ClientID *string `json:"clientId,omitempty" azure:"ro"` + + // READ-ONLY; The principal ID of the assigned identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` +} + // UserManagedHTTPSParameters - Defines the certificate source parameters using user's keyvault certificate for enabling SSL. type UserManagedHTTPSParameters struct { // REQUIRED; Defines the source of the SSL certificate. @@ -4249,11 +4424,6 @@ func (u *UserManagedHTTPSParameters) GetCustomDomainHTTPSParameters() *CustomDom } } -// ValidateClientSecretOptions contains the optional parameters for the ValidateClient.Secret method. -type ValidateClientSecretOptions struct { - // placeholder for future optional parameters -} - // ValidateCustomDomainInput - Input of the custom domain to be validated for DNS mapping. type ValidateCustomDomainInput struct { // REQUIRED; The host name of the custom domain. Must be a domain name. @@ -4322,7 +4492,7 @@ type ValidationToken struct { type WafMetricsResponse struct { DateTimeBegin *time.Time `json:"dateTimeBegin,omitempty"` DateTimeEnd *time.Time `json:"dateTimeEnd,omitempty"` - Granularity *WafMetricsResponseGranularity `json:"granularity,omitempty"` + Granularity *WafMetricsGranularity `json:"granularity,omitempty"` Series []*WafMetricsResponseSeriesItem `json:"series,omitempty"` } @@ -4330,7 +4500,7 @@ type WafMetricsResponseSeriesItem struct { Data []*Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems `json:"data,omitempty"` Groups []*WafMetricsResponseSeriesPropertiesItemsItem `json:"groups,omitempty"` Metric *string `json:"metric,omitempty"` - Unit *WafMetricsResponseSeriesItemUnit `json:"unit,omitempty"` + Unit *WafMetricsSeriesUnit `json:"unit,omitempty"` } type WafMetricsResponseSeriesPropertiesItemsItem struct { @@ -4402,6 +4572,9 @@ type WebApplicationFirewallPolicyProperties struct { // Describes custom rules inside the policy. CustomRules *CustomRuleList `json:"customRules,omitempty"` + // Key-Value pair representing additional properties for Web Application Firewall policy. + ExtendedProperties map[string]*string `json:"extendedProperties,omitempty"` + // Describes managed rules inside the policy. ManagedRules *ManagedRuleSetList `json:"managedRules,omitempty"` diff --git a/sdk/resourcemanager/cdn/armcdn/models_serde.go b/sdk/resourcemanager/cdn/armcdn/models_serde.go new file mode 100644 index 000000000000..c81e4931dfad --- /dev/null +++ b/sdk/resourcemanager/cdn/armcdn/models_serde.go @@ -0,0 +1,9833 @@ +//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 + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AFDDomain. +func (a AFDDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDDomain. +func (a *AFDDomain) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDDomainHTTPSParameters. +func (a AFDDomainHTTPSParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "certificateType", a.CertificateType) + populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion) + populate(objectMap, "secret", a.Secret) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDDomainHTTPSParameters. +func (a *AFDDomainHTTPSParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateType": + err = unpopulate(val, "CertificateType", &a.CertificateType) + delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion) + delete(rawMsg, key) + case "secret": + err = unpopulate(val, "Secret", &a.Secret) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDDomainListResult. +func (a AFDDomainListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDDomainListResult. +func (a *AFDDomainListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDDomainProperties. +func (a AFDDomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureDnsZone", a.AzureDNSZone) + populate(objectMap, "deploymentStatus", a.DeploymentStatus) + populate(objectMap, "domainValidationState", a.DomainValidationState) + populate(objectMap, "extendedProperties", a.ExtendedProperties) + populate(objectMap, "hostName", a.HostName) + populate(objectMap, "preValidatedCustomDomainResourceId", a.PreValidatedCustomDomainResourceID) + populate(objectMap, "profileName", a.ProfileName) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "tlsSettings", a.TLSSettings) + populate(objectMap, "validationProperties", a.ValidationProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDDomainProperties. +func (a *AFDDomainProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureDnsZone": + err = unpopulate(val, "AzureDNSZone", &a.AzureDNSZone) + delete(rawMsg, key) + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &a.DeploymentStatus) + delete(rawMsg, key) + case "domainValidationState": + err = unpopulate(val, "DomainValidationState", &a.DomainValidationState) + delete(rawMsg, key) + case "extendedProperties": + err = unpopulate(val, "ExtendedProperties", &a.ExtendedProperties) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &a.HostName) + delete(rawMsg, key) + case "preValidatedCustomDomainResourceId": + err = unpopulate(val, "PreValidatedCustomDomainResourceID", &a.PreValidatedCustomDomainResourceID) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &a.ProfileName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "tlsSettings": + err = unpopulate(val, "TLSSettings", &a.TLSSettings) + delete(rawMsg, key) + case "validationProperties": + err = unpopulate(val, "ValidationProperties", &a.ValidationProperties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDDomainUpdateParameters. +func (a AFDDomainUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDDomainUpdateParameters. +func (a *AFDDomainUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDDomainUpdatePropertiesParameters. +func (a AFDDomainUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureDnsZone", a.AzureDNSZone) + populate(objectMap, "preValidatedCustomDomainResourceId", a.PreValidatedCustomDomainResourceID) + populate(objectMap, "profileName", a.ProfileName) + populate(objectMap, "tlsSettings", a.TLSSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDDomainUpdatePropertiesParameters. +func (a *AFDDomainUpdatePropertiesParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureDnsZone": + err = unpopulate(val, "AzureDNSZone", &a.AzureDNSZone) + delete(rawMsg, key) + case "preValidatedCustomDomainResourceId": + err = unpopulate(val, "PreValidatedCustomDomainResourceID", &a.PreValidatedCustomDomainResourceID) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &a.ProfileName) + delete(rawMsg, key) + case "tlsSettings": + err = unpopulate(val, "TLSSettings", &a.TLSSettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDEndpoint. +func (a AFDEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDEndpoint. +func (a *AFDEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDEndpointListResult. +func (a AFDEndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDEndpointListResult. +func (a *AFDEndpointListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDEndpointProperties. +func (a AFDEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoGeneratedDomainNameLabelScope", a.AutoGeneratedDomainNameLabelScope) + populate(objectMap, "deploymentStatus", a.DeploymentStatus) + populate(objectMap, "enabledState", a.EnabledState) + populate(objectMap, "hostName", a.HostName) + populate(objectMap, "profileName", a.ProfileName) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDEndpointProperties. +func (a *AFDEndpointProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoGeneratedDomainNameLabelScope": + err = unpopulate(val, "AutoGeneratedDomainNameLabelScope", &a.AutoGeneratedDomainNameLabelScope) + delete(rawMsg, key) + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &a.DeploymentStatus) + delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &a.EnabledState) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &a.HostName) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &a.ProfileName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDEndpointPropertiesUpdateParameters. +func (a AFDEndpointPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabledState", a.EnabledState) + populate(objectMap, "profileName", a.ProfileName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDEndpointPropertiesUpdateParameters. +func (a *AFDEndpointPropertiesUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabledState": + err = unpopulate(val, "EnabledState", &a.EnabledState) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &a.ProfileName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDEndpointUpdateParameters. +func (a AFDEndpointUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDEndpointUpdateParameters. +func (a *AFDEndpointUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOrigin. +func (a AFDOrigin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOrigin. +func (a *AFDOrigin) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOriginGroup. +func (a AFDOriginGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOriginGroup. +func (a *AFDOriginGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOriginGroupListResult. +func (a AFDOriginGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOriginGroupListResult. +func (a *AFDOriginGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOriginGroupProperties. +func (a AFDOriginGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deploymentStatus", a.DeploymentStatus) + populate(objectMap, "healthProbeSettings", a.HealthProbeSettings) + populate(objectMap, "loadBalancingSettings", a.LoadBalancingSettings) + populate(objectMap, "profileName", a.ProfileName) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "sessionAffinityState", a.SessionAffinityState) + populate(objectMap, "trafficRestorationTimeToHealedOrNewEndpointsInMinutes", a.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOriginGroupProperties. +func (a *AFDOriginGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &a.DeploymentStatus) + delete(rawMsg, key) + case "healthProbeSettings": + err = unpopulate(val, "HealthProbeSettings", &a.HealthProbeSettings) + delete(rawMsg, key) + case "loadBalancingSettings": + err = unpopulate(val, "LoadBalancingSettings", &a.LoadBalancingSettings) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &a.ProfileName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "sessionAffinityState": + err = unpopulate(val, "SessionAffinityState", &a.SessionAffinityState) + delete(rawMsg, key) + case "trafficRestorationTimeToHealedOrNewEndpointsInMinutes": + err = unpopulate(val, "TrafficRestorationTimeToHealedOrNewEndpointsInMinutes", &a.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOriginGroupUpdateParameters. +func (a AFDOriginGroupUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOriginGroupUpdateParameters. +func (a *AFDOriginGroupUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOriginGroupUpdatePropertiesParameters. +func (a AFDOriginGroupUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "healthProbeSettings", a.HealthProbeSettings) + populate(objectMap, "loadBalancingSettings", a.LoadBalancingSettings) + populate(objectMap, "profileName", a.ProfileName) + populate(objectMap, "sessionAffinityState", a.SessionAffinityState) + populate(objectMap, "trafficRestorationTimeToHealedOrNewEndpointsInMinutes", a.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOriginGroupUpdatePropertiesParameters. +func (a *AFDOriginGroupUpdatePropertiesParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "healthProbeSettings": + err = unpopulate(val, "HealthProbeSettings", &a.HealthProbeSettings) + delete(rawMsg, key) + case "loadBalancingSettings": + err = unpopulate(val, "LoadBalancingSettings", &a.LoadBalancingSettings) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &a.ProfileName) + delete(rawMsg, key) + case "sessionAffinityState": + err = unpopulate(val, "SessionAffinityState", &a.SessionAffinityState) + delete(rawMsg, key) + case "trafficRestorationTimeToHealedOrNewEndpointsInMinutes": + err = unpopulate(val, "TrafficRestorationTimeToHealedOrNewEndpointsInMinutes", &a.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOriginListResult. +func (a AFDOriginListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOriginListResult. +func (a *AFDOriginListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOriginProperties. +func (a AFDOriginProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureOrigin", a.AzureOrigin) + populate(objectMap, "deploymentStatus", a.DeploymentStatus) + populate(objectMap, "enabledState", a.EnabledState) + populate(objectMap, "enforceCertificateNameCheck", a.EnforceCertificateNameCheck) + populate(objectMap, "httpPort", a.HTTPPort) + populate(objectMap, "httpsPort", a.HTTPSPort) + populate(objectMap, "hostName", a.HostName) + populate(objectMap, "originGroupName", a.OriginGroupName) + populate(objectMap, "originHostHeader", a.OriginHostHeader) + populate(objectMap, "priority", a.Priority) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "sharedPrivateLinkResource", a.SharedPrivateLinkResource) + populate(objectMap, "weight", a.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOriginProperties. +func (a *AFDOriginProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureOrigin": + err = unpopulate(val, "AzureOrigin", &a.AzureOrigin) + delete(rawMsg, key) + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &a.DeploymentStatus) + delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &a.EnabledState) + delete(rawMsg, key) + case "enforceCertificateNameCheck": + err = unpopulate(val, "EnforceCertificateNameCheck", &a.EnforceCertificateNameCheck) + delete(rawMsg, key) + case "httpPort": + err = unpopulate(val, "HTTPPort", &a.HTTPPort) + delete(rawMsg, key) + case "httpsPort": + err = unpopulate(val, "HTTPSPort", &a.HTTPSPort) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &a.HostName) + delete(rawMsg, key) + case "originGroupName": + err = unpopulate(val, "OriginGroupName", &a.OriginGroupName) + delete(rawMsg, key) + case "originHostHeader": + err = unpopulate(val, "OriginHostHeader", &a.OriginHostHeader) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &a.Priority) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "sharedPrivateLinkResource": + err = unpopulate(val, "SharedPrivateLinkResource", &a.SharedPrivateLinkResource) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &a.Weight) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOriginUpdateParameters. +func (a AFDOriginUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOriginUpdateParameters. +func (a *AFDOriginUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDOriginUpdatePropertiesParameters. +func (a AFDOriginUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureOrigin", a.AzureOrigin) + populate(objectMap, "enabledState", a.EnabledState) + populate(objectMap, "enforceCertificateNameCheck", a.EnforceCertificateNameCheck) + populate(objectMap, "httpPort", a.HTTPPort) + populate(objectMap, "httpsPort", a.HTTPSPort) + populate(objectMap, "hostName", a.HostName) + populate(objectMap, "originGroupName", a.OriginGroupName) + populate(objectMap, "originHostHeader", a.OriginHostHeader) + populate(objectMap, "priority", a.Priority) + populate(objectMap, "sharedPrivateLinkResource", a.SharedPrivateLinkResource) + populate(objectMap, "weight", a.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDOriginUpdatePropertiesParameters. +func (a *AFDOriginUpdatePropertiesParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureOrigin": + err = unpopulate(val, "AzureOrigin", &a.AzureOrigin) + delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &a.EnabledState) + delete(rawMsg, key) + case "enforceCertificateNameCheck": + err = unpopulate(val, "EnforceCertificateNameCheck", &a.EnforceCertificateNameCheck) + delete(rawMsg, key) + case "httpPort": + err = unpopulate(val, "HTTPPort", &a.HTTPPort) + delete(rawMsg, key) + case "httpsPort": + err = unpopulate(val, "HTTPSPort", &a.HTTPSPort) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &a.HostName) + delete(rawMsg, key) + case "originGroupName": + err = unpopulate(val, "OriginGroupName", &a.OriginGroupName) + delete(rawMsg, key) + case "originHostHeader": + err = unpopulate(val, "OriginHostHeader", &a.OriginHostHeader) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &a.Priority) + delete(rawMsg, key) + case "sharedPrivateLinkResource": + err = unpopulate(val, "SharedPrivateLinkResource", &a.SharedPrivateLinkResource) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &a.Weight) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AFDStateProperties. +func (a AFDStateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deploymentStatus", a.DeploymentStatus) + populate(objectMap, "provisioningState", a.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AFDStateProperties. +func (a *AFDStateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &a.DeploymentStatus) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ActivatedResourceReference. +func (a ActivatedResourceReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "isActive", a.IsActive) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActivatedResourceReference. +func (a *ActivatedResourceReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "isActive": + err = unpopulate(val, "IsActive", &a.IsActive) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AfdErrorResponse. +func (a AfdErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", a.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AfdErrorResponse. +func (a *AfdErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &a.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AfdPurgeParameters. +func (a AfdPurgeParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentPaths", a.ContentPaths) + populate(objectMap, "domains", a.Domains) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AfdPurgeParameters. +func (a *AfdPurgeParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contentPaths": + err = unpopulate(val, "ContentPaths", &a.ContentPaths) + delete(rawMsg, key) + case "domains": + err = unpopulate(val, "Domains", &a.Domains) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AfdRouteCacheConfiguration. +func (a AfdRouteCacheConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "compressionSettings", a.CompressionSettings) + populate(objectMap, "queryParameters", a.QueryParameters) + populate(objectMap, "queryStringCachingBehavior", a.QueryStringCachingBehavior) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AfdRouteCacheConfiguration. +func (a *AfdRouteCacheConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "compressionSettings": + err = unpopulate(val, "CompressionSettings", &a.CompressionSettings) + delete(rawMsg, key) + case "queryParameters": + err = unpopulate(val, "QueryParameters", &a.QueryParameters) + delete(rawMsg, key) + case "queryStringCachingBehavior": + err = unpopulate(val, "QueryStringCachingBehavior", &a.QueryStringCachingBehavior) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureFirstPartyManagedCertificate. +func (a AzureFirstPartyManagedCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "expirationDate", a.ExpirationDate) + populate(objectMap, "subject", a.Subject) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirstPartyManagedCertificate. +func (a *AzureFirstPartyManagedCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationDate": + err = unpopulate(val, "ExpirationDate", &a.ExpirationDate) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &a.Subject) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureFirstPartyManagedCertificateParameters. +func (a AzureFirstPartyManagedCertificateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = SecretTypeAzureFirstPartyManagedCertificate + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirstPartyManagedCertificateParameters. +func (a *AzureFirstPartyManagedCertificateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheConfiguration. +func (c CacheConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cacheBehavior", c.CacheBehavior) + populate(objectMap, "cacheDuration", c.CacheDuration) + populate(objectMap, "isCompressionEnabled", c.IsCompressionEnabled) + populate(objectMap, "queryParameters", c.QueryParameters) + populate(objectMap, "queryStringCachingBehavior", c.QueryStringCachingBehavior) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheConfiguration. +func (c *CacheConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cacheBehavior": + err = unpopulate(val, "CacheBehavior", &c.CacheBehavior) + delete(rawMsg, key) + case "cacheDuration": + err = unpopulate(val, "CacheDuration", &c.CacheDuration) + delete(rawMsg, key) + case "isCompressionEnabled": + err = unpopulate(val, "IsCompressionEnabled", &c.IsCompressionEnabled) + delete(rawMsg, key) + case "queryParameters": + err = unpopulate(val, "QueryParameters", &c.QueryParameters) + delete(rawMsg, key) + case "queryStringCachingBehavior": + err = unpopulate(val, "QueryStringCachingBehavior", &c.QueryStringCachingBehavior) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheExpirationActionParameters. +func (c CacheExpirationActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cacheBehavior", c.CacheBehavior) + populate(objectMap, "cacheDuration", c.CacheDuration) + populate(objectMap, "cacheType", c.CacheType) + populate(objectMap, "typeName", c.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheExpirationActionParameters. +func (c *CacheExpirationActionParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cacheBehavior": + err = unpopulate(val, "CacheBehavior", &c.CacheBehavior) + delete(rawMsg, key) + case "cacheDuration": + err = unpopulate(val, "CacheDuration", &c.CacheDuration) + delete(rawMsg, key) + case "cacheType": + err = unpopulate(val, "CacheType", &c.CacheType) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &c.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheKeyQueryStringActionParameters. +func (c CacheKeyQueryStringActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "queryParameters", c.QueryParameters) + populate(objectMap, "queryStringBehavior", c.QueryStringBehavior) + populate(objectMap, "typeName", c.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheKeyQueryStringActionParameters. +func (c *CacheKeyQueryStringActionParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "queryParameters": + err = unpopulate(val, "QueryParameters", &c.QueryParameters) + delete(rawMsg, key) + case "queryStringBehavior": + err = unpopulate(val, "QueryStringBehavior", &c.QueryStringBehavior) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &c.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CanMigrateParameters. +func (c CanMigrateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "classicResourceReference", c.ClassicResourceReference) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CanMigrateParameters. +func (c *CanMigrateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "classicResourceReference": + err = unpopulate(val, "ClassicResourceReference", &c.ClassicResourceReference) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CanMigrateResult. +func (c CanMigrateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "canMigrate", c.CanMigrate) + populate(objectMap, "defaultSku", c.DefaultSKU) + populate(objectMap, "errors", c.Errors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CanMigrateResult. +func (c *CanMigrateResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "canMigrate": + err = unpopulate(val, "CanMigrate", &c.CanMigrate) + delete(rawMsg, key) + case "defaultSku": + err = unpopulate(val, "DefaultSKU", &c.DefaultSKU) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "expirationDate", c.ExpirationDate) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Certificate. +func (c *Certificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationDate": + err = unpopulate(val, "ExpirationDate", &c.ExpirationDate) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &c.Subject) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateSourceParameters. +func (c CertificateSourceParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "certificateType", c.CertificateType) + populate(objectMap, "typeName", c.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateSourceParameters. +func (c *CertificateSourceParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateType": + err = unpopulate(val, "CertificateType", &c.CertificateType) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &c.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckEndpointNameAvailabilityInput. +func (c CheckEndpointNameAvailabilityInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoGeneratedDomainNameLabelScope", c.AutoGeneratedDomainNameLabelScope) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckEndpointNameAvailabilityInput. +func (c *CheckEndpointNameAvailabilityInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoGeneratedDomainNameLabelScope": + err = unpopulate(val, "AutoGeneratedDomainNameLabelScope", &c.AutoGeneratedDomainNameLabelScope) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckEndpointNameAvailabilityOutput. +func (c CheckEndpointNameAvailabilityOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "availableHostname", c.AvailableHostname) + populate(objectMap, "message", c.Message) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckEndpointNameAvailabilityOutput. +func (c *CheckEndpointNameAvailabilityOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "availableHostname": + err = unpopulate(val, "AvailableHostname", &c.AvailableHostname) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckHostNameAvailabilityInput. +func (c CheckHostNameAvailabilityInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hostName", c.HostName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckHostNameAvailabilityInput. +func (c *CheckHostNameAvailabilityInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostName": + err = unpopulate(val, "HostName", &c.HostName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityInput. +func (c CheckNameAvailabilityInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityInput. +func (c *CheckNameAvailabilityInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityOutput. +func (c CheckNameAvailabilityOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", c.Message) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityOutput. +func (c *CheckNameAvailabilityOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CidrIPAddress. +func (c CidrIPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "baseIpAddress", c.BaseIPAddress) + populate(objectMap, "prefixLength", c.PrefixLength) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CidrIPAddress. +func (c *CidrIPAddress) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baseIpAddress": + err = unpopulate(val, "BaseIPAddress", &c.BaseIPAddress) + delete(rawMsg, key) + case "prefixLength": + err = unpopulate(val, "PrefixLength", &c.PrefixLength) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientPortMatchConditionParameters. +func (c ClientPortMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", c.MatchValues) + populate(objectMap, "negateCondition", c.NegateCondition) + populate(objectMap, "operator", c.Operator) + populate(objectMap, "transforms", c.Transforms) + populate(objectMap, "typeName", c.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientPortMatchConditionParameters. +func (c *ClientPortMatchConditionParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &c.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &c.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &c.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &c.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &c.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems. +func (c Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "dateTime", c.DateTime) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems. +func (c *Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dateTime": + err = unpopulateTimeRFC3339(val, "DateTime", &c.DateTime) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems. +func (c Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "dateTime", c.DateTime) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems. +func (c *Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dateTime": + err = unpopulateTimeRFC3339(val, "DateTime", &c.DateTime) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems. +func (c ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metric", c.Metric) + populate(objectMap, "percentage", c.Percentage) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems. +func (c *ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metric": + err = unpopulate(val, "Metric", &c.Metric) + delete(rawMsg, key) + case "percentage": + err = unpopulate(val, "Percentage", &c.Percentage) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CompressionSettings. +func (c CompressionSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentTypesToCompress", c.ContentTypesToCompress) + populate(objectMap, "isCompressionEnabled", c.IsCompressionEnabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CompressionSettings. +func (c *CompressionSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contentTypesToCompress": + err = unpopulate(val, "ContentTypesToCompress", &c.ContentTypesToCompress) + delete(rawMsg, key) + case "isCompressionEnabled": + err = unpopulate(val, "IsCompressionEnabled", &c.IsCompressionEnabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContinentsResponse. +func (c ContinentsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "continents", c.Continents) + populate(objectMap, "countryOrRegions", c.CountryOrRegions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContinentsResponse. +func (c *ContinentsResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "continents": + err = unpopulate(val, "Continents", &c.Continents) + delete(rawMsg, key) + case "countryOrRegions": + err = unpopulate(val, "CountryOrRegions", &c.CountryOrRegions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContinentsResponseContinentsItem. +func (c ContinentsResponseContinentsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContinentsResponseContinentsItem. +func (c *ContinentsResponseContinentsItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContinentsResponseCountryOrRegionsItem. +func (c ContinentsResponseCountryOrRegionsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "continentId", c.ContinentID) + populate(objectMap, "id", c.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContinentsResponseCountryOrRegionsItem. +func (c *ContinentsResponseCountryOrRegionsItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "continentId": + err = unpopulate(val, "ContinentID", &c.ContinentID) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CookiesMatchConditionParameters. +func (c CookiesMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", c.MatchValues) + populate(objectMap, "negateCondition", c.NegateCondition) + populate(objectMap, "operator", c.Operator) + populate(objectMap, "selector", c.Selector) + populate(objectMap, "transforms", c.Transforms) + populate(objectMap, "typeName", c.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CookiesMatchConditionParameters. +func (c *CookiesMatchConditionParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &c.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &c.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &c.Operator) + delete(rawMsg, key) + case "selector": + err = unpopulate(val, "Selector", &c.Selector) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &c.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &c.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomDomain. +func (c CustomDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomain. +func (c *CustomDomain) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomDomainHTTPSParameters. +func (c CustomDomainHTTPSParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["certificateSource"] = c.CertificateSource + populate(objectMap, "minimumTlsVersion", c.MinimumTLSVersion) + populate(objectMap, "protocolType", c.ProtocolType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainHTTPSParameters. +func (c *CustomDomainHTTPSParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateSource": + err = unpopulate(val, "CertificateSource", &c.CertificateSource) + delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &c.MinimumTLSVersion) + delete(rawMsg, key) + case "protocolType": + err = unpopulate(val, "ProtocolType", &c.ProtocolType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomDomainListResult. +func (c CustomDomainListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainListResult. +func (c *CustomDomainListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomDomainParameters. +func (c CustomDomainParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainParameters. +func (c *CustomDomainParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomDomainProperties. +func (c CustomDomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customHttpsParameters", c.CustomHTTPSParameters) + populate(objectMap, "customHttpsProvisioningState", c.CustomHTTPSProvisioningState) + populate(objectMap, "customHttpsProvisioningSubstate", c.CustomHTTPSProvisioningSubstate) + populate(objectMap, "hostName", c.HostName) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "resourceState", c.ResourceState) + populate(objectMap, "validationData", c.ValidationData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainProperties. +func (c *CustomDomainProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customHttpsParameters": + c.CustomHTTPSParameters, err = unmarshalCustomDomainHTTPSParametersClassification(val) + delete(rawMsg, key) + case "customHttpsProvisioningState": + err = unpopulate(val, "CustomHTTPSProvisioningState", &c.CustomHTTPSProvisioningState) + delete(rawMsg, key) + case "customHttpsProvisioningSubstate": + err = unpopulate(val, "CustomHTTPSProvisioningSubstate", &c.CustomHTTPSProvisioningSubstate) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &c.HostName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "resourceState": + err = unpopulate(val, "ResourceState", &c.ResourceState) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &c.ValidationData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomDomainPropertiesParameters. +func (c CustomDomainPropertiesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hostName", c.HostName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainPropertiesParameters. +func (c *CustomDomainPropertiesParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostName": + err = unpopulate(val, "HostName", &c.HostName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomRule. +func (c CustomRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", c.Action) + populate(objectMap, "enabledState", c.EnabledState) + populate(objectMap, "matchConditions", c.MatchConditions) + populate(objectMap, "name", c.Name) + populate(objectMap, "priority", c.Priority) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRule. +func (c *CustomRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &c.Action) + delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &c.EnabledState) + delete(rawMsg, key) + case "matchConditions": + err = unpopulate(val, "MatchConditions", &c.MatchConditions) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &c.Priority) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomRuleList. +func (c CustomRuleList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "rules", c.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRuleList. +func (c *CustomRuleList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "rules": + err = unpopulate(val, "Rules", &c.Rules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomerCertificate. +func (c CustomerCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "certificateAuthority", c.CertificateAuthority) + populate(objectMap, "expirationDate", c.ExpirationDate) + populate(objectMap, "secretSource", c.SecretSource) + populate(objectMap, "secretVersion", c.SecretVersion) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "subjectAlternativeNames", c.SubjectAlternativeNames) + populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "type", c.Type) + populate(objectMap, "useLatestVersion", c.UseLatestVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomerCertificate. +func (c *CustomerCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateAuthority": + err = unpopulate(val, "CertificateAuthority", &c.CertificateAuthority) + delete(rawMsg, key) + case "expirationDate": + err = unpopulate(val, "ExpirationDate", &c.ExpirationDate) + delete(rawMsg, key) + case "secretSource": + err = unpopulate(val, "SecretSource", &c.SecretSource) + delete(rawMsg, key) + case "secretVersion": + err = unpopulate(val, "SecretVersion", &c.SecretVersion) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &c.Subject) + delete(rawMsg, key) + case "subjectAlternativeNames": + err = unpopulate(val, "SubjectAlternativeNames", &c.SubjectAlternativeNames) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "useLatestVersion": + err = unpopulate(val, "UseLatestVersion", &c.UseLatestVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomerCertificateParameters. +func (c CustomerCertificateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "certificateAuthority", c.CertificateAuthority) + populate(objectMap, "expirationDate", c.ExpirationDate) + populate(objectMap, "secretSource", c.SecretSource) + populate(objectMap, "secretVersion", c.SecretVersion) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "subjectAlternativeNames", c.SubjectAlternativeNames) + populate(objectMap, "thumbprint", c.Thumbprint) + objectMap["type"] = SecretTypeCustomerCertificate + populate(objectMap, "useLatestVersion", c.UseLatestVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomerCertificateParameters. +func (c *CustomerCertificateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateAuthority": + err = unpopulate(val, "CertificateAuthority", &c.CertificateAuthority) + delete(rawMsg, key) + case "expirationDate": + err = unpopulate(val, "ExpirationDate", &c.ExpirationDate) + delete(rawMsg, key) + case "secretSource": + err = unpopulate(val, "SecretSource", &c.SecretSource) + delete(rawMsg, key) + case "secretVersion": + err = unpopulate(val, "SecretVersion", &c.SecretVersion) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &c.Subject) + delete(rawMsg, key) + case "subjectAlternativeNames": + err = unpopulate(val, "SubjectAlternativeNames", &c.SubjectAlternativeNames) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "useLatestVersion": + err = unpopulate(val, "UseLatestVersion", &c.UseLatestVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeepCreatedCustomDomain. +func (d DeepCreatedCustomDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeepCreatedCustomDomain. +func (d *DeepCreatedCustomDomain) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeepCreatedCustomDomainProperties. +func (d DeepCreatedCustomDomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hostName", d.HostName) + populate(objectMap, "validationData", d.ValidationData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeepCreatedCustomDomainProperties. +func (d *DeepCreatedCustomDomainProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostName": + err = unpopulate(val, "HostName", &d.HostName) + delete(rawMsg, key) + case "validationData": + err = unpopulate(val, "ValidationData", &d.ValidationData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeepCreatedOrigin. +func (d DeepCreatedOrigin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeepCreatedOrigin. +func (d *DeepCreatedOrigin) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeepCreatedOriginGroup. +func (d DeepCreatedOriginGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeepCreatedOriginGroup. +func (d *DeepCreatedOriginGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeepCreatedOriginGroupProperties. +func (d DeepCreatedOriginGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "healthProbeSettings", d.HealthProbeSettings) + populate(objectMap, "origins", d.Origins) + populate(objectMap, "responseBasedOriginErrorDetectionSettings", d.ResponseBasedOriginErrorDetectionSettings) + populate(objectMap, "trafficRestorationTimeToHealedOrNewEndpointsInMinutes", d.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeepCreatedOriginGroupProperties. +func (d *DeepCreatedOriginGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "healthProbeSettings": + err = unpopulate(val, "HealthProbeSettings", &d.HealthProbeSettings) + delete(rawMsg, key) + case "origins": + err = unpopulate(val, "Origins", &d.Origins) + delete(rawMsg, key) + case "responseBasedOriginErrorDetectionSettings": + err = unpopulate(val, "ResponseBasedOriginErrorDetectionSettings", &d.ResponseBasedOriginErrorDetectionSettings) + delete(rawMsg, key) + case "trafficRestorationTimeToHealedOrNewEndpointsInMinutes": + err = unpopulate(val, "TrafficRestorationTimeToHealedOrNewEndpointsInMinutes", &d.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeepCreatedOriginProperties. +func (d DeepCreatedOriginProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "httpPort", d.HTTPPort) + populate(objectMap, "httpsPort", d.HTTPSPort) + populate(objectMap, "hostName", d.HostName) + populate(objectMap, "originHostHeader", d.OriginHostHeader) + populate(objectMap, "priority", d.Priority) + populate(objectMap, "privateEndpointStatus", d.PrivateEndpointStatus) + populate(objectMap, "privateLinkAlias", d.PrivateLinkAlias) + populate(objectMap, "privateLinkApprovalMessage", d.PrivateLinkApprovalMessage) + populate(objectMap, "privateLinkLocation", d.PrivateLinkLocation) + populate(objectMap, "privateLinkResourceId", d.PrivateLinkResourceID) + populate(objectMap, "weight", d.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeepCreatedOriginProperties. +func (d *DeepCreatedOriginProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + case "httpPort": + err = unpopulate(val, "HTTPPort", &d.HTTPPort) + delete(rawMsg, key) + case "httpsPort": + err = unpopulate(val, "HTTPSPort", &d.HTTPSPort) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &d.HostName) + delete(rawMsg, key) + case "originHostHeader": + err = unpopulate(val, "OriginHostHeader", &d.OriginHostHeader) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &d.Priority) + delete(rawMsg, key) + case "privateEndpointStatus": + err = unpopulate(val, "PrivateEndpointStatus", &d.PrivateEndpointStatus) + delete(rawMsg, key) + case "privateLinkAlias": + err = unpopulate(val, "PrivateLinkAlias", &d.PrivateLinkAlias) + delete(rawMsg, key) + case "privateLinkApprovalMessage": + err = unpopulate(val, "PrivateLinkApprovalMessage", &d.PrivateLinkApprovalMessage) + delete(rawMsg, key) + case "privateLinkLocation": + err = unpopulate(val, "PrivateLinkLocation", &d.PrivateLinkLocation) + delete(rawMsg, key) + case "privateLinkResourceId": + err = unpopulate(val, "PrivateLinkResourceID", &d.PrivateLinkResourceID) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &d.Weight) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRule. +func (d DeliveryRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actions", d.Actions) + populate(objectMap, "conditions", d.Conditions) + populate(objectMap, "name", d.Name) + populate(objectMap, "order", d.Order) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRule. +func (d *DeliveryRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actions": + d.Actions, err = unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(val) + delete(rawMsg, key) + case "conditions": + d.Conditions, err = unmarshalDeliveryRuleConditionClassificationArray(val) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &d.Order) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleActionAutoGenerated. +func (d DeliveryRuleActionAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = d.Name + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleActionAutoGenerated. +func (d *DeliveryRuleActionAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCacheExpirationAction. +func (d DeliveryRuleCacheExpirationAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = DeliveryRuleActionCacheExpiration + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleCacheExpirationAction. +func (d *DeliveryRuleCacheExpirationAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCacheKeyQueryStringAction. +func (d DeliveryRuleCacheKeyQueryStringAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = DeliveryRuleActionCacheKeyQueryString + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleCacheKeyQueryStringAction. +func (d *DeliveryRuleCacheKeyQueryStringAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleClientPortCondition. +func (d DeliveryRuleClientPortCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableClientPort + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleClientPortCondition. +func (d *DeliveryRuleClientPortCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCondition. +func (d DeliveryRuleCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = d.Name + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleCondition. +func (d *DeliveryRuleCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCookiesCondition. +func (d DeliveryRuleCookiesCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableCookies + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleCookiesCondition. +func (d *DeliveryRuleCookiesCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleHTTPVersionCondition. +func (d DeliveryRuleHTTPVersionCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableHTTPVersion + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleHTTPVersionCondition. +func (d *DeliveryRuleHTTPVersionCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleHostNameCondition. +func (d DeliveryRuleHostNameCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableHostName + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleHostNameCondition. +func (d *DeliveryRuleHostNameCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleIsDeviceCondition. +func (d DeliveryRuleIsDeviceCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableIsDevice + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleIsDeviceCondition. +func (d *DeliveryRuleIsDeviceCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRulePostArgsCondition. +func (d DeliveryRulePostArgsCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariablePostArgs + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRulePostArgsCondition. +func (d *DeliveryRulePostArgsCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleQueryStringCondition. +func (d DeliveryRuleQueryStringCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableQueryString + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleQueryStringCondition. +func (d *DeliveryRuleQueryStringCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRemoteAddressCondition. +func (d DeliveryRuleRemoteAddressCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableRemoteAddress + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRemoteAddressCondition. +func (d *DeliveryRuleRemoteAddressCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestBodyCondition. +func (d DeliveryRuleRequestBodyCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableRequestBody + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestBodyCondition. +func (d *DeliveryRuleRequestBodyCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestHeaderAction. +func (d DeliveryRuleRequestHeaderAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = DeliveryRuleActionModifyRequestHeader + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestHeaderAction. +func (d *DeliveryRuleRequestHeaderAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestHeaderCondition. +func (d DeliveryRuleRequestHeaderCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableRequestHeader + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestHeaderCondition. +func (d *DeliveryRuleRequestHeaderCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestMethodCondition. +func (d DeliveryRuleRequestMethodCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableRequestMethod + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestMethodCondition. +func (d *DeliveryRuleRequestMethodCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestSchemeCondition. +func (d DeliveryRuleRequestSchemeCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableRequestScheme + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestSchemeCondition. +func (d *DeliveryRuleRequestSchemeCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestURICondition. +func (d DeliveryRuleRequestURICondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableRequestURI + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestURICondition. +func (d *DeliveryRuleRequestURICondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleResponseHeaderAction. +func (d DeliveryRuleResponseHeaderAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = DeliveryRuleActionModifyResponseHeader + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleResponseHeaderAction. +func (d *DeliveryRuleResponseHeaderAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRouteConfigurationOverrideAction. +func (d DeliveryRuleRouteConfigurationOverrideAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = DeliveryRuleActionRouteConfigurationOverride + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRouteConfigurationOverrideAction. +func (d *DeliveryRuleRouteConfigurationOverrideAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleSSLProtocolCondition. +func (d DeliveryRuleSSLProtocolCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableSSLProtocol + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleSSLProtocolCondition. +func (d *DeliveryRuleSSLProtocolCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleServerPortCondition. +func (d DeliveryRuleServerPortCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableServerPort + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleServerPortCondition. +func (d *DeliveryRuleServerPortCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleSocketAddrCondition. +func (d DeliveryRuleSocketAddrCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableSocketAddr + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleSocketAddrCondition. +func (d *DeliveryRuleSocketAddrCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleURLFileExtensionCondition. +func (d DeliveryRuleURLFileExtensionCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableURLFileExtension + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleURLFileExtensionCondition. +func (d *DeliveryRuleURLFileExtensionCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleURLFileNameCondition. +func (d DeliveryRuleURLFileNameCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableURLFileName + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleURLFileNameCondition. +func (d *DeliveryRuleURLFileNameCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleURLPathCondition. +func (d DeliveryRuleURLPathCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = MatchVariableURLPath + populate(objectMap, "parameters", d.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleURLPathCondition. +func (d *DeliveryRuleURLPathCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &d.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DimensionProperties. +func (d DimensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "internalName", d.InternalName) + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DimensionProperties. +func (d *DimensionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "internalName": + err = unpopulate(val, "InternalName", &d.InternalName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DomainValidationProperties. +func (d DomainValidationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "expirationDate", d.ExpirationDate) + populate(objectMap, "validationToken", d.ValidationToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainValidationProperties. +func (d *DomainValidationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationDate": + err = unpopulate(val, "ExpirationDate", &d.ExpirationDate) + delete(rawMsg, key) + case "validationToken": + err = unpopulate(val, "ValidationToken", &d.ValidationToken) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EdgeNode. +func (e EdgeNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EdgeNode. +func (e *EdgeNode) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EdgeNodeProperties. +func (e EdgeNodeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ipAddressGroups", e.IPAddressGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EdgeNodeProperties. +func (e *EdgeNodeProperties) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipAddressGroups": + err = unpopulate(val, "IPAddressGroups", &e.IPAddressGroups) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EdgenodeResult. +func (e EdgenodeResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EdgenodeResult. +func (e *EdgenodeResult) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Endpoint. +func (e Endpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Endpoint. +func (e *Endpoint) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointListResult. +func (e EndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointListResult. +func (e *EndpointListResult) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointProperties. +func (e EndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentTypesToCompress", e.ContentTypesToCompress) + populate(objectMap, "customDomains", e.CustomDomains) + populate(objectMap, "defaultOriginGroup", e.DefaultOriginGroup) + populate(objectMap, "deliveryPolicy", e.DeliveryPolicy) + populate(objectMap, "geoFilters", e.GeoFilters) + populate(objectMap, "hostName", e.HostName) + populate(objectMap, "isCompressionEnabled", e.IsCompressionEnabled) + populate(objectMap, "isHttpAllowed", e.IsHTTPAllowed) + populate(objectMap, "isHttpsAllowed", e.IsHTTPSAllowed) + populate(objectMap, "optimizationType", e.OptimizationType) + populate(objectMap, "originGroups", e.OriginGroups) + populate(objectMap, "originHostHeader", e.OriginHostHeader) + populate(objectMap, "originPath", e.OriginPath) + populate(objectMap, "origins", e.Origins) + populate(objectMap, "probePath", e.ProbePath) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "queryStringCachingBehavior", e.QueryStringCachingBehavior) + populate(objectMap, "resourceState", e.ResourceState) + populate(objectMap, "urlSigningKeys", e.URLSigningKeys) + populate(objectMap, "webApplicationFirewallPolicyLink", e.WebApplicationFirewallPolicyLink) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointProperties. +func (e *EndpointProperties) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contentTypesToCompress": + err = unpopulate(val, "ContentTypesToCompress", &e.ContentTypesToCompress) + delete(rawMsg, key) + case "customDomains": + err = unpopulate(val, "CustomDomains", &e.CustomDomains) + delete(rawMsg, key) + case "defaultOriginGroup": + err = unpopulate(val, "DefaultOriginGroup", &e.DefaultOriginGroup) + delete(rawMsg, key) + case "deliveryPolicy": + err = unpopulate(val, "DeliveryPolicy", &e.DeliveryPolicy) + delete(rawMsg, key) + case "geoFilters": + err = unpopulate(val, "GeoFilters", &e.GeoFilters) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &e.HostName) + delete(rawMsg, key) + case "isCompressionEnabled": + err = unpopulate(val, "IsCompressionEnabled", &e.IsCompressionEnabled) + delete(rawMsg, key) + case "isHttpAllowed": + err = unpopulate(val, "IsHTTPAllowed", &e.IsHTTPAllowed) + delete(rawMsg, key) + case "isHttpsAllowed": + err = unpopulate(val, "IsHTTPSAllowed", &e.IsHTTPSAllowed) + delete(rawMsg, key) + case "optimizationType": + err = unpopulate(val, "OptimizationType", &e.OptimizationType) + delete(rawMsg, key) + case "originGroups": + err = unpopulate(val, "OriginGroups", &e.OriginGroups) + delete(rawMsg, key) + case "originHostHeader": + err = unpopulate(val, "OriginHostHeader", &e.OriginHostHeader) + delete(rawMsg, key) + case "originPath": + err = unpopulate(val, "OriginPath", &e.OriginPath) + delete(rawMsg, key) + case "origins": + err = unpopulate(val, "Origins", &e.Origins) + delete(rawMsg, key) + case "probePath": + err = unpopulate(val, "ProbePath", &e.ProbePath) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "queryStringCachingBehavior": + err = unpopulate(val, "QueryStringCachingBehavior", &e.QueryStringCachingBehavior) + delete(rawMsg, key) + case "resourceState": + err = unpopulate(val, "ResourceState", &e.ResourceState) + delete(rawMsg, key) + case "urlSigningKeys": + err = unpopulate(val, "URLSigningKeys", &e.URLSigningKeys) + delete(rawMsg, key) + case "webApplicationFirewallPolicyLink": + err = unpopulate(val, "WebApplicationFirewallPolicyLink", &e.WebApplicationFirewallPolicyLink) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesUpdateParameters. +func (e EndpointPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentTypesToCompress", e.ContentTypesToCompress) + populate(objectMap, "defaultOriginGroup", e.DefaultOriginGroup) + populate(objectMap, "deliveryPolicy", e.DeliveryPolicy) + populate(objectMap, "geoFilters", e.GeoFilters) + populate(objectMap, "isCompressionEnabled", e.IsCompressionEnabled) + populate(objectMap, "isHttpAllowed", e.IsHTTPAllowed) + populate(objectMap, "isHttpsAllowed", e.IsHTTPSAllowed) + populate(objectMap, "optimizationType", e.OptimizationType) + populate(objectMap, "originHostHeader", e.OriginHostHeader) + populate(objectMap, "originPath", e.OriginPath) + populate(objectMap, "probePath", e.ProbePath) + populate(objectMap, "queryStringCachingBehavior", e.QueryStringCachingBehavior) + populate(objectMap, "urlSigningKeys", e.URLSigningKeys) + populate(objectMap, "webApplicationFirewallPolicyLink", e.WebApplicationFirewallPolicyLink) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointPropertiesUpdateParameters. +func (e *EndpointPropertiesUpdateParameters) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contentTypesToCompress": + err = unpopulate(val, "ContentTypesToCompress", &e.ContentTypesToCompress) + delete(rawMsg, key) + case "defaultOriginGroup": + err = unpopulate(val, "DefaultOriginGroup", &e.DefaultOriginGroup) + delete(rawMsg, key) + case "deliveryPolicy": + err = unpopulate(val, "DeliveryPolicy", &e.DeliveryPolicy) + delete(rawMsg, key) + case "geoFilters": + err = unpopulate(val, "GeoFilters", &e.GeoFilters) + delete(rawMsg, key) + case "isCompressionEnabled": + err = unpopulate(val, "IsCompressionEnabled", &e.IsCompressionEnabled) + delete(rawMsg, key) + case "isHttpAllowed": + err = unpopulate(val, "IsHTTPAllowed", &e.IsHTTPAllowed) + delete(rawMsg, key) + case "isHttpsAllowed": + err = unpopulate(val, "IsHTTPSAllowed", &e.IsHTTPSAllowed) + delete(rawMsg, key) + case "optimizationType": + err = unpopulate(val, "OptimizationType", &e.OptimizationType) + delete(rawMsg, key) + case "originHostHeader": + err = unpopulate(val, "OriginHostHeader", &e.OriginHostHeader) + delete(rawMsg, key) + case "originPath": + err = unpopulate(val, "OriginPath", &e.OriginPath) + delete(rawMsg, key) + case "probePath": + err = unpopulate(val, "ProbePath", &e.ProbePath) + delete(rawMsg, key) + case "queryStringCachingBehavior": + err = unpopulate(val, "QueryStringCachingBehavior", &e.QueryStringCachingBehavior) + delete(rawMsg, key) + case "urlSigningKeys": + err = unpopulate(val, "URLSigningKeys", &e.URLSigningKeys) + delete(rawMsg, key) + case "webApplicationFirewallPolicyLink": + err = unpopulate(val, "WebApplicationFirewallPolicyLink", &e.WebApplicationFirewallPolicyLink) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesUpdateParametersDeliveryPolicy. +func (e EndpointPropertiesUpdateParametersDeliveryPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", e.Description) + populate(objectMap, "rules", e.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointPropertiesUpdateParametersDeliveryPolicy. +func (e *EndpointPropertiesUpdateParametersDeliveryPolicy) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &e.Description) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &e.Rules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink. +func (e EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink. +func (e *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointUpdateParameters. +func (e EndpointUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointUpdateParameters. +func (e *EndpointUpdateParameters) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GeoFilter. +func (g GeoFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", g.Action) + populate(objectMap, "countryCodes", g.CountryCodes) + populate(objectMap, "relativePath", g.RelativePath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoFilter. +func (g *GeoFilter) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &g.Action) + delete(rawMsg, key) + case "countryCodes": + err = unpopulate(val, "CountryCodes", &g.CountryCodes) + delete(rawMsg, key) + case "relativePath": + err = unpopulate(val, "RelativePath", &g.RelativePath) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPErrorRangeParameters. +func (h HTTPErrorRangeParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "begin", h.Begin) + populate(objectMap, "end", h.End) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPErrorRangeParameters. +func (h *HTTPErrorRangeParameters) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "begin": + err = unpopulate(val, "Begin", &h.Begin) + delete(rawMsg, key) + case "end": + err = unpopulate(val, "End", &h.End) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPVersionMatchConditionParameters. +func (h HTTPVersionMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", h.MatchValues) + populate(objectMap, "negateCondition", h.NegateCondition) + populate(objectMap, "operator", h.Operator) + populate(objectMap, "transforms", h.Transforms) + populate(objectMap, "typeName", h.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPVersionMatchConditionParameters. +func (h *HTTPVersionMatchConditionParameters) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &h.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &h.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &h.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &h.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &h.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HeaderActionParameters. +func (h HeaderActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "headerAction", h.HeaderAction) + populate(objectMap, "headerName", h.HeaderName) + populate(objectMap, "typeName", h.TypeName) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HeaderActionParameters. +func (h *HeaderActionParameters) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "headerAction": + err = unpopulate(val, "HeaderAction", &h.HeaderAction) + delete(rawMsg, key) + case "headerName": + err = unpopulate(val, "HeaderName", &h.HeaderName) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &h.TypeName) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &h.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HealthProbeParameters. +func (h HealthProbeParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "probeIntervalInSeconds", h.ProbeIntervalInSeconds) + populate(objectMap, "probePath", h.ProbePath) + populate(objectMap, "probeProtocol", h.ProbeProtocol) + populate(objectMap, "probeRequestType", h.ProbeRequestType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HealthProbeParameters. +func (h *HealthProbeParameters) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "probeIntervalInSeconds": + err = unpopulate(val, "ProbeIntervalInSeconds", &h.ProbeIntervalInSeconds) + delete(rawMsg, key) + case "probePath": + err = unpopulate(val, "ProbePath", &h.ProbePath) + delete(rawMsg, key) + case "probeProtocol": + err = unpopulate(val, "ProbeProtocol", &h.ProbeProtocol) + delete(rawMsg, key) + case "probeRequestType": + err = unpopulate(val, "ProbeRequestType", &h.ProbeRequestType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostNameMatchConditionParameters. +func (h HostNameMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", h.MatchValues) + populate(objectMap, "negateCondition", h.NegateCondition) + populate(objectMap, "operator", h.Operator) + populate(objectMap, "transforms", h.Transforms) + populate(objectMap, "typeName", h.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostNameMatchConditionParameters. +func (h *HostNameMatchConditionParameters) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &h.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &h.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &h.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &h.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &h.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPAddressGroup. +func (i IPAddressGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deliveryRegion", i.DeliveryRegion) + populate(objectMap, "ipv4Addresses", i.IPv4Addresses) + populate(objectMap, "ipv6Addresses", i.IPv6Addresses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPAddressGroup. +func (i *IPAddressGroup) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deliveryRegion": + err = unpopulate(val, "DeliveryRegion", &i.DeliveryRegion) + delete(rawMsg, key) + case "ipv4Addresses": + err = unpopulate(val, "IPv4Addresses", &i.IPv4Addresses) + delete(rawMsg, key) + case "ipv6Addresses": + err = unpopulate(val, "IPv6Addresses", &i.IPv6Addresses) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IsDeviceMatchConditionParameters. +func (i IsDeviceMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", i.MatchValues) + populate(objectMap, "negateCondition", i.NegateCondition) + populate(objectMap, "operator", i.Operator) + populate(objectMap, "transforms", i.Transforms) + populate(objectMap, "typeName", i.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IsDeviceMatchConditionParameters. +func (i *IsDeviceMatchConditionParameters) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &i.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &i.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &i.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &i.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &i.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultCertificateSourceParameters. +func (k KeyVaultCertificateSourceParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deleteRule", k.DeleteRule) + populate(objectMap, "resourceGroupName", k.ResourceGroupName) + populate(objectMap, "secretName", k.SecretName) + populate(objectMap, "secretVersion", k.SecretVersion) + populate(objectMap, "subscriptionId", k.SubscriptionID) + populate(objectMap, "typeName", k.TypeName) + populate(objectMap, "updateRule", k.UpdateRule) + populate(objectMap, "vaultName", k.VaultName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultCertificateSourceParameters. +func (k *KeyVaultCertificateSourceParameters) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deleteRule": + err = unpopulate(val, "DeleteRule", &k.DeleteRule) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &k.ResourceGroupName) + delete(rawMsg, key) + case "secretName": + err = unpopulate(val, "SecretName", &k.SecretName) + delete(rawMsg, key) + case "secretVersion": + err = unpopulate(val, "SecretVersion", &k.SecretVersion) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &k.SubscriptionID) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &k.TypeName) + delete(rawMsg, key) + case "updateRule": + err = unpopulate(val, "UpdateRule", &k.UpdateRule) + delete(rawMsg, key) + case "vaultName": + err = unpopulate(val, "VaultName", &k.VaultName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultSigningKeyParameters. +func (k KeyVaultSigningKeyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resourceGroupName", k.ResourceGroupName) + populate(objectMap, "secretName", k.SecretName) + populate(objectMap, "secretVersion", k.SecretVersion) + populate(objectMap, "subscriptionId", k.SubscriptionID) + populate(objectMap, "typeName", k.TypeName) + populate(objectMap, "vaultName", k.VaultName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultSigningKeyParameters. +func (k *KeyVaultSigningKeyParameters) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &k.ResourceGroupName) + delete(rawMsg, key) + case "secretName": + err = unpopulate(val, "SecretName", &k.SecretName) + delete(rawMsg, key) + case "secretVersion": + err = unpopulate(val, "SecretVersion", &k.SecretVersion) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &k.SubscriptionID) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &k.TypeName) + delete(rawMsg, key) + case "vaultName": + err = unpopulate(val, "VaultName", &k.VaultName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LinkedEndpoint. +func (l LinkedEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedEndpoint. +func (l *LinkedEndpoint) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoadBalancingSettingsParameters. +func (l LoadBalancingSettingsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalLatencyInMilliseconds", l.AdditionalLatencyInMilliseconds) + populate(objectMap, "sampleSize", l.SampleSize) + populate(objectMap, "successfulSamplesRequired", l.SuccessfulSamplesRequired) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancingSettingsParameters. +func (l *LoadBalancingSettingsParameters) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalLatencyInMilliseconds": + err = unpopulate(val, "AdditionalLatencyInMilliseconds", &l.AdditionalLatencyInMilliseconds) + delete(rawMsg, key) + case "sampleSize": + err = unpopulate(val, "SampleSize", &l.SampleSize) + delete(rawMsg, key) + case "successfulSamplesRequired": + err = unpopulate(val, "SuccessfulSamplesRequired", &l.SuccessfulSamplesRequired) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoadParameters. +func (l LoadParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentPaths", l.ContentPaths) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadParameters. +func (l *LoadParameters) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contentPaths": + err = unpopulate(val, "ContentPaths", &l.ContentPaths) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogSpecification. +func (l LogSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobDuration", l.BlobDuration) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "logFilterPattern", l.LogFilterPattern) + populate(objectMap, "name", l.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSpecification. +func (l *LogSpecification) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobDuration": + err = unpopulate(val, "BlobDuration", &l.BlobDuration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "logFilterPattern": + err = unpopulate(val, "LogFilterPattern", &l.LogFilterPattern) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificate. +func (m ManagedCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "expirationDate", m.ExpirationDate) + populate(objectMap, "subject", m.Subject) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificate. +func (m *ManagedCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationDate": + err = unpopulate(val, "ExpirationDate", &m.ExpirationDate) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &m.Subject) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificateParameters. +func (m ManagedCertificateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "expirationDate", m.ExpirationDate) + populate(objectMap, "subject", m.Subject) + objectMap["type"] = SecretTypeManagedCertificate + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificateParameters. +func (m *ManagedCertificateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationDate": + err = unpopulate(val, "ExpirationDate", &m.ExpirationDate) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &m.Subject) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedHTTPSParameters. +func (m ManagedHTTPSParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["certificateSource"] = CertificateSourceCdn + populate(objectMap, "certificateSourceParameters", m.CertificateSourceParameters) + populate(objectMap, "minimumTlsVersion", m.MinimumTLSVersion) + populate(objectMap, "protocolType", m.ProtocolType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHTTPSParameters. +func (m *ManagedHTTPSParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateSource": + err = unpopulate(val, "CertificateSource", &m.CertificateSource) + delete(rawMsg, key) + case "certificateSourceParameters": + err = unpopulate(val, "CertificateSourceParameters", &m.CertificateSourceParameters) + delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &m.MinimumTLSVersion) + delete(rawMsg, key) + case "protocolType": + err = unpopulate(val, "ProtocolType", &m.ProtocolType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleDefinition. +func (m ManagedRuleDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", m.Description) + populate(objectMap, "ruleId", m.RuleID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleDefinition. +func (m *ManagedRuleDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "ruleId": + err = unpopulate(val, "RuleID", &m.RuleID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleGroupDefinition. +func (m ManagedRuleGroupDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", m.Description) + populate(objectMap, "ruleGroupName", m.RuleGroupName) + populate(objectMap, "rules", m.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleGroupDefinition. +func (m *ManagedRuleGroupDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "ruleGroupName": + err = unpopulate(val, "RuleGroupName", &m.RuleGroupName) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &m.Rules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleGroupOverride. +func (m ManagedRuleGroupOverride) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ruleGroupName", m.RuleGroupName) + populate(objectMap, "rules", m.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleGroupOverride. +func (m *ManagedRuleGroupOverride) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ruleGroupName": + err = unpopulate(val, "RuleGroupName", &m.RuleGroupName) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &m.Rules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleOverride. +func (m ManagedRuleOverride) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", m.Action) + populate(objectMap, "enabledState", m.EnabledState) + populate(objectMap, "ruleId", m.RuleID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleOverride. +func (m *ManagedRuleOverride) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &m.Action) + delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &m.EnabledState) + delete(rawMsg, key) + case "ruleId": + err = unpopulate(val, "RuleID", &m.RuleID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSet. +func (m ManagedRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "anomalyScore", m.AnomalyScore) + populate(objectMap, "ruleGroupOverrides", m.RuleGroupOverrides) + populate(objectMap, "ruleSetType", m.RuleSetType) + populate(objectMap, "ruleSetVersion", m.RuleSetVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleSet. +func (m *ManagedRuleSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "anomalyScore": + err = unpopulate(val, "AnomalyScore", &m.AnomalyScore) + delete(rawMsg, key) + case "ruleGroupOverrides": + err = unpopulate(val, "RuleGroupOverrides", &m.RuleGroupOverrides) + delete(rawMsg, key) + case "ruleSetType": + err = unpopulate(val, "RuleSetType", &m.RuleSetType) + delete(rawMsg, key) + case "ruleSetVersion": + err = unpopulate(val, "RuleSetVersion", &m.RuleSetVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSetDefinition. +func (m ManagedRuleSetDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "sku", m.SKU) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleSetDefinition. +func (m *ManagedRuleSetDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSetDefinitionList. +func (m ManagedRuleSetDefinitionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleSetDefinitionList. +func (m *ManagedRuleSetDefinitionList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSetDefinitionProperties. +func (m ManagedRuleSetDefinitionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "ruleGroups", m.RuleGroups) + populate(objectMap, "ruleSetType", m.RuleSetType) + populate(objectMap, "ruleSetVersion", m.RuleSetVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleSetDefinitionProperties. +func (m *ManagedRuleSetDefinitionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "ruleGroups": + err = unpopulate(val, "RuleGroups", &m.RuleGroups) + delete(rawMsg, key) + case "ruleSetType": + err = unpopulate(val, "RuleSetType", &m.RuleSetType) + delete(rawMsg, key) + case "ruleSetVersion": + err = unpopulate(val, "RuleSetVersion", &m.RuleSetVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSetList. +func (m ManagedRuleSetList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "managedRuleSets", m.ManagedRuleSets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedRuleSetList. +func (m *ManagedRuleSetList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "managedRuleSets": + err = unpopulate(val, "ManagedRuleSets", &m.ManagedRuleSets) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MatchCondition. +func (m MatchCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValue", m.MatchValue) + populate(objectMap, "matchVariable", m.MatchVariable) + populate(objectMap, "negateCondition", m.NegateCondition) + populate(objectMap, "operator", m.Operator) + populate(objectMap, "selector", m.Selector) + populate(objectMap, "transforms", m.Transforms) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MatchCondition. +func (m *MatchCondition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValue": + err = unpopulate(val, "MatchValue", &m.MatchValue) + delete(rawMsg, key) + case "matchVariable": + err = unpopulate(val, "MatchVariable", &m.MatchVariable) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &m.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &m.Operator) + delete(rawMsg, key) + case "selector": + err = unpopulate(val, "Selector", &m.Selector) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &m.Transforms) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricAvailability. +func (m MetricAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobDuration", m.BlobDuration) + populate(objectMap, "timeGrain", m.TimeGrain) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability. +func (m *MetricAvailability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobDuration": + err = unpopulate(val, "BlobDuration", &m.BlobDuration) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &m.TimeGrain) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricSpecification. +func (m MetricSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregationType", m.AggregationType) + populate(objectMap, "availabilities", m.Availabilities) + populate(objectMap, "dimensions", m.Dimensions) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "isInternal", m.IsInternal) + populate(objectMap, "metricFilterPattern", m.MetricFilterPattern) + populate(objectMap, "name", m.Name) + populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification. +func (m *MetricSpecification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aggregationType": + err = unpopulate(val, "AggregationType", &m.AggregationType) + delete(rawMsg, key) + case "availabilities": + err = unpopulate(val, "Availabilities", &m.Availabilities) + delete(rawMsg, key) + case "dimensions": + err = unpopulate(val, "Dimensions", &m.Dimensions) + delete(rawMsg, key) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &m.DisplayDescription) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "fillGapWithZero": + err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) + delete(rawMsg, key) + case "isInternal": + err = unpopulate(val, "IsInternal", &m.IsInternal) + delete(rawMsg, key) + case "metricFilterPattern": + err = unpopulate(val, "MetricFilterPattern", &m.MetricFilterPattern) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "supportedTimeGrainTypes": + err = unpopulate(val, "SupportedTimeGrainTypes", &m.SupportedTimeGrainTypes) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricsResponse. +func (m MetricsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "dateTimeBegin", m.DateTimeBegin) + populateTimeRFC3339(objectMap, "dateTimeEnd", m.DateTimeEnd) + populate(objectMap, "granularity", m.Granularity) + populate(objectMap, "series", m.Series) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricsResponse. +func (m *MetricsResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dateTimeBegin": + err = unpopulateTimeRFC3339(val, "DateTimeBegin", &m.DateTimeBegin) + delete(rawMsg, key) + case "dateTimeEnd": + err = unpopulateTimeRFC3339(val, "DateTimeEnd", &m.DateTimeEnd) + delete(rawMsg, key) + case "granularity": + err = unpopulate(val, "Granularity", &m.Granularity) + delete(rawMsg, key) + case "series": + err = unpopulate(val, "Series", &m.Series) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricsResponseSeriesItem. +func (m MetricsResponseSeriesItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "data", m.Data) + populate(objectMap, "groups", m.Groups) + populate(objectMap, "metric", m.Metric) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricsResponseSeriesItem. +func (m *MetricsResponseSeriesItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "data": + err = unpopulate(val, "Data", &m.Data) + delete(rawMsg, key) + case "groups": + err = unpopulate(val, "Groups", &m.Groups) + delete(rawMsg, key) + case "metric": + err = unpopulate(val, "Metric", &m.Metric) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetricsResponseSeriesPropertiesItemsItem. +func (m MetricsResponseSeriesPropertiesItemsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricsResponseSeriesPropertiesItemsItem. +func (m *MetricsResponseSeriesPropertiesItemsItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateResult. +func (m MigrateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errors", m.Errors) + populate(objectMap, "migratedProfileResourceId", m.MigratedProfileResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateResult. +func (m *MigrateResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errors": + err = unpopulate(val, "Errors", &m.Errors) + delete(rawMsg, key) + case "migratedProfileResourceId": + err = unpopulate(val, "MigratedProfileResourceID", &m.MigratedProfileResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationErrorType. +func (m MigrationErrorType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", m.Code) + populate(objectMap, "errorMessage", m.ErrorMessage) + populate(objectMap, "nextSteps", m.NextSteps) + populate(objectMap, "resourceName", m.ResourceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationErrorType. +func (m *MigrationErrorType) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &m.Code) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &m.ErrorMessage) + delete(rawMsg, key) + case "nextSteps": + err = unpopulate(val, "NextSteps", &m.NextSteps) + delete(rawMsg, key) + case "resourceName": + err = unpopulate(val, "ResourceName", &m.ResourceName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationParameters. +func (m MigrationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "classicResourceReference", m.ClassicResourceReference) + populate(objectMap, "migrationWebApplicationFirewallMappings", m.MigrationWebApplicationFirewallMappings) + populate(objectMap, "profileName", m.ProfileName) + populate(objectMap, "sku", m.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationParameters. +func (m *MigrationParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "classicResourceReference": + err = unpopulate(val, "ClassicResourceReference", &m.ClassicResourceReference) + delete(rawMsg, key) + case "migrationWebApplicationFirewallMappings": + err = unpopulate(val, "MigrationWebApplicationFirewallMappings", &m.MigrationWebApplicationFirewallMappings) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &m.ProfileName) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MigrationWebApplicationFirewallMapping. +func (m MigrationWebApplicationFirewallMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "migratedFrom", m.MigratedFrom) + populate(objectMap, "migratedTo", m.MigratedTo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationWebApplicationFirewallMapping. +func (m *MigrationWebApplicationFirewallMapping) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "migratedFrom": + err = unpopulate(val, "MigratedFrom", &m.MigratedFrom) + delete(rawMsg, key) + case "migratedTo": + err = unpopulate(val, "MigratedTo", &m.MigratedTo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.OperationProperties) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "OperationProperties", &o.OperationProperties) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. +func (o *OperationProperties) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationsListResult. +func (o OperationsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsListResult. +func (o *OperationsListResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Origin. +func (o Origin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Origin. +func (o *Origin) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginGroup. +func (o OriginGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginGroup. +func (o *OriginGroup) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginGroupListResult. +func (o OriginGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginGroupListResult. +func (o *OriginGroupListResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginGroupOverride. +func (o OriginGroupOverride) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "forwardingProtocol", o.ForwardingProtocol) + populate(objectMap, "originGroup", o.OriginGroup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginGroupOverride. +func (o *OriginGroupOverride) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "forwardingProtocol": + err = unpopulate(val, "ForwardingProtocol", &o.ForwardingProtocol) + delete(rawMsg, key) + case "originGroup": + err = unpopulate(val, "OriginGroup", &o.OriginGroup) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginGroupOverrideAction. +func (o OriginGroupOverrideAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = DeliveryRuleActionOriginGroupOverride + populate(objectMap, "parameters", o.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginGroupOverrideAction. +func (o *OriginGroupOverrideAction) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &o.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginGroupOverrideActionParameters. +func (o OriginGroupOverrideActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "originGroup", o.OriginGroup) + populate(objectMap, "typeName", o.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginGroupOverrideActionParameters. +func (o *OriginGroupOverrideActionParameters) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "originGroup": + err = unpopulate(val, "OriginGroup", &o.OriginGroup) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &o.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginGroupProperties. +func (o OriginGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "healthProbeSettings", o.HealthProbeSettings) + populate(objectMap, "origins", o.Origins) + populate(objectMap, "provisioningState", o.ProvisioningState) + populate(objectMap, "resourceState", o.ResourceState) + populate(objectMap, "responseBasedOriginErrorDetectionSettings", o.ResponseBasedOriginErrorDetectionSettings) + populate(objectMap, "trafficRestorationTimeToHealedOrNewEndpointsInMinutes", o.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginGroupProperties. +func (o *OriginGroupProperties) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "healthProbeSettings": + err = unpopulate(val, "HealthProbeSettings", &o.HealthProbeSettings) + delete(rawMsg, key) + case "origins": + err = unpopulate(val, "Origins", &o.Origins) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + case "resourceState": + err = unpopulate(val, "ResourceState", &o.ResourceState) + delete(rawMsg, key) + case "responseBasedOriginErrorDetectionSettings": + err = unpopulate(val, "ResponseBasedOriginErrorDetectionSettings", &o.ResponseBasedOriginErrorDetectionSettings) + delete(rawMsg, key) + case "trafficRestorationTimeToHealedOrNewEndpointsInMinutes": + err = unpopulate(val, "TrafficRestorationTimeToHealedOrNewEndpointsInMinutes", &o.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginGroupUpdateParameters. +func (o OriginGroupUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginGroupUpdateParameters. +func (o *OriginGroupUpdateParameters) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginGroupUpdatePropertiesParameters. +func (o OriginGroupUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "healthProbeSettings", o.HealthProbeSettings) + populate(objectMap, "origins", o.Origins) + populate(objectMap, "responseBasedOriginErrorDetectionSettings", o.ResponseBasedOriginErrorDetectionSettings) + populate(objectMap, "trafficRestorationTimeToHealedOrNewEndpointsInMinutes", o.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginGroupUpdatePropertiesParameters. +func (o *OriginGroupUpdatePropertiesParameters) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "healthProbeSettings": + err = unpopulate(val, "HealthProbeSettings", &o.HealthProbeSettings) + delete(rawMsg, key) + case "origins": + err = unpopulate(val, "Origins", &o.Origins) + delete(rawMsg, key) + case "responseBasedOriginErrorDetectionSettings": + err = unpopulate(val, "ResponseBasedOriginErrorDetectionSettings", &o.ResponseBasedOriginErrorDetectionSettings) + delete(rawMsg, key) + case "trafficRestorationTimeToHealedOrNewEndpointsInMinutes": + err = unpopulate(val, "TrafficRestorationTimeToHealedOrNewEndpointsInMinutes", &o.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginListResult. +func (o OriginListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginListResult. +func (o *OriginListResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginProperties. +func (o OriginProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", o.Enabled) + populate(objectMap, "httpPort", o.HTTPPort) + populate(objectMap, "httpsPort", o.HTTPSPort) + populate(objectMap, "hostName", o.HostName) + populate(objectMap, "originHostHeader", o.OriginHostHeader) + populate(objectMap, "priority", o.Priority) + populate(objectMap, "privateEndpointStatus", o.PrivateEndpointStatus) + populate(objectMap, "privateLinkAlias", o.PrivateLinkAlias) + populate(objectMap, "privateLinkApprovalMessage", o.PrivateLinkApprovalMessage) + populate(objectMap, "privateLinkLocation", o.PrivateLinkLocation) + populate(objectMap, "privateLinkResourceId", o.PrivateLinkResourceID) + populate(objectMap, "provisioningState", o.ProvisioningState) + populate(objectMap, "resourceState", o.ResourceState) + populate(objectMap, "weight", o.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginProperties. +func (o *OriginProperties) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &o.Enabled) + delete(rawMsg, key) + case "httpPort": + err = unpopulate(val, "HTTPPort", &o.HTTPPort) + delete(rawMsg, key) + case "httpsPort": + err = unpopulate(val, "HTTPSPort", &o.HTTPSPort) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &o.HostName) + delete(rawMsg, key) + case "originHostHeader": + err = unpopulate(val, "OriginHostHeader", &o.OriginHostHeader) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &o.Priority) + delete(rawMsg, key) + case "privateEndpointStatus": + err = unpopulate(val, "PrivateEndpointStatus", &o.PrivateEndpointStatus) + delete(rawMsg, key) + case "privateLinkAlias": + err = unpopulate(val, "PrivateLinkAlias", &o.PrivateLinkAlias) + delete(rawMsg, key) + case "privateLinkApprovalMessage": + err = unpopulate(val, "PrivateLinkApprovalMessage", &o.PrivateLinkApprovalMessage) + delete(rawMsg, key) + case "privateLinkLocation": + err = unpopulate(val, "PrivateLinkLocation", &o.PrivateLinkLocation) + delete(rawMsg, key) + case "privateLinkResourceId": + err = unpopulate(val, "PrivateLinkResourceID", &o.PrivateLinkResourceID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + case "resourceState": + err = unpopulate(val, "ResourceState", &o.ResourceState) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &o.Weight) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginUpdateParameters. +func (o OriginUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginUpdateParameters. +func (o *OriginUpdateParameters) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OriginUpdatePropertiesParameters. +func (o OriginUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", o.Enabled) + populate(objectMap, "httpPort", o.HTTPPort) + populate(objectMap, "httpsPort", o.HTTPSPort) + populate(objectMap, "hostName", o.HostName) + populate(objectMap, "originHostHeader", o.OriginHostHeader) + populate(objectMap, "priority", o.Priority) + populate(objectMap, "privateLinkAlias", o.PrivateLinkAlias) + populate(objectMap, "privateLinkApprovalMessage", o.PrivateLinkApprovalMessage) + populate(objectMap, "privateLinkLocation", o.PrivateLinkLocation) + populate(objectMap, "privateLinkResourceId", o.PrivateLinkResourceID) + populate(objectMap, "weight", o.Weight) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OriginUpdatePropertiesParameters. +func (o *OriginUpdatePropertiesParameters) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &o.Enabled) + delete(rawMsg, key) + case "httpPort": + err = unpopulate(val, "HTTPPort", &o.HTTPPort) + delete(rawMsg, key) + case "httpsPort": + err = unpopulate(val, "HTTPSPort", &o.HTTPSPort) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &o.HostName) + delete(rawMsg, key) + case "originHostHeader": + err = unpopulate(val, "OriginHostHeader", &o.OriginHostHeader) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &o.Priority) + delete(rawMsg, key) + case "privateLinkAlias": + err = unpopulate(val, "PrivateLinkAlias", &o.PrivateLinkAlias) + delete(rawMsg, key) + case "privateLinkApprovalMessage": + err = unpopulate(val, "PrivateLinkApprovalMessage", &o.PrivateLinkApprovalMessage) + delete(rawMsg, key) + case "privateLinkLocation": + err = unpopulate(val, "PrivateLinkLocation", &o.PrivateLinkLocation) + delete(rawMsg, key) + case "privateLinkResourceId": + err = unpopulate(val, "PrivateLinkResourceID", &o.PrivateLinkResourceID) + delete(rawMsg, key) + case "weight": + err = unpopulate(val, "Weight", &o.Weight) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PolicySettings. +func (p PolicySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "defaultCustomBlockResponseBody", p.DefaultCustomBlockResponseBody) + populate(objectMap, "defaultCustomBlockResponseStatusCode", p.DefaultCustomBlockResponseStatusCode) + populate(objectMap, "defaultRedirectUrl", p.DefaultRedirectURL) + populate(objectMap, "enabledState", p.EnabledState) + populate(objectMap, "mode", p.Mode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicySettings. +func (p *PolicySettings) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultCustomBlockResponseBody": + err = unpopulate(val, "DefaultCustomBlockResponseBody", &p.DefaultCustomBlockResponseBody) + delete(rawMsg, key) + case "defaultCustomBlockResponseStatusCode": + err = unpopulate(val, "DefaultCustomBlockResponseStatusCode", &p.DefaultCustomBlockResponseStatusCode) + delete(rawMsg, key) + case "defaultRedirectUrl": + err = unpopulate(val, "DefaultRedirectURL", &p.DefaultRedirectURL) + delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &p.EnabledState) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &p.Mode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PostArgsMatchConditionParameters. +func (p PostArgsMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", p.MatchValues) + populate(objectMap, "negateCondition", p.NegateCondition) + populate(objectMap, "operator", p.Operator) + populate(objectMap, "selector", p.Selector) + populate(objectMap, "transforms", p.Transforms) + populate(objectMap, "typeName", p.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PostArgsMatchConditionParameters. +func (p *PostArgsMatchConditionParameters) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &p.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &p.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &p.Operator) + delete(rawMsg, key) + case "selector": + err = unpopulate(val, "Selector", &p.Selector) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &p.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &p.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "kind", p.Kind) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Profile. +func (p *Profile) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &p.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &p.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProfileChangeSKUWafMapping. +func (p ProfileChangeSKUWafMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "changeToWafPolicy", p.ChangeToWafPolicy) + populate(objectMap, "securityPolicyName", p.SecurityPolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfileChangeSKUWafMapping. +func (p *ProfileChangeSKUWafMapping) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "changeToWafPolicy": + err = unpopulate(val, "ChangeToWafPolicy", &p.ChangeToWafPolicy) + delete(rawMsg, key) + case "securityPolicyName": + err = unpopulate(val, "SecurityPolicyName", &p.SecurityPolicyName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProfileListResult. +func (p ProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfileListResult. +func (p *ProfileListResult) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProfileProperties. +func (p ProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "extendedProperties", p.ExtendedProperties) + populate(objectMap, "frontDoorId", p.FrontDoorID) + populate(objectMap, "originResponseTimeoutSeconds", p.OriginResponseTimeoutSeconds) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "resourceState", p.ResourceState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfileProperties. +func (p *ProfileProperties) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "extendedProperties": + err = unpopulate(val, "ExtendedProperties", &p.ExtendedProperties) + delete(rawMsg, key) + case "frontDoorId": + err = unpopulate(val, "FrontDoorID", &p.FrontDoorID) + delete(rawMsg, key) + case "originResponseTimeoutSeconds": + err = unpopulate(val, "OriginResponseTimeoutSeconds", &p.OriginResponseTimeoutSeconds) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "resourceState": + err = unpopulate(val, "ResourceState", &p.ResourceState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProfilePropertiesUpdateParameters. +func (p ProfilePropertiesUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "originResponseTimeoutSeconds", p.OriginResponseTimeoutSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfilePropertiesUpdateParameters. +func (p *ProfilePropertiesUpdateParameters) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "originResponseTimeoutSeconds": + err = unpopulate(val, "OriginResponseTimeoutSeconds", &p.OriginResponseTimeoutSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProfileUpdateParameters. +func (p ProfileUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfileUpdateParameters. +func (p *ProfileUpdateParameters) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &p.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProfileUpgradeParameters. +func (p ProfileUpgradeParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "wafMappingList", p.WafMappingList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProfileUpgradeParameters. +func (p *ProfileUpgradeParameters) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "wafMappingList": + err = unpopulate(val, "WafMappingList", &p.WafMappingList) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PurgeParameters. +func (p PurgeParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentPaths", p.ContentPaths) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PurgeParameters. +func (p *PurgeParameters) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contentPaths": + err = unpopulate(val, "ContentPaths", &p.ContentPaths) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryStringMatchConditionParameters. +func (q QueryStringMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", q.MatchValues) + populate(objectMap, "negateCondition", q.NegateCondition) + populate(objectMap, "operator", q.Operator) + populate(objectMap, "transforms", q.Transforms) + populate(objectMap, "typeName", q.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStringMatchConditionParameters. +func (q *QueryStringMatchConditionParameters) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &q.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &q.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &q.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &q.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &q.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RankingsResponse. +func (r RankingsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "dateTimeBegin", r.DateTimeBegin) + populateTimeRFC3339(objectMap, "dateTimeEnd", r.DateTimeEnd) + populate(objectMap, "tables", r.Tables) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RankingsResponse. +func (r *RankingsResponse) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dateTimeBegin": + err = unpopulateTimeRFC3339(val, "DateTimeBegin", &r.DateTimeBegin) + delete(rawMsg, key) + case "dateTimeEnd": + err = unpopulateTimeRFC3339(val, "DateTimeEnd", &r.DateTimeEnd) + delete(rawMsg, key) + case "tables": + err = unpopulate(val, "Tables", &r.Tables) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RankingsResponseTablesItem. +func (r RankingsResponseTablesItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "data", r.Data) + populate(objectMap, "ranking", r.Ranking) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RankingsResponseTablesItem. +func (r *RankingsResponseTablesItem) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "data": + err = unpopulate(val, "Data", &r.Data) + delete(rawMsg, key) + case "ranking": + err = unpopulate(val, "Ranking", &r.Ranking) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RankingsResponseTablesPropertiesItemsItem. +func (r RankingsResponseTablesPropertiesItemsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metrics", r.Metrics) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RankingsResponseTablesPropertiesItemsItem. +func (r *RankingsResponseTablesPropertiesItemsItem) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metrics": + err = unpopulate(val, "Metrics", &r.Metrics) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RankingsResponseTablesPropertiesItemsMetricsItem. +func (r RankingsResponseTablesPropertiesItemsMetricsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metric", r.Metric) + populate(objectMap, "percentage", r.Percentage) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RankingsResponseTablesPropertiesItemsMetricsItem. +func (r *RankingsResponseTablesPropertiesItemsMetricsItem) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metric": + err = unpopulate(val, "Metric", &r.Metric) + delete(rawMsg, key) + case "percentage": + err = unpopulate(val, "Percentage", &r.Percentage) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RateLimitRule. +func (r RateLimitRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", r.Action) + populate(objectMap, "enabledState", r.EnabledState) + populate(objectMap, "matchConditions", r.MatchConditions) + populate(objectMap, "name", r.Name) + populate(objectMap, "priority", r.Priority) + populate(objectMap, "rateLimitDurationInMinutes", r.RateLimitDurationInMinutes) + populate(objectMap, "rateLimitThreshold", r.RateLimitThreshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RateLimitRule. +func (r *RateLimitRule) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &r.Action) + delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &r.EnabledState) + delete(rawMsg, key) + case "matchConditions": + err = unpopulate(val, "MatchConditions", &r.MatchConditions) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &r.Priority) + delete(rawMsg, key) + case "rateLimitDurationInMinutes": + err = unpopulate(val, "RateLimitDurationInMinutes", &r.RateLimitDurationInMinutes) + delete(rawMsg, key) + case "rateLimitThreshold": + err = unpopulate(val, "RateLimitThreshold", &r.RateLimitThreshold) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RateLimitRuleList. +func (r RateLimitRuleList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "rules", r.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RateLimitRuleList. +func (r *RateLimitRuleList) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "rules": + err = unpopulate(val, "Rules", &r.Rules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RemoteAddressMatchConditionParameters. +func (r RemoteAddressMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", r.MatchValues) + populate(objectMap, "negateCondition", r.NegateCondition) + populate(objectMap, "operator", r.Operator) + populate(objectMap, "transforms", r.Transforms) + populate(objectMap, "typeName", r.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RemoteAddressMatchConditionParameters. +func (r *RemoteAddressMatchConditionParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &r.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &r.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &r.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &r.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &r.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RequestBodyMatchConditionParameters. +func (r RequestBodyMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", r.MatchValues) + populate(objectMap, "negateCondition", r.NegateCondition) + populate(objectMap, "operator", r.Operator) + populate(objectMap, "transforms", r.Transforms) + populate(objectMap, "typeName", r.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestBodyMatchConditionParameters. +func (r *RequestBodyMatchConditionParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &r.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &r.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &r.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &r.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &r.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RequestHeaderMatchConditionParameters. +func (r RequestHeaderMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", r.MatchValues) + populate(objectMap, "negateCondition", r.NegateCondition) + populate(objectMap, "operator", r.Operator) + populate(objectMap, "selector", r.Selector) + populate(objectMap, "transforms", r.Transforms) + populate(objectMap, "typeName", r.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestHeaderMatchConditionParameters. +func (r *RequestHeaderMatchConditionParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &r.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &r.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &r.Operator) + delete(rawMsg, key) + case "selector": + err = unpopulate(val, "Selector", &r.Selector) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &r.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &r.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RequestMethodMatchConditionParameters. +func (r RequestMethodMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", r.MatchValues) + populate(objectMap, "negateCondition", r.NegateCondition) + populate(objectMap, "operator", r.Operator) + populate(objectMap, "transforms", r.Transforms) + populate(objectMap, "typeName", r.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestMethodMatchConditionParameters. +func (r *RequestMethodMatchConditionParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &r.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &r.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &r.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &r.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &r.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RequestSchemeMatchConditionParameters. +func (r RequestSchemeMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", r.MatchValues) + populate(objectMap, "negateCondition", r.NegateCondition) + populate(objectMap, "operator", r.Operator) + populate(objectMap, "transforms", r.Transforms) + populate(objectMap, "typeName", r.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestSchemeMatchConditionParameters. +func (r *RequestSchemeMatchConditionParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &r.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &r.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &r.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &r.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &r.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RequestURIMatchConditionParameters. +func (r RequestURIMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", r.MatchValues) + populate(objectMap, "negateCondition", r.NegateCondition) + populate(objectMap, "operator", r.Operator) + populate(objectMap, "transforms", r.Transforms) + populate(objectMap, "typeName", r.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestURIMatchConditionParameters. +func (r *RequestURIMatchConditionParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &r.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &r.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &r.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &r.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &r.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceReference. +func (r ResourceReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReference. +func (r *ResourceReference) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceUsage. +func (r ResourceUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", r.CurrentValue) + populate(objectMap, "limit", r.Limit) + populate(objectMap, "resourceType", r.ResourceType) + populate(objectMap, "unit", r.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceUsage. +func (r *ResourceUsage) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &r.CurrentValue) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &r.Limit) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &r.ResourceType) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &r.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceUsageListResult. +func (r ResourceUsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceUsageListResult. +func (r *ResourceUsageListResult) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourcesResponse. +func (r ResourcesResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customDomains", r.CustomDomains) + populate(objectMap, "endpoints", r.Endpoints) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourcesResponse. +func (r *ResourcesResponse) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customDomains": + err = unpopulate(val, "CustomDomains", &r.CustomDomains) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &r.Endpoints) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourcesResponseCustomDomainsItem. +func (r ResourcesResponseCustomDomainsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endpointId", r.EndpointID) + populate(objectMap, "history", r.History) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourcesResponseCustomDomainsItem. +func (r *ResourcesResponseCustomDomainsItem) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointId": + err = unpopulate(val, "EndpointID", &r.EndpointID) + delete(rawMsg, key) + case "history": + err = unpopulate(val, "History", &r.History) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourcesResponseEndpointsItem. +func (r ResourcesResponseEndpointsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customDomains", r.CustomDomains) + populate(objectMap, "history", r.History) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourcesResponseEndpointsItem. +func (r *ResourcesResponseEndpointsItem) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customDomains": + err = unpopulate(val, "CustomDomains", &r.CustomDomains) + delete(rawMsg, key) + case "history": + err = unpopulate(val, "History", &r.History) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourcesResponseEndpointsPropertiesItemsItem. +func (r ResourcesResponseEndpointsPropertiesItemsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endpointId", r.EndpointID) + populate(objectMap, "history", r.History) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourcesResponseEndpointsPropertiesItemsItem. +func (r *ResourcesResponseEndpointsPropertiesItemsItem) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointId": + err = unpopulate(val, "EndpointID", &r.EndpointID) + delete(rawMsg, key) + case "history": + err = unpopulate(val, "History", &r.History) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResponseBasedOriginErrorDetectionParameters. +func (r ResponseBasedOriginErrorDetectionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "httpErrorRanges", r.HTTPErrorRanges) + populate(objectMap, "responseBasedDetectedErrorTypes", r.ResponseBasedDetectedErrorTypes) + populate(objectMap, "responseBasedFailoverThresholdPercentage", r.ResponseBasedFailoverThresholdPercentage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResponseBasedOriginErrorDetectionParameters. +func (r *ResponseBasedOriginErrorDetectionParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "httpErrorRanges": + err = unpopulate(val, "HTTPErrorRanges", &r.HTTPErrorRanges) + delete(rawMsg, key) + case "responseBasedDetectedErrorTypes": + err = unpopulate(val, "ResponseBasedDetectedErrorTypes", &r.ResponseBasedDetectedErrorTypes) + delete(rawMsg, key) + case "responseBasedFailoverThresholdPercentage": + err = unpopulate(val, "ResponseBasedFailoverThresholdPercentage", &r.ResponseBasedFailoverThresholdPercentage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Route. +func (r Route) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Route. +func (r *Route) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RouteConfigurationOverrideActionParameters. +func (r RouteConfigurationOverrideActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cacheConfiguration", r.CacheConfiguration) + populate(objectMap, "originGroupOverride", r.OriginGroupOverride) + populate(objectMap, "typeName", r.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteConfigurationOverrideActionParameters. +func (r *RouteConfigurationOverrideActionParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cacheConfiguration": + err = unpopulate(val, "CacheConfiguration", &r.CacheConfiguration) + delete(rawMsg, key) + case "originGroupOverride": + err = unpopulate(val, "OriginGroupOverride", &r.OriginGroupOverride) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &r.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RouteListResult. +func (r RouteListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteListResult. +func (r *RouteListResult) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RouteProperties. +func (r RouteProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cacheConfiguration", r.CacheConfiguration) + populate(objectMap, "customDomains", r.CustomDomains) + populate(objectMap, "deploymentStatus", r.DeploymentStatus) + populate(objectMap, "enabledState", r.EnabledState) + populate(objectMap, "endpointName", r.EndpointName) + populate(objectMap, "forwardingProtocol", r.ForwardingProtocol) + populate(objectMap, "httpsRedirect", r.HTTPSRedirect) + populate(objectMap, "linkToDefaultDomain", r.LinkToDefaultDomain) + populate(objectMap, "originGroup", r.OriginGroup) + populate(objectMap, "originPath", r.OriginPath) + populate(objectMap, "patternsToMatch", r.PatternsToMatch) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "ruleSets", r.RuleSets) + populate(objectMap, "supportedProtocols", r.SupportedProtocols) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteProperties. +func (r *RouteProperties) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cacheConfiguration": + err = unpopulate(val, "CacheConfiguration", &r.CacheConfiguration) + delete(rawMsg, key) + case "customDomains": + err = unpopulate(val, "CustomDomains", &r.CustomDomains) + delete(rawMsg, key) + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &r.DeploymentStatus) + delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &r.EnabledState) + delete(rawMsg, key) + case "endpointName": + err = unpopulate(val, "EndpointName", &r.EndpointName) + delete(rawMsg, key) + case "forwardingProtocol": + err = unpopulate(val, "ForwardingProtocol", &r.ForwardingProtocol) + delete(rawMsg, key) + case "httpsRedirect": + err = unpopulate(val, "HTTPSRedirect", &r.HTTPSRedirect) + delete(rawMsg, key) + case "linkToDefaultDomain": + err = unpopulate(val, "LinkToDefaultDomain", &r.LinkToDefaultDomain) + delete(rawMsg, key) + case "originGroup": + err = unpopulate(val, "OriginGroup", &r.OriginGroup) + delete(rawMsg, key) + case "originPath": + err = unpopulate(val, "OriginPath", &r.OriginPath) + delete(rawMsg, key) + case "patternsToMatch": + err = unpopulate(val, "PatternsToMatch", &r.PatternsToMatch) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "ruleSets": + err = unpopulate(val, "RuleSets", &r.RuleSets) + delete(rawMsg, key) + case "supportedProtocols": + err = unpopulate(val, "SupportedProtocols", &r.SupportedProtocols) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RouteUpdateParameters. +func (r RouteUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteUpdateParameters. +func (r *RouteUpdateParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RouteUpdatePropertiesParameters. +func (r RouteUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cacheConfiguration", r.CacheConfiguration) + populate(objectMap, "customDomains", r.CustomDomains) + populate(objectMap, "enabledState", r.EnabledState) + populate(objectMap, "endpointName", r.EndpointName) + populate(objectMap, "forwardingProtocol", r.ForwardingProtocol) + populate(objectMap, "httpsRedirect", r.HTTPSRedirect) + populate(objectMap, "linkToDefaultDomain", r.LinkToDefaultDomain) + populate(objectMap, "originGroup", r.OriginGroup) + populate(objectMap, "originPath", r.OriginPath) + populate(objectMap, "patternsToMatch", r.PatternsToMatch) + populate(objectMap, "ruleSets", r.RuleSets) + populate(objectMap, "supportedProtocols", r.SupportedProtocols) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RouteUpdatePropertiesParameters. +func (r *RouteUpdatePropertiesParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cacheConfiguration": + err = unpopulate(val, "CacheConfiguration", &r.CacheConfiguration) + delete(rawMsg, key) + case "customDomains": + err = unpopulate(val, "CustomDomains", &r.CustomDomains) + delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &r.EnabledState) + delete(rawMsg, key) + case "endpointName": + err = unpopulate(val, "EndpointName", &r.EndpointName) + delete(rawMsg, key) + case "forwardingProtocol": + err = unpopulate(val, "ForwardingProtocol", &r.ForwardingProtocol) + delete(rawMsg, key) + case "httpsRedirect": + err = unpopulate(val, "HTTPSRedirect", &r.HTTPSRedirect) + delete(rawMsg, key) + case "linkToDefaultDomain": + err = unpopulate(val, "LinkToDefaultDomain", &r.LinkToDefaultDomain) + delete(rawMsg, key) + case "originGroup": + err = unpopulate(val, "OriginGroup", &r.OriginGroup) + delete(rawMsg, key) + case "originPath": + err = unpopulate(val, "OriginPath", &r.OriginPath) + delete(rawMsg, key) + case "patternsToMatch": + err = unpopulate(val, "PatternsToMatch", &r.PatternsToMatch) + delete(rawMsg, key) + case "ruleSets": + err = unpopulate(val, "RuleSets", &r.RuleSets) + delete(rawMsg, key) + case "supportedProtocols": + err = unpopulate(val, "SupportedProtocols", &r.SupportedProtocols) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Rule. +func (r Rule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Rule. +func (r *Rule) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuleListResult. +func (r RuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleListResult. +func (r *RuleListResult) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuleProperties. +func (r RuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actions", r.Actions) + populate(objectMap, "conditions", r.Conditions) + populate(objectMap, "deploymentStatus", r.DeploymentStatus) + populate(objectMap, "matchProcessingBehavior", r.MatchProcessingBehavior) + populate(objectMap, "order", r.Order) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "ruleSetName", r.RuleSetName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleProperties. +func (r *RuleProperties) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actions": + r.Actions, err = unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(val) + delete(rawMsg, key) + case "conditions": + r.Conditions, err = unmarshalDeliveryRuleConditionClassificationArray(val) + delete(rawMsg, key) + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &r.DeploymentStatus) + delete(rawMsg, key) + case "matchProcessingBehavior": + err = unpopulate(val, "MatchProcessingBehavior", &r.MatchProcessingBehavior) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &r.Order) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "ruleSetName": + err = unpopulate(val, "RuleSetName", &r.RuleSetName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuleSet. +func (r RuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleSet. +func (r *RuleSet) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuleSetListResult. +func (r RuleSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleSetListResult. +func (r *RuleSetListResult) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuleSetProperties. +func (r RuleSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deploymentStatus", r.DeploymentStatus) + populate(objectMap, "profileName", r.ProfileName) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleSetProperties. +func (r *RuleSetProperties) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &r.DeploymentStatus) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &r.ProfileName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuleUpdateParameters. +func (r RuleUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleUpdateParameters. +func (r *RuleUpdateParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuleUpdatePropertiesParameters. +func (r RuleUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actions", r.Actions) + populate(objectMap, "conditions", r.Conditions) + populate(objectMap, "matchProcessingBehavior", r.MatchProcessingBehavior) + populate(objectMap, "order", r.Order) + populate(objectMap, "ruleSetName", r.RuleSetName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuleUpdatePropertiesParameters. +func (r *RuleUpdatePropertiesParameters) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actions": + r.Actions, err = unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(val) + delete(rawMsg, key) + case "conditions": + r.Conditions, err = unmarshalDeliveryRuleConditionClassificationArray(val) + delete(rawMsg, key) + case "matchProcessingBehavior": + err = unpopulate(val, "MatchProcessingBehavior", &r.MatchProcessingBehavior) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &r.Order) + delete(rawMsg, key) + case "ruleSetName": + err = unpopulate(val, "RuleSetName", &r.RuleSetName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SSLProtocolMatchConditionParameters. +func (s SSLProtocolMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", s.MatchValues) + populate(objectMap, "negateCondition", s.NegateCondition) + populate(objectMap, "operator", s.Operator) + populate(objectMap, "transforms", s.Transforms) + populate(objectMap, "typeName", s.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SSLProtocolMatchConditionParameters. +func (s *SSLProtocolMatchConditionParameters) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &s.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &s.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &s.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &s.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &s.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Secret. +func (s Secret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Secret. +func (s *Secret) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretListResult. +func (s SecretListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretListResult. +func (s *SecretListResult) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretParameters. +func (s SecretParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = s.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretParameters. +func (s *SecretParameters) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretProperties. +func (s SecretProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deploymentStatus", s.DeploymentStatus) + populate(objectMap, "parameters", s.Parameters) + populate(objectMap, "profileName", s.ProfileName) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretProperties. +func (s *SecretProperties) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &s.DeploymentStatus) + delete(rawMsg, key) + case "parameters": + s.Parameters, err = unmarshalSecretParametersClassification(val) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &s.ProfileName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicy. +func (s SecurityPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicy. +func (s *SecurityPolicy) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyListResult. +func (s SecurityPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyListResult. +func (s *SecurityPolicyListResult) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyProperties. +func (s SecurityPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deploymentStatus", s.DeploymentStatus) + populate(objectMap, "parameters", s.Parameters) + populate(objectMap, "profileName", s.ProfileName) + populate(objectMap, "provisioningState", s.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyProperties. +func (s *SecurityPolicyProperties) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deploymentStatus": + err = unpopulate(val, "DeploymentStatus", &s.DeploymentStatus) + delete(rawMsg, key) + case "parameters": + s.Parameters, err = unmarshalSecurityPolicyPropertiesParametersClassification(val) + delete(rawMsg, key) + case "profileName": + err = unpopulate(val, "ProfileName", &s.ProfileName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyPropertiesParameters. +func (s SecurityPolicyPropertiesParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = s.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyPropertiesParameters. +func (s *SecurityPolicyPropertiesParameters) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyUpdateParameters. +func (s SecurityPolicyUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyUpdateParameters. +func (s *SecurityPolicyUpdateParameters) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyUpdateProperties. +func (s SecurityPolicyUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "parameters", s.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyUpdateProperties. +func (s *SecurityPolicyUpdateProperties) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "parameters": + s.Parameters, err = unmarshalSecurityPolicyPropertiesParametersClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyWebApplicationFirewallAssociation. +func (s SecurityPolicyWebApplicationFirewallAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "domains", s.Domains) + populate(objectMap, "patternsToMatch", s.PatternsToMatch) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyWebApplicationFirewallAssociation. +func (s *SecurityPolicyWebApplicationFirewallAssociation) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "domains": + err = unpopulate(val, "Domains", &s.Domains) + delete(rawMsg, key) + case "patternsToMatch": + err = unpopulate(val, "PatternsToMatch", &s.PatternsToMatch) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyWebApplicationFirewallParameters. +func (s SecurityPolicyWebApplicationFirewallParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "associations", s.Associations) + objectMap["type"] = SecurityPolicyTypeWebApplicationFirewall + populate(objectMap, "wafPolicy", s.WafPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyWebApplicationFirewallParameters. +func (s *SecurityPolicyWebApplicationFirewallParameters) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "associations": + err = unpopulate(val, "Associations", &s.Associations) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + case "wafPolicy": + err = unpopulate(val, "WafPolicy", &s.WafPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerPortMatchConditionParameters. +func (s ServerPortMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", s.MatchValues) + populate(objectMap, "negateCondition", s.NegateCondition) + populate(objectMap, "operator", s.Operator) + populate(objectMap, "transforms", s.Transforms) + populate(objectMap, "typeName", s.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPortMatchConditionParameters. +func (s *ServerPortMatchConditionParameters) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &s.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &s.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &s.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &s.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &s.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logSpecifications", s.LogSpecifications) + populate(objectMap, "metricSpecifications", s.MetricSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. +func (s *ServiceSpecification) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "logSpecifications": + err = unpopulate(val, "LogSpecifications", &s.LogSpecifications) + delete(rawMsg, key) + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResourceProperties. +func (s SharedPrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", s.GroupID) + populate(objectMap, "privateLink", s.PrivateLink) + populate(objectMap, "privateLinkLocation", s.PrivateLinkLocation) + populate(objectMap, "requestMessage", s.RequestMessage) + populate(objectMap, "status", s.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResourceProperties. +func (s *SharedPrivateLinkResourceProperties) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &s.GroupID) + delete(rawMsg, key) + case "privateLink": + err = unpopulate(val, "PrivateLink", &s.PrivateLink) + delete(rawMsg, key) + case "privateLinkLocation": + err = unpopulate(val, "PrivateLinkLocation", &s.PrivateLinkLocation) + delete(rawMsg, key) + case "requestMessage": + err = unpopulate(val, "RequestMessage", &s.RequestMessage) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SocketAddrMatchConditionParameters. +func (s SocketAddrMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", s.MatchValues) + populate(objectMap, "negateCondition", s.NegateCondition) + populate(objectMap, "operator", s.Operator) + populate(objectMap, "transforms", s.Transforms) + populate(objectMap, "typeName", s.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SocketAddrMatchConditionParameters. +func (s *SocketAddrMatchConditionParameters) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &s.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &s.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &s.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &s.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &s.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SsoURI. +func (s SsoURI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ssoUriValue", s.SsoURIValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SsoURI. +func (s *SsoURI) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ssoUriValue": + err = unpopulate(val, "SsoURIValue", &s.SsoURIValue) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SupportedOptimizationTypesListResult. +func (s SupportedOptimizationTypesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "supportedOptimizationTypes", s.SupportedOptimizationTypes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedOptimizationTypesListResult. +func (s *SupportedOptimizationTypesListResult) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "supportedOptimizationTypes": + err = unpopulate(val, "SupportedOptimizationTypes", &s.SupportedOptimizationTypes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLFileExtensionMatchConditionParameters. +func (u URLFileExtensionMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", u.MatchValues) + populate(objectMap, "negateCondition", u.NegateCondition) + populate(objectMap, "operator", u.Operator) + populate(objectMap, "transforms", u.Transforms) + populate(objectMap, "typeName", u.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLFileExtensionMatchConditionParameters. +func (u *URLFileExtensionMatchConditionParameters) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &u.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &u.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &u.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &u.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &u.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLFileNameMatchConditionParameters. +func (u URLFileNameMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", u.MatchValues) + populate(objectMap, "negateCondition", u.NegateCondition) + populate(objectMap, "operator", u.Operator) + populate(objectMap, "transforms", u.Transforms) + populate(objectMap, "typeName", u.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLFileNameMatchConditionParameters. +func (u *URLFileNameMatchConditionParameters) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &u.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &u.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &u.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &u.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &u.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLPathMatchConditionParameters. +func (u URLPathMatchConditionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchValues", u.MatchValues) + populate(objectMap, "negateCondition", u.NegateCondition) + populate(objectMap, "operator", u.Operator) + populate(objectMap, "transforms", u.Transforms) + populate(objectMap, "typeName", u.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLPathMatchConditionParameters. +func (u *URLPathMatchConditionParameters) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchValues": + err = unpopulate(val, "MatchValues", &u.MatchValues) + delete(rawMsg, key) + case "negateCondition": + err = unpopulate(val, "NegateCondition", &u.NegateCondition) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &u.Operator) + delete(rawMsg, key) + case "transforms": + err = unpopulate(val, "Transforms", &u.Transforms) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &u.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLRedirectAction. +func (u URLRedirectAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = DeliveryRuleActionURLRedirect + populate(objectMap, "parameters", u.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLRedirectAction. +func (u *URLRedirectAction) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &u.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLRedirectActionParameters. +func (u URLRedirectActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customFragment", u.CustomFragment) + populate(objectMap, "customHostname", u.CustomHostname) + populate(objectMap, "customPath", u.CustomPath) + populate(objectMap, "customQueryString", u.CustomQueryString) + populate(objectMap, "destinationProtocol", u.DestinationProtocol) + populate(objectMap, "redirectType", u.RedirectType) + populate(objectMap, "typeName", u.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLRedirectActionParameters. +func (u *URLRedirectActionParameters) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customFragment": + err = unpopulate(val, "CustomFragment", &u.CustomFragment) + delete(rawMsg, key) + case "customHostname": + err = unpopulate(val, "CustomHostname", &u.CustomHostname) + delete(rawMsg, key) + case "customPath": + err = unpopulate(val, "CustomPath", &u.CustomPath) + delete(rawMsg, key) + case "customQueryString": + err = unpopulate(val, "CustomQueryString", &u.CustomQueryString) + delete(rawMsg, key) + case "destinationProtocol": + err = unpopulate(val, "DestinationProtocol", &u.DestinationProtocol) + delete(rawMsg, key) + case "redirectType": + err = unpopulate(val, "RedirectType", &u.RedirectType) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &u.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLRewriteAction. +func (u URLRewriteAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = DeliveryRuleActionURLRewrite + populate(objectMap, "parameters", u.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLRewriteAction. +func (u *URLRewriteAction) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &u.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLRewriteActionParameters. +func (u URLRewriteActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destination", u.Destination) + populate(objectMap, "preserveUnmatchedPath", u.PreserveUnmatchedPath) + populate(objectMap, "sourcePattern", u.SourcePattern) + populate(objectMap, "typeName", u.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLRewriteActionParameters. +func (u *URLRewriteActionParameters) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destination": + err = unpopulate(val, "Destination", &u.Destination) + delete(rawMsg, key) + case "preserveUnmatchedPath": + err = unpopulate(val, "PreserveUnmatchedPath", &u.PreserveUnmatchedPath) + delete(rawMsg, key) + case "sourcePattern": + err = unpopulate(val, "SourcePattern", &u.SourcePattern) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &u.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLSigningAction. +func (u URLSigningAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["name"] = DeliveryRuleActionURLSigning + populate(objectMap, "parameters", u.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLSigningAction. +func (u *URLSigningAction) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &u.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLSigningActionParameters. +func (u URLSigningActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "algorithm", u.Algorithm) + populate(objectMap, "parameterNameOverride", u.ParameterNameOverride) + populate(objectMap, "typeName", u.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLSigningActionParameters. +func (u *URLSigningActionParameters) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "algorithm": + err = unpopulate(val, "Algorithm", &u.Algorithm) + delete(rawMsg, key) + case "parameterNameOverride": + err = unpopulate(val, "ParameterNameOverride", &u.ParameterNameOverride) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &u.TypeName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLSigningKey. +func (u URLSigningKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyId", u.KeyID) + populate(objectMap, "keySourceParameters", u.KeySourceParameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLSigningKey. +func (u *URLSigningKey) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyId": + err = unpopulate(val, "KeyID", &u.KeyID) + delete(rawMsg, key) + case "keySourceParameters": + err = unpopulate(val, "KeySourceParameters", &u.KeySourceParameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLSigningKeyParameters. +func (u URLSigningKeyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyId", u.KeyID) + populate(objectMap, "secretSource", u.SecretSource) + populate(objectMap, "secretVersion", u.SecretVersion) + objectMap["type"] = SecretTypeURLSigningKey + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLSigningKeyParameters. +func (u *URLSigningKeyParameters) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyId": + err = unpopulate(val, "KeyID", &u.KeyID) + delete(rawMsg, key) + case "secretSource": + err = unpopulate(val, "SecretSource", &u.SecretSource) + delete(rawMsg, key) + case "secretVersion": + err = unpopulate(val, "SecretVersion", &u.SecretVersion) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLSigningParamIdentifier. +func (u URLSigningParamIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "paramIndicator", u.ParamIndicator) + populate(objectMap, "paramName", u.ParamName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLSigningParamIdentifier. +func (u *URLSigningParamIdentifier) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "paramIndicator": + err = unpopulate(val, "ParamIndicator", &u.ParamIndicator) + delete(rawMsg, key) + case "paramName": + err = unpopulate(val, "ParamName", &u.ParamName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", u.CurrentValue) + populate(objectMap, "id", u.ID) + populate(objectMap, "limit", u.Limit) + populate(objectMap, "name", u.Name) + populate(objectMap, "unit", u.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Usage. +func (u *Usage) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &u.CurrentValue) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &u.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &u.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UsageName. +func (u UsageName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "localizedValue", u.LocalizedValue) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsageName. +func (u *UsageName) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &u.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UsagesListResult. +func (u UsagesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsagesListResult. +func (u *UsagesListResult) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserManagedHTTPSParameters. +func (u UserManagedHTTPSParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["certificateSource"] = CertificateSourceAzureKeyVault + populate(objectMap, "certificateSourceParameters", u.CertificateSourceParameters) + populate(objectMap, "minimumTlsVersion", u.MinimumTLSVersion) + populate(objectMap, "protocolType", u.ProtocolType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserManagedHTTPSParameters. +func (u *UserManagedHTTPSParameters) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateSource": + err = unpopulate(val, "CertificateSource", &u.CertificateSource) + delete(rawMsg, key) + case "certificateSourceParameters": + err = unpopulate(val, "CertificateSourceParameters", &u.CertificateSourceParameters) + delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &u.MinimumTLSVersion) + delete(rawMsg, key) + case "protocolType": + err = unpopulate(val, "ProtocolType", &u.ProtocolType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateCustomDomainInput. +func (v ValidateCustomDomainInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hostName", v.HostName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateCustomDomainInput. +func (v *ValidateCustomDomainInput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hostName": + err = unpopulate(val, "HostName", &v.HostName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateCustomDomainOutput. +func (v ValidateCustomDomainOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customDomainValidated", v.CustomDomainValidated) + populate(objectMap, "message", v.Message) + populate(objectMap, "reason", v.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateCustomDomainOutput. +func (v *ValidateCustomDomainOutput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customDomainValidated": + err = unpopulate(val, "CustomDomainValidated", &v.CustomDomainValidated) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &v.Message) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &v.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateProbeInput. +func (v ValidateProbeInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "probeURL", v.ProbeURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateProbeInput. +func (v *ValidateProbeInput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "probeURL": + err = unpopulate(val, "ProbeURL", &v.ProbeURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateProbeOutput. +func (v ValidateProbeOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorCode", v.ErrorCode) + populate(objectMap, "isValid", v.IsValid) + populate(objectMap, "message", v.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateProbeOutput. +func (v *ValidateProbeOutput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorCode": + err = unpopulate(val, "ErrorCode", &v.ErrorCode) + delete(rawMsg, key) + case "isValid": + err = unpopulate(val, "IsValid", &v.IsValid) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &v.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateSecretInput. +func (v ValidateSecretInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "secretSource", v.SecretSource) + populate(objectMap, "secretType", v.SecretType) + populate(objectMap, "secretVersion", v.SecretVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateSecretInput. +func (v *ValidateSecretInput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "secretSource": + err = unpopulate(val, "SecretSource", &v.SecretSource) + delete(rawMsg, key) + case "secretType": + err = unpopulate(val, "SecretType", &v.SecretType) + delete(rawMsg, key) + case "secretVersion": + err = unpopulate(val, "SecretVersion", &v.SecretVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateSecretOutput. +func (v ValidateSecretOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", v.Message) + populate(objectMap, "status", v.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateSecretOutput. +func (v *ValidateSecretOutput) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &v.Message) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &v.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidationToken. +func (v ValidationToken) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "token", v.Token) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationToken. +func (v *ValidationToken) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "token": + err = unpopulate(val, "Token", &v.Token) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WafMetricsResponse. +func (w WafMetricsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "dateTimeBegin", w.DateTimeBegin) + populateTimeRFC3339(objectMap, "dateTimeEnd", w.DateTimeEnd) + populate(objectMap, "granularity", w.Granularity) + populate(objectMap, "series", w.Series) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WafMetricsResponse. +func (w *WafMetricsResponse) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dateTimeBegin": + err = unpopulateTimeRFC3339(val, "DateTimeBegin", &w.DateTimeBegin) + delete(rawMsg, key) + case "dateTimeEnd": + err = unpopulateTimeRFC3339(val, "DateTimeEnd", &w.DateTimeEnd) + delete(rawMsg, key) + case "granularity": + err = unpopulate(val, "Granularity", &w.Granularity) + delete(rawMsg, key) + case "series": + err = unpopulate(val, "Series", &w.Series) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WafMetricsResponseSeriesItem. +func (w WafMetricsResponseSeriesItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "data", w.Data) + populate(objectMap, "groups", w.Groups) + populate(objectMap, "metric", w.Metric) + populate(objectMap, "unit", w.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WafMetricsResponseSeriesItem. +func (w *WafMetricsResponseSeriesItem) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "data": + err = unpopulate(val, "Data", &w.Data) + delete(rawMsg, key) + case "groups": + err = unpopulate(val, "Groups", &w.Groups) + delete(rawMsg, key) + case "metric": + err = unpopulate(val, "Metric", &w.Metric) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &w.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WafMetricsResponseSeriesPropertiesItemsItem. +func (w WafMetricsResponseSeriesPropertiesItemsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", w.Name) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WafMetricsResponseSeriesPropertiesItemsItem. +func (w *WafMetricsResponseSeriesPropertiesItemsItem) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WafRankingsResponse. +func (w WafRankingsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "data", w.Data) + populateTimeRFC3339(objectMap, "dateTimeBegin", w.DateTimeBegin) + populateTimeRFC3339(objectMap, "dateTimeEnd", w.DateTimeEnd) + populate(objectMap, "groups", w.Groups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WafRankingsResponse. +func (w *WafRankingsResponse) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "data": + err = unpopulate(val, "Data", &w.Data) + delete(rawMsg, key) + case "dateTimeBegin": + err = unpopulateTimeRFC3339(val, "DateTimeBegin", &w.DateTimeBegin) + delete(rawMsg, key) + case "dateTimeEnd": + err = unpopulateTimeRFC3339(val, "DateTimeEnd", &w.DateTimeEnd) + delete(rawMsg, key) + case "groups": + err = unpopulate(val, "Groups", &w.Groups) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WafRankingsResponseDataItem. +func (w WafRankingsResponseDataItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupValues", w.GroupValues) + populate(objectMap, "metrics", w.Metrics) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WafRankingsResponseDataItem. +func (w *WafRankingsResponseDataItem) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupValues": + err = unpopulate(val, "GroupValues", &w.GroupValues) + delete(rawMsg, key) + case "metrics": + err = unpopulate(val, "Metrics", &w.Metrics) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicy. +func (w WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", w.Etag) + populate(objectMap, "id", w.ID) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "sku", w.SKU) + populate(objectMap, "systemData", w.SystemData) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicy. +func (w *WebApplicationFirewallPolicy) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &w.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &w.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicyList. +func (w WebApplicationFirewallPolicyList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicyList. +func (w *WebApplicationFirewallPolicyList) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicyPatchParameters. +func (w WebApplicationFirewallPolicyPatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", w.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicyPatchParameters. +func (w *WebApplicationFirewallPolicyPatchParameters) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicyProperties. +func (w WebApplicationFirewallPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customRules", w.CustomRules) + populate(objectMap, "endpointLinks", w.EndpointLinks) + populate(objectMap, "extendedProperties", w.ExtendedProperties) + populate(objectMap, "managedRules", w.ManagedRules) + populate(objectMap, "policySettings", w.PolicySettings) + populate(objectMap, "provisioningState", w.ProvisioningState) + populate(objectMap, "rateLimitRules", w.RateLimitRules) + populate(objectMap, "resourceState", w.ResourceState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebApplicationFirewallPolicyProperties. +func (w *WebApplicationFirewallPolicyProperties) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customRules": + err = unpopulate(val, "CustomRules", &w.CustomRules) + delete(rawMsg, key) + case "endpointLinks": + err = unpopulate(val, "EndpointLinks", &w.EndpointLinks) + delete(rawMsg, key) + case "extendedProperties": + err = unpopulate(val, "ExtendedProperties", &w.ExtendedProperties) + delete(rawMsg, key) + case "managedRules": + err = unpopulate(val, "ManagedRules", &w.ManagedRules) + delete(rawMsg, key) + case "policySettings": + err = unpopulate(val, "PolicySettings", &w.PolicySettings) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + case "rateLimitRules": + err = unpopulate(val, "RateLimitRules", &w.RateLimitRules) + delete(rawMsg, key) + case "resourceState": + err = unpopulate(val, "ResourceState", &w.ResourceState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_operations_client.go b/sdk/resourcemanager/cdn/armcdn/operations_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_operations_client.go rename to sdk/resourcemanager/cdn/armcdn/operations_client.go index 72b033411b34..10a57a7340f6 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_operations_client.go +++ b/sdk/resourcemanager/cdn/armcdn/operations_client.go @@ -5,6 +5,7 @@ // 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 @@ -49,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available CDN REST API operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_origingroups_client.go b/sdk/resourcemanager/cdn/armcdn/origingroups_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_origingroups_client.go rename to sdk/resourcemanager/cdn/armcdn/origingroups_client.go index 2da6e0113a07..563acaf8404f 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_origingroups_client.go +++ b/sdk/resourcemanager/cdn/armcdn/origingroups_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewOriginGroupsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Creates a new origin group within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -78,7 +79,7 @@ func (client *OriginGroupsClient) BeginCreate(ctx context.Context, resourceGroup // Create - Creates a new origin group within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *OriginGroupsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroup OriginGroup, options *OriginGroupsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, originGroupName, originGroup, options) if err != nil { @@ -122,7 +123,7 @@ func (client *OriginGroupsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, originGroup) @@ -130,7 +131,7 @@ func (client *OriginGroupsClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Deletes an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -151,7 +152,7 @@ func (client *OriginGroupsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *OriginGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, options *OriginGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, originGroupName, options) if err != nil { @@ -195,7 +196,7 @@ func (client *OriginGroupsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +204,7 @@ func (client *OriginGroupsClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -252,7 +253,7 @@ func (client *OriginGroupsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,8 +269,7 @@ func (client *OriginGroupsClient) getHandleResponse(resp *http.Response) (Origin } // NewListByEndpointPager - Lists all of the existing origin groups within an endpoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -327,7 +327,7 @@ func (client *OriginGroupsClient) listByEndpointCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -344,7 +344,7 @@ func (client *OriginGroupsClient) listByEndpointHandleResponse(resp *http.Respon // BeginUpdate - Updates an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -366,7 +366,7 @@ func (client *OriginGroupsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Updates an existing origin group within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *OriginGroupsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroupUpdateProperties OriginGroupUpdateParameters, options *OriginGroupsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties, options) if err != nil { @@ -410,7 +410,7 @@ func (client *OriginGroupsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, originGroupUpdateProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_origins_client.go b/sdk/resourcemanager/cdn/armcdn/origins_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_origins_client.go rename to sdk/resourcemanager/cdn/armcdn/origins_client.go index 7d905f7cd161..f06d3c69d2c6 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_origins_client.go +++ b/sdk/resourcemanager/cdn/armcdn/origins_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewOriginsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new origin within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -77,7 +78,7 @@ func (client *OriginsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new origin within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *OriginsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, origin Origin, options *OriginsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, originName, origin, options) if err != nil { @@ -121,7 +122,7 @@ func (client *OriginsClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, origin) @@ -129,7 +130,7 @@ func (client *OriginsClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -149,7 +150,7 @@ func (client *OriginsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *OriginsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, options *OriginsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, originName, options) if err != nil { @@ -193,7 +194,7 @@ func (client *OriginsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +202,7 @@ func (client *OriginsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -250,7 +251,7 @@ func (client *OriginsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,8 +267,7 @@ func (client *OriginsClient) getHandleResponse(resp *http.Response) (OriginsClie } // NewListByEndpointPager - Lists all of the existing origins within an endpoint. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -324,7 +324,7 @@ func (client *OriginsClient) listByEndpointCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -341,7 +341,7 @@ func (client *OriginsClient) listByEndpointHandleResponse(resp *http.Response) ( // BeginUpdate - Updates an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // endpointName - Name of the endpoint under the profile which is unique globally. @@ -362,7 +362,7 @@ func (client *OriginsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates an existing origin within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *OriginsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters, options *OriginsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, originName, originUpdateProperties, options) if err != nil { @@ -406,7 +406,7 @@ func (client *OriginsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, originUpdateProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_policies_client.go b/sdk/resourcemanager/cdn/armcdn/policies_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_policies_client.go rename to sdk/resourcemanager/cdn/armcdn/policies_client.go index 94006c2f9628..5f365750f6c6 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_policies_client.go +++ b/sdk/resourcemanager/cdn/armcdn/policies_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewPoliciesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update policy with specified rule set name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // policyName - The name of the CdnWebApplicationFirewallPolicy. // cdnWebApplicationFirewallPolicy - Policy to be created. @@ -76,7 +77,7 @@ func (client *PoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update policy with specified rule set name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *PoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicy WebApplicationFirewallPolicy, options *PoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, options) if err != nil { @@ -112,7 +113,7 @@ func (client *PoliciesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, cdnWebApplicationFirewallPolicy) @@ -120,7 +121,7 @@ func (client *PoliciesClient) createOrUpdateCreateRequest(ctx context.Context, r // Delete - Deletes Policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // policyName - The name of the CdnWebApplicationFirewallPolicy. // options - PoliciesClientDeleteOptions contains the optional parameters for the PoliciesClient.Delete method. @@ -159,7 +160,7 @@ func (client *PoliciesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -167,7 +168,7 @@ func (client *PoliciesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Retrieve protection policy with specified name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // policyName - The name of the CdnWebApplicationFirewallPolicy. // options - PoliciesClientGetOptions contains the optional parameters for the PoliciesClient.Get method. @@ -206,7 +207,7 @@ func (client *PoliciesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -222,8 +223,7 @@ func (client *PoliciesClient) getHandleResponse(resp *http.Response) (PoliciesCl } // NewListPager - Lists all of the protection policies within a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // options - PoliciesClientListOptions contains the optional parameters for the PoliciesClient.List method. func (client *PoliciesClient) NewListPager(resourceGroupName string, options *PoliciesClientListOptions) *runtime.Pager[PoliciesClientListResponse] { @@ -270,7 +270,7 @@ func (client *PoliciesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,7 +288,7 @@ func (client *PoliciesClient) listHandleResponse(resp *http.Response) (PoliciesC // BeginUpdate - Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified subscription // and resource group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // policyName - The name of the CdnWebApplicationFirewallPolicy. // cdnWebApplicationFirewallPolicyPatchParameters - CdnWebApplicationFirewallPolicy parameters to be patched. @@ -308,7 +308,7 @@ func (client *PoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified subscription // and resource group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *PoliciesClient) update(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicyPatchParameters WebApplicationFirewallPolicyPatchParameters, options *PoliciesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters, options) if err != nil { @@ -344,7 +344,7 @@ func (client *PoliciesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, cdnWebApplicationFirewallPolicyPatchParameters) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go similarity index 99% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go index e2bdff2054a7..84b971def1ab 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go @@ -5,6 +5,7 @@ // 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 diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_profiles_client.go b/sdk/resourcemanager/cdn/armcdn/profiles_client.go similarity index 75% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_profiles_client.go rename to sdk/resourcemanager/cdn/armcdn/profiles_client.go index 363924841452..e25a738d08c8 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_profiles_client.go +++ b/sdk/resourcemanager/cdn/armcdn/profiles_client.go @@ -5,6 +5,7 @@ // 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 @@ -54,10 +55,62 @@ func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } +// CanMigrate - Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +// resourceGroupName - Name of the Resource group within the Azure subscription. +// canMigrateParameters - Properties needed to check if cdn profile or classic frontdoor can be migrated. +// options - ProfilesClientCanMigrateOptions contains the optional parameters for the ProfilesClient.CanMigrate method. +func (client *ProfilesClient) CanMigrate(ctx context.Context, resourceGroupName string, canMigrateParameters CanMigrateParameters, options *ProfilesClientCanMigrateOptions) (ProfilesClientCanMigrateResponse, error) { + req, err := client.canMigrateCreateRequest(ctx, resourceGroupName, canMigrateParameters, options) + if err != nil { + return ProfilesClientCanMigrateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProfilesClientCanMigrateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProfilesClientCanMigrateResponse{}, runtime.NewResponseError(resp) + } + return client.canMigrateHandleResponse(resp) +} + +// canMigrateCreateRequest creates the CanMigrate request. +func (client *ProfilesClient) canMigrateCreateRequest(ctx context.Context, resourceGroupName string, canMigrateParameters CanMigrateParameters, options *ProfilesClientCanMigrateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/canMigrate" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, canMigrateParameters) +} + +// canMigrateHandleResponse handles the CanMigrate response. +func (client *ProfilesClient) canMigrateHandleResponse(resp *http.Response) (ProfilesClientCanMigrateResponse, error) { + result := ProfilesClientCanMigrateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CanMigrateResult); err != nil { + return ProfilesClientCanMigrateResponse{}, err + } + return result, nil +} + // BeginCreate - Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under // the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -78,7 +131,7 @@ func (client *ProfilesClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under the // specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *ProfilesClient) create(ctx context.Context, resourceGroupName string, profileName string, profile Profile, options *ProfilesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, profile, options) if err != nil { @@ -114,7 +167,7 @@ func (client *ProfilesClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, profile) @@ -124,7 +177,7 @@ func (client *ProfilesClient) createCreateRequest(ctx context.Context, resourceG // parameters. Deleting a profile will result in the deletion of all of the sub-resources // including endpoints, origins and custom domains. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -145,7 +198,7 @@ func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName // Deleting a profile will result in the deletion of all of the sub-resources // including endpoints, origins and custom domains. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, options) if err != nil { @@ -181,7 +234,7 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +245,7 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG // as core reports in a standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium // profile. The SSO URI changes approximately every 10 minutes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the CDN profile which is unique within the resource group. // options - ProfilesClientGenerateSsoURIOptions contains the optional parameters for the ProfilesClient.GenerateSsoURI method. @@ -231,7 +284,7 @@ func (client *ProfilesClient) generateSsoURICreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +302,7 @@ func (client *ProfilesClient) generateSsoURIHandleResponse(resp *http.Response) // Get - Gets an Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile name under // the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -289,7 +342,7 @@ func (client *ProfilesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,8 +358,7 @@ func (client *ProfilesClient) getHandleResponse(resp *http.Response) (ProfilesCl } // NewListPager - Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // options - ProfilesClientListOptions contains the optional parameters for the ProfilesClient.List method. func (client *ProfilesClient) NewListPager(options *ProfilesClientListOptions) *runtime.Pager[ProfilesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProfilesClientListResponse]{ @@ -348,7 +400,7 @@ func (client *ProfilesClient) listCreateRequest(ctx context.Context, options *Pr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,8 +417,7 @@ func (client *ProfilesClient) listHandleResponse(resp *http.Response) (ProfilesC // NewListByResourceGroupPager - Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within // a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // options - ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.ListByResourceGroup // method. @@ -414,7 +465,7 @@ func (client *ProfilesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,8 +482,7 @@ func (client *ProfilesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or // Azure Front Door Premium or CDN profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -486,7 +536,7 @@ func (client *ProfilesClient) listResourceUsageCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -504,7 +554,7 @@ func (client *ProfilesClient) listResourceUsageHandleResponse(resp *http.Respons // ListSupportedOptimizationTypes - Gets the supported optimization types for the current profile. A user can create an endpoint // with an optimization type from the listed values. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -545,7 +595,7 @@ func (client *ProfilesClient) listSupportedOptimizationTypesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -560,10 +610,136 @@ func (client *ProfilesClient) listSupportedOptimizationTypesHandleResponse(resp return result, nil } +// BeginMigrate - Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after +// this. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +// resourceGroupName - Name of the Resource group within the Azure subscription. +// migrationParameters - Properties needed to migrate the profile. +// options - ProfilesClientBeginMigrateOptions contains the optional parameters for the ProfilesClient.BeginMigrate method. +func (client *ProfilesClient) BeginMigrate(ctx context.Context, resourceGroupName string, migrationParameters MigrationParameters, options *ProfilesClientBeginMigrateOptions) (*runtime.Poller[ProfilesClientMigrateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.migrate(ctx, resourceGroupName, migrationParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ProfilesClientMigrateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ProfilesClientMigrateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Migrate - Migrate the CDN profile to Azure Frontdoor(Standard/Premium) profile. The change need to be committed after this. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +func (client *ProfilesClient) migrate(ctx context.Context, resourceGroupName string, migrationParameters MigrationParameters, options *ProfilesClientBeginMigrateOptions) (*http.Response, error) { + req, err := client.migrateCreateRequest(ctx, resourceGroupName, migrationParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// migrateCreateRequest creates the Migrate request. +func (client *ProfilesClient) migrateCreateRequest(ctx context.Context, resourceGroupName string, migrationParameters MigrationParameters, options *ProfilesClientBeginMigrateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/migrate" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, migrationParameters) +} + +// BeginMigrationCommit - Commit the migrated Azure Frontdoor(Standard/Premium) profile. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +// resourceGroupName - Name of the Resource group within the Azure subscription. +// profileName - Name of the CDN profile which is unique within the resource group. +// options - ProfilesClientBeginMigrationCommitOptions contains the optional parameters for the ProfilesClient.BeginMigrationCommit +// method. +func (client *ProfilesClient) BeginMigrationCommit(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginMigrationCommitOptions) (*runtime.Poller[ProfilesClientMigrationCommitResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.migrationCommit(ctx, resourceGroupName, profileName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ProfilesClientMigrationCommitResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ProfilesClientMigrationCommitResponse](options.ResumeToken, client.pl, nil) + } +} + +// MigrationCommit - Commit the migrated Azure Frontdoor(Standard/Premium) profile. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-11-01-preview +func (client *ProfilesClient) migrationCommit(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginMigrationCommitOptions) (*http.Response, error) { + req, err := client.migrationCommitCreateRequest(ctx, resourceGroupName, profileName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// migrationCommitCreateRequest creates the MigrationCommit request. +func (client *ProfilesClient) migrationCommitCreateRequest(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginMigrationCommitOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/migrationCommit" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginUpdate - Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified // profile name under the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -584,7 +760,7 @@ func (client *ProfilesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified profile // name under the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *ProfilesClient) update(ctx context.Context, resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters, options *ProfilesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, profileUpdateParameters, options) if err != nil { @@ -620,7 +796,7 @@ func (client *ProfilesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, profileUpdateParameters) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_resourceusage_client.go b/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_resourceusage_client.go rename to sdk/resourcemanager/cdn/armcdn/resourceusage_client.go index 93b5737f82ff..fb3bf5c13630 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_resourceusage_client.go +++ b/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go @@ -5,6 +5,7 @@ // 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 @@ -55,8 +56,7 @@ func NewResourceUsageClient(subscriptionID string, credential azcore.TokenCreden } // NewListPager - Check the quota and actual usage of the CDN profiles under the given subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // options - ResourceUsageClientListOptions contains the optional parameters for the ResourceUsageClient.List method. func (client *ResourceUsageClient) NewListPager(options *ResourceUsageClientListOptions) *runtime.Pager[ResourceUsageClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ResourceUsageClientListResponse]{ @@ -98,7 +98,7 @@ func (client *ResourceUsageClient) listCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_response_types.go b/sdk/resourcemanager/cdn/armcdn/response_types.go similarity index 95% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_response_types.go rename to sdk/resourcemanager/cdn/armcdn/response_types.go index ae22b74644c9..f4592fa1cd37 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_response_types.go +++ b/sdk/resourcemanager/cdn/armcdn/response_types.go @@ -5,6 +5,7 @@ // 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 @@ -143,6 +144,16 @@ type AFDProfilesClientListResourceUsageResponse struct { UsagesListResult } +// AFDProfilesClientUpgradeResponse contains the response from method AFDProfilesClient.Upgrade. +type AFDProfilesClientUpgradeResponse struct { + Profile +} + +// AFDProfilesClientValidateSecretResponse contains the response from method AFDProfilesClient.ValidateSecret. +type AFDProfilesClientValidateSecretResponse struct { + ValidateSecretOutput +} + // CustomDomainsClientCreateResponse contains the response from method CustomDomainsClient.Create. type CustomDomainsClientCreateResponse struct { CustomDomain @@ -368,6 +379,11 @@ type PoliciesClientUpdateResponse struct { WebApplicationFirewallPolicy } +// ProfilesClientCanMigrateResponse contains the response from method ProfilesClient.CanMigrate. +type ProfilesClientCanMigrateResponse struct { + CanMigrateResult +} + // ProfilesClientCreateResponse contains the response from method ProfilesClient.Create. type ProfilesClientCreateResponse struct { Profile @@ -408,6 +424,16 @@ type ProfilesClientListSupportedOptimizationTypesResponse struct { SupportedOptimizationTypesListResult } +// ProfilesClientMigrateResponse contains the response from method ProfilesClient.Migrate. +type ProfilesClientMigrateResponse struct { + MigrateResult +} + +// ProfilesClientMigrationCommitResponse contains the response from method ProfilesClient.MigrationCommit. +type ProfilesClientMigrationCommitResponse struct { + // placeholder for future response values +} + // ProfilesClientUpdateResponse contains the response from method ProfilesClient.Update. type ProfilesClientUpdateResponse struct { Profile @@ -537,8 +563,3 @@ type SecurityPoliciesClientListByProfileResponse struct { type SecurityPoliciesClientPatchResponse struct { SecurityPolicy } - -// ValidateClientSecretResponse contains the response from method ValidateClient.Secret. -type ValidateClientSecretResponse struct { - ValidateSecretOutput -} diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_routes_client.go b/sdk/resourcemanager/cdn/armcdn/routes_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_routes_client.go rename to sdk/resourcemanager/cdn/armcdn/routes_client.go index 2b8899924c5d..f54b7cc518cd 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_routes_client.go +++ b/sdk/resourcemanager/cdn/armcdn/routes_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ func NewRoutesClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreate - Creates a new route with the specified route name under the specified subscription, resource group, profile, // and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -82,7 +83,7 @@ func (client *RoutesClient) BeginCreate(ctx context.Context, resourceGroupName s // Create - Creates a new route with the specified route name under the specified subscription, resource group, profile, and // AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *RoutesClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, route Route, options *RoutesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, routeName, route, options) if err != nil { @@ -126,7 +127,7 @@ func (client *RoutesClient) createCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, route) @@ -135,7 +136,7 @@ func (client *RoutesClient) createCreateRequest(ctx context.Context, resourceGro // BeginDelete - Deletes an existing route with the specified route name under the specified subscription, resource group, // profile, and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -159,7 +160,7 @@ func (client *RoutesClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes an existing route with the specified route name under the specified subscription, resource group, profile, // and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *RoutesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, options *RoutesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, routeName, options) if err != nil { @@ -203,7 +204,7 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +213,7 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets an existing route with the specified route name under the specified subscription, resource group, profile, and // AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -262,7 +263,7 @@ func (client *RoutesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,8 +279,7 @@ func (client *RoutesClient) getHandleResponse(resp *http.Response) (RoutesClient } // NewListByEndpointPager - Lists all of the existing origins within a profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -337,7 +337,7 @@ func (client *RoutesClient) listByEndpointCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -355,7 +355,7 @@ func (client *RoutesClient) listByEndpointHandleResponse(resp *http.Response) (R // BeginUpdate - Updates an existing route with the specified route name under the specified subscription, resource group, // profile, and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -380,7 +380,7 @@ func (client *RoutesClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates an existing route with the specified route name under the specified subscription, resource group, profile, // and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *RoutesClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, routeUpdateProperties RouteUpdateParameters, options *RoutesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties, options) if err != nil { @@ -424,7 +424,7 @@ func (client *RoutesClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, routeUpdateProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_rules_client.go b/sdk/resourcemanager/cdn/armcdn/rules_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_rules_client.go rename to sdk/resourcemanager/cdn/armcdn/rules_client.go index 4bb27c961aef..8f8fa8d3d0d7 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_rules_client.go +++ b/sdk/resourcemanager/cdn/armcdn/rules_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewRulesClient(subscriptionID string, credential azcore.TokenCredential, op // BeginCreate - Creates a new delivery rule within the specified rule set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -80,7 +81,7 @@ func (client *RulesClient) BeginCreate(ctx context.Context, resourceGroupName st // Create - Creates a new delivery rule within the specified rule set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *RulesClient) create(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, rule Rule, options *RulesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, ruleName, rule, options) if err != nil { @@ -124,7 +125,7 @@ func (client *RulesClient) createCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, rule) @@ -132,7 +133,7 @@ func (client *RulesClient) createCreateRequest(ctx context.Context, resourceGrou // BeginDelete - Deletes an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -155,7 +156,7 @@ func (client *RulesClient) BeginDelete(ctx context.Context, resourceGroupName st // Delete - Deletes an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *RulesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, options *RulesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, ruleName, options) if err != nil { @@ -199,7 +200,7 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +208,7 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -257,7 +258,7 @@ func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,8 +274,7 @@ func (client *RulesClient) getHandleResponse(resp *http.Response) (RulesClientGe } // NewListByRuleSetPager - Lists all of the existing delivery rules within a rule set. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -332,7 +332,7 @@ func (client *RulesClient) listByRuleSetCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,7 @@ func (client *RulesClient) listByRuleSetHandleResponse(resp *http.Response) (Rul // BeginUpdate - Updates an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -373,7 +373,7 @@ func (client *RulesClient) BeginUpdate(ctx context.Context, resourceGroupName st // Update - Updates an existing delivery rule within a rule set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *RulesClient) update(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, ruleUpdateProperties RuleUpdateParameters, options *RulesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties, options) if err != nil { @@ -417,7 +417,7 @@ func (client *RulesClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, ruleUpdateProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_rulesets_client.go b/sdk/resourcemanager/cdn/armcdn/rulesets_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_rulesets_client.go rename to sdk/resourcemanager/cdn/armcdn/rulesets_client.go index f613467885d1..ba7f208ee67c 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_rulesets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/rulesets_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewRuleSetsClient(subscriptionID string, credential azcore.TokenCredential, // Create - Creates a new rule set within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -101,7 +102,7 @@ func (client *RuleSetsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +120,7 @@ func (client *RuleSetsClient) createHandleResponse(resp *http.Response) (RuleSet // BeginDelete - Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -142,7 +143,7 @@ func (client *RuleSetsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *RuleSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, options) if err != nil { @@ -182,7 +183,7 @@ func (client *RuleSetsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +192,7 @@ func (client *RuleSetsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets an existing AzureFrontDoor rule set with the specified rule set name under the specified subscription, resource // group and profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -236,7 +237,7 @@ func (client *RuleSetsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,8 +253,7 @@ func (client *RuleSetsClient) getHandleResponse(resp *http.Response) (RuleSetsCl } // NewListByProfilePager - Lists existing AzureFrontDoor rule sets within a profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -306,7 +306,7 @@ func (client *RuleSetsClient) listByProfileCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,10 +321,8 @@ func (client *RuleSetsClient) listByProfileHandleResponse(resp *http.Response) ( return result, nil } -// NewListResourceUsagePager - Checks the quota and actual usage of the given AzureFrontDoor rule set under the given CDN -// profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -383,7 +381,7 @@ func (client *RuleSetsClient) listResourceUsageCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_secrets_client.go b/sdk/resourcemanager/cdn/armcdn/secrets_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_secrets_client.go rename to sdk/resourcemanager/cdn/armcdn/secrets_client.go index ca0d2f28c4ff..a6936dc0bf6e 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_secrets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/secrets_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewSecretsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new Secret within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -79,7 +80,7 @@ func (client *SecretsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new Secret within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *SecretsClient) create(ctx context.Context, resourceGroupName string, profileName string, secretName string, secret Secret, options *SecretsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, secretName, secret, options) if err != nil { @@ -119,7 +120,7 @@ func (client *SecretsClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, secret) @@ -127,7 +128,7 @@ func (client *SecretsClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes an existing Secret within profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -149,7 +150,7 @@ func (client *SecretsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes an existing Secret within profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *SecretsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, secretName string, options *SecretsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, secretName, options) if err != nil { @@ -189,7 +190,7 @@ func (client *SecretsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +198,7 @@ func (client *SecretsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets an existing Secret within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -242,7 +243,7 @@ func (client *SecretsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,8 +259,7 @@ func (client *SecretsClient) getHandleResponse(resp *http.Response) (SecretsClie } // NewListByProfilePager - Lists existing AzureFrontDoor secrets. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -312,7 +312,7 @@ func (client *SecretsClient) listByProfileCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_securitypolicies_client.go b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go similarity index 96% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_securitypolicies_client.go rename to sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go index 54f3e76f70b3..57f448997ed8 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_securitypolicies_client.go +++ b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go @@ -5,6 +5,7 @@ // 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 @@ -56,7 +57,7 @@ func NewSecurityPoliciesClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Creates a new security policy within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -80,7 +81,7 @@ func (client *SecurityPoliciesClient) BeginCreate(ctx context.Context, resourceG // Create - Creates a new security policy within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *SecurityPoliciesClient) create(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicy SecurityPolicy, options *SecurityPoliciesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, securityPolicyName, securityPolicy, options) if err != nil { @@ -120,7 +121,7 @@ func (client *SecurityPoliciesClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, securityPolicy) @@ -128,7 +129,7 @@ func (client *SecurityPoliciesClient) createCreateRequest(ctx context.Context, r // BeginDelete - Deletes an existing security policy within profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -151,7 +152,7 @@ func (client *SecurityPoliciesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes an existing security policy within profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *SecurityPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, options *SecurityPoliciesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, securityPolicyName, options) if err != nil { @@ -191,7 +192,7 @@ func (client *SecurityPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +200,7 @@ func (client *SecurityPoliciesClient) deleteCreateRequest(ctx context.Context, r // Get - Gets an existing security policy within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -244,7 +245,7 @@ func (client *SecurityPoliciesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,8 +261,7 @@ func (client *SecurityPoliciesClient) getHandleResponse(resp *http.Response) (Se } // NewListByProfilePager - Lists security policies associated with the profile -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -315,7 +315,7 @@ func (client *SecurityPoliciesClient) listByProfileCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +332,7 @@ func (client *SecurityPoliciesClient) listByProfileHandleResponse(resp *http.Res // BeginPatch - Updates an existing security policy within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -356,7 +356,7 @@ func (client *SecurityPoliciesClient) BeginPatch(ctx context.Context, resourceGr // Patch - Updates an existing security policy within a profile. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2022-11-01-preview func (client *SecurityPoliciesClient) patch(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicyUpdateProperties SecurityPolicyUpdateParameters, options *SecurityPoliciesClientBeginPatchOptions) (*http.Response, error) { req, err := client.patchCreateRequest(ctx, resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties, options) if err != nil { @@ -396,7 +396,7 @@ func (client *SecurityPoliciesClient) patchCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, securityPolicyUpdateProperties) diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_time_rfc3339.go b/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/cdn/armcdn/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/cdn/armcdn/time_rfc3339.go index 21e0a3761231..a7f252a5a301 100644 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go @@ -5,6 +5,7 @@ // 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 diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdcustomdomains_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdcustomdomains_client_test.go deleted file mode 100644 index af28e4be796e..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdcustomdomains_client_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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProfilePager("RG", - "profile1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "domain1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/ze_generated_example_afdendpoints_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdendpoints_client_test.go deleted file mode 100644 index b16587de77e5..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdendpoints_client_test.go +++ /dev/null @@ -1,244 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProfilePager("RG", - "profile1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "endpoint1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListResourceUsagePager("RG", - "profile1", - "endpoint1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdorigingroups_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdorigingroups_client_test.go deleted file mode 100644 index a3d8ce167a98..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdorigingroups_client_test.go +++ /dev/null @@ -1,205 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProfilePager("RG", - "profile1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "origingroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListResourceUsagePager("RG", - "profile1", - "origingroup1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdorigins_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdorigins_client_test.go deleted file mode 100644 index fd542facdcba..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdorigins_client_test.go +++ /dev/null @@ -1,168 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByOriginGroupPager("RG", - "profile1", - "origingroup1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "origingroup1", - "origin1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/ze_generated_example_afdprofiles_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdprofiles_client_test.go deleted file mode 100644 index 877a679611eb..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_afdprofiles_client_test.go +++ /dev/null @@ -1,69 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListResourceUsagePager("RG", - "profile1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewAFDProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_cdnmanagementclient_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_cdnmanagementclient_client_test.go deleted file mode 100644 index 3af33e1c3e96..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_cdnmanagementclient_client_test.go +++ /dev/null @@ -1,115 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewManagementClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewManagementClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewManagementClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewManagementClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_customdomains_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_customdomains_client_test.go deleted file mode 100644 index 2dd79c8c88ca..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_customdomains_client_test.go +++ /dev/null @@ -1,128 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByEndpointPager("RG", - "profile1", - "endpoint1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "endpoint1", - "www-someDomain-net", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewCustomDomainsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_edgenodes_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_edgenodes_client_test.go deleted file mode 100644 index 23d821d0be10..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_edgenodes_client_test.go +++ /dev/null @@ -1,41 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEdgeNodesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_endpoints_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_endpoints_client_test.go deleted file mode 100644 index 2f83af3bd702..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_endpoints_client_test.go +++ /dev/null @@ -1,432 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProfilePager("RG", - "profile1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "endpoint1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListResourceUsagePager("RG", - "profile1", - "endpoint1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_loganalytics_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_loganalytics_client_test.go deleted file mode 100644 index 550f0a57a032..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_loganalytics_client_test.go +++ /dev/null @@ -1,191 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewLogAnalyticsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewLogAnalyticsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewLogAnalyticsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetLogAnalyticsLocations(ctx, - "RG", - "profile1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewLogAnalyticsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetLogAnalyticsResources(ctx, - "RG", - "profile1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewLogAnalyticsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewLogAnalyticsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_managedrulesets_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_managedrulesets_client_test.go deleted file mode 100644 index 4ce2995a17ee..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_managedrulesets_client_test.go +++ /dev/null @@ -1,41 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewManagedRuleSetsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_operations_client_test.go deleted file mode 100644 index 6ed60601473d..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_origingroups_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_origingroups_client_test.go deleted file mode 100644 index ffe2d8610c24..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_origingroups_client_test.go +++ /dev/null @@ -1,183 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByEndpointPager("RG", - "profile1", - "endpoint1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "endpoint1", - "originGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginGroupsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/ze_generated_example_origins_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_origins_client_test.go deleted file mode 100644 index 787905acf086..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_origins_client_test.go +++ /dev/null @@ -1,176 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByEndpointPager("RG", - "profile1", - "endpoint1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "endpoint1", - "www-someDomain-net", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewOriginsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/ze_generated_example_policies_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_policies_client_test.go deleted file mode 100644 index 618bafa47151..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_policies_client_test.go +++ /dev/null @@ -1,236 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "MicrosoftCdnWafPolicy", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "Policy1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_profiles_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_profiles_client_test.go deleted file mode 100644 index 134c563a7763..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_profiles_client_test.go +++ /dev/null @@ -1,224 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("RG", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSupportedOptimizationTypes(ctx, - "RG", - "profile1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewProfilesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListResourceUsagePager("RG", - "profile1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_resourceusage_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_resourceusage_client_test.go deleted file mode 100644 index 8f76960fba3a..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_resourceusage_client_test.go +++ /dev/null @@ -1,41 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewResourceUsageClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_routes_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_routes_client_test.go deleted file mode 100644 index d7d3fbd2ecf8..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_routes_client_test.go +++ /dev/null @@ -1,218 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRoutesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByEndpointPager("RG", - "profile1", - "endpoint1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRoutesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "endpoint1", - "route1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRoutesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRoutesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRoutesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/ze_generated_example_rules_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_rules_client_test.go deleted file mode 100644 index 18f2f11c9393..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_rules_client_test.go +++ /dev/null @@ -1,192 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRulesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByRuleSetPager("RG", - "profile1", - "ruleSet1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRulesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "ruleSet1", - "rule1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRulesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRulesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRulesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/ze_generated_example_rulesets_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_rulesets_client_test.go deleted file mode 100644 index 697a7db0612e..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_rulesets_client_test.go +++ /dev/null @@ -1,141 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRuleSetsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProfilePager("RG", - "profile1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRuleSetsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "ruleSet1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRuleSetsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "RG", - "profile1", - "ruleSet1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRuleSetsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewRuleSetsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListResourceUsagePager("RG", - "profile1", - "ruleSet1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_secrets_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_secrets_client_test.go deleted file mode 100644 index 02b205b8bfe1..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_secrets_client_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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewSecretsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProfilePager("RG", - "profile1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewSecretsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "secret1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewSecretsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewSecretsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/ze_generated_example_securitypolicies_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_securitypolicies_client_test.go deleted file mode 100644 index 0e31b2a50229..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_securitypolicies_client_test.go +++ /dev/null @@ -1,190 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewSecurityPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProfilePager("RG", - "profile1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewSecurityPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "RG", - "profile1", - "securityPolicy1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewSecurityPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewSecurityPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-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() - client, err := armcdn.NewSecurityPoliciesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "RG", - "profile1", - "securityPolicy1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_validate_client_test.go b/sdk/resourcemanager/cdn/armcdn/ze_generated_example_validate_client_test.go deleted file mode 100644 index 80315061d09c..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/ze_generated_example_validate_client_test.go +++ /dev/null @@ -1,44 +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. - -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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Validate_Secret.json -func ExampleValidateClient_Secret() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcdn.NewValidateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Secret(ctx, - 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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_models_serde.go b/sdk/resourcemanager/cdn/armcdn/zz_generated_models_serde.go deleted file mode 100644 index a7f55fca87e4..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_models_serde.go +++ /dev/null @@ -1,2351 +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. - -package armcdn - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AFDDomainUpdateParameters. -func (a AFDDomainUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AFDEndpoint. -func (a AFDEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AFDEndpointUpdateParameters. -func (a AFDEndpointUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AFDOriginGroupUpdateParameters. -func (a AFDOriginGroupUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AFDOriginUpdateParameters. -func (a AFDOriginUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AfdPurgeParameters. -func (a AfdPurgeParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentPaths", a.ContentPaths) - populate(objectMap, "domains", a.Domains) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AzureFirstPartyManagedCertificateParameters. -func (a AzureFirstPartyManagedCertificateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["type"] = SecretTypeAzureFirstPartyManagedCertificate - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFirstPartyManagedCertificateParameters. -func (a *AzureFirstPartyManagedCertificateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ClientPortMatchConditionParameters. -func (c ClientPortMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", c.MatchValues) - populate(objectMap, "negateCondition", c.NegateCondition) - populate(objectMap, "operator", c.Operator) - populate(objectMap, "transforms", c.Transforms) - populate(objectMap, "typeName", c.TypeName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems. -func (c *Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dateTime": - err = unpopulateTimeRFC3339(val, "DateTime", &c.DateTime) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems. -func (c *Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dateTime": - err = unpopulateTimeRFC3339(val, "DateTime", &c.DateTime) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CompressionSettings. -func (c CompressionSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentTypesToCompress", c.ContentTypesToCompress) - populate(objectMap, "isCompressionEnabled", c.IsCompressionEnabled) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CookiesMatchConditionParameters. -func (c CookiesMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", c.MatchValues) - populate(objectMap, "negateCondition", c.NegateCondition) - populate(objectMap, "operator", c.Operator) - populate(objectMap, "selector", c.Selector) - populate(objectMap, "transforms", c.Transforms) - populate(objectMap, "typeName", c.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CustomDomainProperties. -func (c CustomDomainProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customHttpsParameters", c.CustomHTTPSParameters) - populate(objectMap, "customHttpsProvisioningState", c.CustomHTTPSProvisioningState) - populate(objectMap, "customHttpsProvisioningSubstate", c.CustomHTTPSProvisioningSubstate) - populate(objectMap, "hostName", c.HostName) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "resourceState", c.ResourceState) - populate(objectMap, "validationData", c.ValidationData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainProperties. -func (c *CustomDomainProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customHttpsParameters": - c.CustomHTTPSParameters, err = unmarshalCustomDomainHTTPSParametersClassification(val) - delete(rawMsg, key) - case "customHttpsProvisioningState": - err = unpopulate(val, "CustomHTTPSProvisioningState", &c.CustomHTTPSProvisioningState) - delete(rawMsg, key) - case "customHttpsProvisioningSubstate": - err = unpopulate(val, "CustomHTTPSProvisioningSubstate", &c.CustomHTTPSProvisioningSubstate) - delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &c.HostName) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "resourceState": - err = unpopulate(val, "ResourceState", &c.ResourceState) - delete(rawMsg, key) - case "validationData": - err = unpopulate(val, "ValidationData", &c.ValidationData) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomRule. -func (c CustomRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", c.Action) - populate(objectMap, "enabledState", c.EnabledState) - populate(objectMap, "matchConditions", c.MatchConditions) - populate(objectMap, "name", c.Name) - populate(objectMap, "priority", c.Priority) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CustomRuleList. -func (c CustomRuleList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "rules", c.Rules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CustomerCertificateParameters. -func (c CustomerCertificateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "certificateAuthority", c.CertificateAuthority) - populate(objectMap, "expirationDate", c.ExpirationDate) - populate(objectMap, "secretSource", c.SecretSource) - populate(objectMap, "secretVersion", c.SecretVersion) - populate(objectMap, "subject", c.Subject) - populate(objectMap, "subjectAlternativeNames", c.SubjectAlternativeNames) - populate(objectMap, "thumbprint", c.Thumbprint) - objectMap["type"] = SecretTypeCustomerCertificate - populate(objectMap, "useLatestVersion", c.UseLatestVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomerCertificateParameters. -func (c *CustomerCertificateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateAuthority": - err = unpopulate(val, "CertificateAuthority", &c.CertificateAuthority) - delete(rawMsg, key) - case "expirationDate": - err = unpopulate(val, "ExpirationDate", &c.ExpirationDate) - delete(rawMsg, key) - case "secretSource": - err = unpopulate(val, "SecretSource", &c.SecretSource) - delete(rawMsg, key) - case "secretVersion": - err = unpopulate(val, "SecretVersion", &c.SecretVersion) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &c.Subject) - delete(rawMsg, key) - case "subjectAlternativeNames": - err = unpopulate(val, "SubjectAlternativeNames", &c.SubjectAlternativeNames) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - case "useLatestVersion": - err = unpopulate(val, "UseLatestVersion", &c.UseLatestVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeepCreatedOriginGroupProperties. -func (d DeepCreatedOriginGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "healthProbeSettings", d.HealthProbeSettings) - populate(objectMap, "origins", d.Origins) - populate(objectMap, "responseBasedOriginErrorDetectionSettings", d.ResponseBasedOriginErrorDetectionSettings) - populate(objectMap, "trafficRestorationTimeToHealedOrNewEndpointsInMinutes", d.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRule. -func (d DeliveryRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actions", d.Actions) - populate(objectMap, "conditions", d.Conditions) - populate(objectMap, "name", d.Name) - populate(objectMap, "order", d.Order) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRule. -func (d *DeliveryRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actions": - d.Actions, err = unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(val) - delete(rawMsg, key) - case "conditions": - d.Conditions, err = unmarshalDeliveryRuleConditionClassificationArray(val) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &d.Order) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCacheExpirationAction. -func (d DeliveryRuleCacheExpirationAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = DeliveryRuleActionCacheExpiration - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleCacheExpirationAction. -func (d *DeliveryRuleCacheExpirationAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCacheKeyQueryStringAction. -func (d DeliveryRuleCacheKeyQueryStringAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = DeliveryRuleActionCacheKeyQueryString - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleCacheKeyQueryStringAction. -func (d *DeliveryRuleCacheKeyQueryStringAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleClientPortCondition. -func (d DeliveryRuleClientPortCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableClientPort - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleClientPortCondition. -func (d *DeliveryRuleClientPortCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleCookiesCondition. -func (d DeliveryRuleCookiesCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableCookies - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleCookiesCondition. -func (d *DeliveryRuleCookiesCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleHTTPVersionCondition. -func (d DeliveryRuleHTTPVersionCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableHTTPVersion - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleHTTPVersionCondition. -func (d *DeliveryRuleHTTPVersionCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleHostNameCondition. -func (d DeliveryRuleHostNameCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableHostName - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleHostNameCondition. -func (d *DeliveryRuleHostNameCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleIsDeviceCondition. -func (d DeliveryRuleIsDeviceCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableIsDevice - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleIsDeviceCondition. -func (d *DeliveryRuleIsDeviceCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRulePostArgsCondition. -func (d DeliveryRulePostArgsCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariablePostArgs - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRulePostArgsCondition. -func (d *DeliveryRulePostArgsCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleQueryStringCondition. -func (d DeliveryRuleQueryStringCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableQueryString - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleQueryStringCondition. -func (d *DeliveryRuleQueryStringCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRemoteAddressCondition. -func (d DeliveryRuleRemoteAddressCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableRemoteAddress - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRemoteAddressCondition. -func (d *DeliveryRuleRemoteAddressCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestBodyCondition. -func (d DeliveryRuleRequestBodyCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableRequestBody - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestBodyCondition. -func (d *DeliveryRuleRequestBodyCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestHeaderAction. -func (d DeliveryRuleRequestHeaderAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = DeliveryRuleActionModifyRequestHeader - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestHeaderAction. -func (d *DeliveryRuleRequestHeaderAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestHeaderCondition. -func (d DeliveryRuleRequestHeaderCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableRequestHeader - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestHeaderCondition. -func (d *DeliveryRuleRequestHeaderCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestMethodCondition. -func (d DeliveryRuleRequestMethodCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableRequestMethod - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestMethodCondition. -func (d *DeliveryRuleRequestMethodCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestSchemeCondition. -func (d DeliveryRuleRequestSchemeCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableRequestScheme - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestSchemeCondition. -func (d *DeliveryRuleRequestSchemeCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRequestURICondition. -func (d DeliveryRuleRequestURICondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableRequestURI - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRequestURICondition. -func (d *DeliveryRuleRequestURICondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleResponseHeaderAction. -func (d DeliveryRuleResponseHeaderAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = DeliveryRuleActionModifyResponseHeader - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleResponseHeaderAction. -func (d *DeliveryRuleResponseHeaderAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleRouteConfigurationOverrideAction. -func (d DeliveryRuleRouteConfigurationOverrideAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = DeliveryRuleActionRouteConfigurationOverride - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleRouteConfigurationOverrideAction. -func (d *DeliveryRuleRouteConfigurationOverrideAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleSSLProtocolCondition. -func (d DeliveryRuleSSLProtocolCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableSSLProtocol - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleSSLProtocolCondition. -func (d *DeliveryRuleSSLProtocolCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleServerPortCondition. -func (d DeliveryRuleServerPortCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableServerPort - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleServerPortCondition. -func (d *DeliveryRuleServerPortCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleSocketAddrCondition. -func (d DeliveryRuleSocketAddrCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableSocketAddr - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleSocketAddrCondition. -func (d *DeliveryRuleSocketAddrCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleURLFileExtensionCondition. -func (d DeliveryRuleURLFileExtensionCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableURLFileExtension - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleURLFileExtensionCondition. -func (d *DeliveryRuleURLFileExtensionCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleURLFileNameCondition. -func (d DeliveryRuleURLFileNameCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableURLFileName - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleURLFileNameCondition. -func (d *DeliveryRuleURLFileNameCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DeliveryRuleURLPathCondition. -func (d DeliveryRuleURLPathCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = MatchVariableURLPath - populate(objectMap, "parameters", d.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryRuleURLPathCondition. -func (d *DeliveryRuleURLPathCondition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &d.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EdgeNodeProperties. -func (e EdgeNodeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ipAddressGroups", e.IPAddressGroups) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Endpoint. -func (e Endpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EndpointProperties. -func (e EndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentTypesToCompress", e.ContentTypesToCompress) - populate(objectMap, "customDomains", e.CustomDomains) - populate(objectMap, "defaultOriginGroup", e.DefaultOriginGroup) - populate(objectMap, "deliveryPolicy", e.DeliveryPolicy) - populate(objectMap, "geoFilters", e.GeoFilters) - populate(objectMap, "hostName", e.HostName) - populate(objectMap, "isCompressionEnabled", e.IsCompressionEnabled) - populate(objectMap, "isHttpAllowed", e.IsHTTPAllowed) - populate(objectMap, "isHttpsAllowed", e.IsHTTPSAllowed) - populate(objectMap, "optimizationType", e.OptimizationType) - populate(objectMap, "originGroups", e.OriginGroups) - populate(objectMap, "originHostHeader", e.OriginHostHeader) - populate(objectMap, "originPath", e.OriginPath) - populate(objectMap, "origins", e.Origins) - populate(objectMap, "probePath", e.ProbePath) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "queryStringCachingBehavior", e.QueryStringCachingBehavior) - populate(objectMap, "resourceState", e.ResourceState) - populate(objectMap, "urlSigningKeys", e.URLSigningKeys) - populate(objectMap, "webApplicationFirewallPolicyLink", e.WebApplicationFirewallPolicyLink) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesUpdateParameters. -func (e EndpointPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentTypesToCompress", e.ContentTypesToCompress) - populate(objectMap, "defaultOriginGroup", e.DefaultOriginGroup) - populate(objectMap, "deliveryPolicy", e.DeliveryPolicy) - populate(objectMap, "geoFilters", e.GeoFilters) - populate(objectMap, "isCompressionEnabled", e.IsCompressionEnabled) - populate(objectMap, "isHttpAllowed", e.IsHTTPAllowed) - populate(objectMap, "isHttpsAllowed", e.IsHTTPSAllowed) - populate(objectMap, "optimizationType", e.OptimizationType) - populate(objectMap, "originHostHeader", e.OriginHostHeader) - populate(objectMap, "originPath", e.OriginPath) - populate(objectMap, "probePath", e.ProbePath) - populate(objectMap, "queryStringCachingBehavior", e.QueryStringCachingBehavior) - populate(objectMap, "urlSigningKeys", e.URLSigningKeys) - populate(objectMap, "webApplicationFirewallPolicyLink", e.WebApplicationFirewallPolicyLink) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesUpdateParametersDeliveryPolicy. -func (e EndpointPropertiesUpdateParametersDeliveryPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", e.Description) - populate(objectMap, "rules", e.Rules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EndpointUpdateParameters. -func (e EndpointUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "tags", e.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GeoFilter. -func (g GeoFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", g.Action) - populate(objectMap, "countryCodes", g.CountryCodes) - populate(objectMap, "relativePath", g.RelativePath) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPVersionMatchConditionParameters. -func (h HTTPVersionMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", h.MatchValues) - populate(objectMap, "negateCondition", h.NegateCondition) - populate(objectMap, "operator", h.Operator) - populate(objectMap, "transforms", h.Transforms) - populate(objectMap, "typeName", h.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type HostNameMatchConditionParameters. -func (h HostNameMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", h.MatchValues) - populate(objectMap, "negateCondition", h.NegateCondition) - populate(objectMap, "operator", h.Operator) - populate(objectMap, "transforms", h.Transforms) - populate(objectMap, "typeName", h.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IPAddressGroup. -func (i IPAddressGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "deliveryRegion", i.DeliveryRegion) - populate(objectMap, "ipv4Addresses", i.IPv4Addresses) - populate(objectMap, "ipv6Addresses", i.IPv6Addresses) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IsDeviceMatchConditionParameters. -func (i IsDeviceMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", i.MatchValues) - populate(objectMap, "negateCondition", i.NegateCondition) - populate(objectMap, "operator", i.Operator) - populate(objectMap, "transforms", i.Transforms) - populate(objectMap, "typeName", i.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LoadParameters. -func (l LoadParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentPaths", l.ContentPaths) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedCertificateParameters. -func (m ManagedCertificateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "expirationDate", m.ExpirationDate) - populate(objectMap, "subject", m.Subject) - objectMap["type"] = SecretTypeManagedCertificate - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificateParameters. -func (m *ManagedCertificateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "expirationDate": - err = unpopulate(val, "ExpirationDate", &m.ExpirationDate) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &m.Subject) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedHTTPSParameters. -func (m ManagedHTTPSParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["certificateSource"] = CertificateSourceCdn - populate(objectMap, "certificateSourceParameters", m.CertificateSourceParameters) - populate(objectMap, "minimumTlsVersion", m.MinimumTLSVersion) - populate(objectMap, "protocolType", m.ProtocolType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedHTTPSParameters. -func (m *ManagedHTTPSParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateSource": - err = unpopulate(val, "CertificateSource", &m.CertificateSource) - delete(rawMsg, key) - case "certificateSourceParameters": - err = unpopulate(val, "CertificateSourceParameters", &m.CertificateSourceParameters) - delete(rawMsg, key) - case "minimumTlsVersion": - err = unpopulate(val, "MinimumTLSVersion", &m.MinimumTLSVersion) - delete(rawMsg, key) - case "protocolType": - err = unpopulate(val, "ProtocolType", &m.ProtocolType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedRuleGroupDefinition. -func (m ManagedRuleGroupDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", m.Description) - populate(objectMap, "ruleGroupName", m.RuleGroupName) - populate(objectMap, "rules", m.Rules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedRuleGroupOverride. -func (m ManagedRuleGroupOverride) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ruleGroupName", m.RuleGroupName) - populate(objectMap, "rules", m.Rules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSet. -func (m ManagedRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "anomalyScore", m.AnomalyScore) - populate(objectMap, "ruleGroupOverrides", m.RuleGroupOverrides) - populate(objectMap, "ruleSetType", m.RuleSetType) - populate(objectMap, "ruleSetVersion", m.RuleSetVersion) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSetDefinitionProperties. -func (m ManagedRuleSetDefinitionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "ruleGroups", m.RuleGroups) - populate(objectMap, "ruleSetType", m.RuleSetType) - populate(objectMap, "ruleSetVersion", m.RuleSetVersion) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedRuleSetList. -func (m ManagedRuleSetList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "managedRuleSets", m.ManagedRuleSets) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MatchCondition. -func (m MatchCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValue", m.MatchValue) - populate(objectMap, "matchVariable", m.MatchVariable) - populate(objectMap, "negateCondition", m.NegateCondition) - populate(objectMap, "operator", m.Operator) - populate(objectMap, "selector", m.Selector) - populate(objectMap, "transforms", m.Transforms) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricsResponse. -func (m *MetricsResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dateTimeBegin": - err = unpopulateTimeRFC3339(val, "DateTimeBegin", &m.DateTimeBegin) - delete(rawMsg, key) - case "dateTimeEnd": - err = unpopulateTimeRFC3339(val, "DateTimeEnd", &m.DateTimeEnd) - delete(rawMsg, key) - case "granularity": - err = unpopulate(val, "Granularity", &m.Granularity) - delete(rawMsg, key) - case "series": - err = unpopulate(val, "Series", &m.Series) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OriginGroupOverrideAction. -func (o OriginGroupOverrideAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = DeliveryRuleActionOriginGroupOverride - populate(objectMap, "parameters", o.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OriginGroupOverrideAction. -func (o *OriginGroupOverrideAction) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &o.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OriginGroupProperties. -func (o OriginGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "healthProbeSettings", o.HealthProbeSettings) - populate(objectMap, "origins", o.Origins) - populate(objectMap, "provisioningState", o.ProvisioningState) - populate(objectMap, "resourceState", o.ResourceState) - populate(objectMap, "responseBasedOriginErrorDetectionSettings", o.ResponseBasedOriginErrorDetectionSettings) - populate(objectMap, "trafficRestorationTimeToHealedOrNewEndpointsInMinutes", o.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OriginGroupUpdateParameters. -func (o OriginGroupUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OriginGroupUpdatePropertiesParameters. -func (o OriginGroupUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "healthProbeSettings", o.HealthProbeSettings) - populate(objectMap, "origins", o.Origins) - populate(objectMap, "responseBasedOriginErrorDetectionSettings", o.ResponseBasedOriginErrorDetectionSettings) - populate(objectMap, "trafficRestorationTimeToHealedOrNewEndpointsInMinutes", o.TrafficRestorationTimeToHealedOrNewEndpointsInMinutes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OriginUpdateParameters. -func (o OriginUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PostArgsMatchConditionParameters. -func (p PostArgsMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", p.MatchValues) - populate(objectMap, "negateCondition", p.NegateCondition) - populate(objectMap, "operator", p.Operator) - populate(objectMap, "selector", p.Selector) - populate(objectMap, "transforms", p.Transforms) - populate(objectMap, "typeName", p.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Profile. -func (p Profile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "kind", p.Kind) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "sku", p.SKU) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProfileUpdateParameters. -func (p ProfileUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PurgeParameters. -func (p PurgeParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentPaths", p.ContentPaths) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type QueryStringMatchConditionParameters. -func (q QueryStringMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", q.MatchValues) - populate(objectMap, "negateCondition", q.NegateCondition) - populate(objectMap, "operator", q.Operator) - populate(objectMap, "transforms", q.Transforms) - populate(objectMap, "typeName", q.TypeName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RankingsResponse. -func (r *RankingsResponse) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dateTimeBegin": - err = unpopulateTimeRFC3339(val, "DateTimeBegin", &r.DateTimeBegin) - delete(rawMsg, key) - case "dateTimeEnd": - err = unpopulateTimeRFC3339(val, "DateTimeEnd", &r.DateTimeEnd) - delete(rawMsg, key) - case "tables": - err = unpopulate(val, "Tables", &r.Tables) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RateLimitRule. -func (r RateLimitRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "action", r.Action) - populate(objectMap, "enabledState", r.EnabledState) - populate(objectMap, "matchConditions", r.MatchConditions) - populate(objectMap, "name", r.Name) - populate(objectMap, "priority", r.Priority) - populate(objectMap, "rateLimitDurationInMinutes", r.RateLimitDurationInMinutes) - populate(objectMap, "rateLimitThreshold", r.RateLimitThreshold) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RateLimitRuleList. -func (r RateLimitRuleList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "rules", r.Rules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RemoteAddressMatchConditionParameters. -func (r RemoteAddressMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", r.MatchValues) - populate(objectMap, "negateCondition", r.NegateCondition) - populate(objectMap, "operator", r.Operator) - populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RequestBodyMatchConditionParameters. -func (r RequestBodyMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", r.MatchValues) - populate(objectMap, "negateCondition", r.NegateCondition) - populate(objectMap, "operator", r.Operator) - populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RequestHeaderMatchConditionParameters. -func (r RequestHeaderMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", r.MatchValues) - populate(objectMap, "negateCondition", r.NegateCondition) - populate(objectMap, "operator", r.Operator) - populate(objectMap, "selector", r.Selector) - populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RequestMethodMatchConditionParameters. -func (r RequestMethodMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", r.MatchValues) - populate(objectMap, "negateCondition", r.NegateCondition) - populate(objectMap, "operator", r.Operator) - populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RequestSchemeMatchConditionParameters. -func (r RequestSchemeMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", r.MatchValues) - populate(objectMap, "negateCondition", r.NegateCondition) - populate(objectMap, "operator", r.Operator) - populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RequestURIMatchConditionParameters. -func (r RequestURIMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", r.MatchValues) - populate(objectMap, "negateCondition", r.NegateCondition) - populate(objectMap, "operator", r.Operator) - populate(objectMap, "transforms", r.Transforms) - populate(objectMap, "typeName", r.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ResponseBasedOriginErrorDetectionParameters. -func (r ResponseBasedOriginErrorDetectionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "httpErrorRanges", r.HTTPErrorRanges) - populate(objectMap, "responseBasedDetectedErrorTypes", r.ResponseBasedDetectedErrorTypes) - populate(objectMap, "responseBasedFailoverThresholdPercentage", r.ResponseBasedFailoverThresholdPercentage) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RouteProperties. -func (r RouteProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cacheConfiguration", r.CacheConfiguration) - populate(objectMap, "customDomains", r.CustomDomains) - populate(objectMap, "deploymentStatus", r.DeploymentStatus) - populate(objectMap, "enabledState", r.EnabledState) - populate(objectMap, "endpointName", r.EndpointName) - populate(objectMap, "forwardingProtocol", r.ForwardingProtocol) - populate(objectMap, "httpsRedirect", r.HTTPSRedirect) - populate(objectMap, "linkToDefaultDomain", r.LinkToDefaultDomain) - populate(objectMap, "originGroup", r.OriginGroup) - populate(objectMap, "originPath", r.OriginPath) - populate(objectMap, "patternsToMatch", r.PatternsToMatch) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "ruleSets", r.RuleSets) - populate(objectMap, "supportedProtocols", r.SupportedProtocols) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RouteUpdateParameters. -func (r RouteUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", r.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RouteUpdatePropertiesParameters. -func (r RouteUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cacheConfiguration", r.CacheConfiguration) - populate(objectMap, "customDomains", r.CustomDomains) - populate(objectMap, "enabledState", r.EnabledState) - populate(objectMap, "endpointName", r.EndpointName) - populate(objectMap, "forwardingProtocol", r.ForwardingProtocol) - populate(objectMap, "httpsRedirect", r.HTTPSRedirect) - populate(objectMap, "linkToDefaultDomain", r.LinkToDefaultDomain) - populate(objectMap, "originGroup", r.OriginGroup) - populate(objectMap, "originPath", r.OriginPath) - populate(objectMap, "patternsToMatch", r.PatternsToMatch) - populate(objectMap, "ruleSets", r.RuleSets) - populate(objectMap, "supportedProtocols", r.SupportedProtocols) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RuleProperties. -func (r RuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actions", r.Actions) - populate(objectMap, "conditions", r.Conditions) - populate(objectMap, "deploymentStatus", r.DeploymentStatus) - populate(objectMap, "matchProcessingBehavior", r.MatchProcessingBehavior) - populate(objectMap, "order", r.Order) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "ruleSetName", r.RuleSetName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RuleProperties. -func (r *RuleProperties) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actions": - r.Actions, err = unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(val) - delete(rawMsg, key) - case "conditions": - r.Conditions, err = unmarshalDeliveryRuleConditionClassificationArray(val) - delete(rawMsg, key) - case "deploymentStatus": - err = unpopulate(val, "DeploymentStatus", &r.DeploymentStatus) - delete(rawMsg, key) - case "matchProcessingBehavior": - err = unpopulate(val, "MatchProcessingBehavior", &r.MatchProcessingBehavior) - delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &r.Order) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "ruleSetName": - err = unpopulate(val, "RuleSetName", &r.RuleSetName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RuleUpdateParameters. -func (r RuleUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", r.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RuleUpdatePropertiesParameters. -func (r RuleUpdatePropertiesParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actions", r.Actions) - populate(objectMap, "conditions", r.Conditions) - populate(objectMap, "matchProcessingBehavior", r.MatchProcessingBehavior) - populate(objectMap, "order", r.Order) - populate(objectMap, "ruleSetName", r.RuleSetName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RuleUpdatePropertiesParameters. -func (r *RuleUpdatePropertiesParameters) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actions": - r.Actions, err = unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(val) - delete(rawMsg, key) - case "conditions": - r.Conditions, err = unmarshalDeliveryRuleConditionClassificationArray(val) - delete(rawMsg, key) - case "matchProcessingBehavior": - err = unpopulate(val, "MatchProcessingBehavior", &r.MatchProcessingBehavior) - delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &r.Order) - delete(rawMsg, key) - case "ruleSetName": - err = unpopulate(val, "RuleSetName", &r.RuleSetName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SSLProtocolMatchConditionParameters. -func (s SSLProtocolMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", s.MatchValues) - populate(objectMap, "negateCondition", s.NegateCondition) - populate(objectMap, "operator", s.Operator) - populate(objectMap, "transforms", s.Transforms) - populate(objectMap, "typeName", s.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SecretProperties. -func (s SecretProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "deploymentStatus", s.DeploymentStatus) - populate(objectMap, "parameters", s.Parameters) - populate(objectMap, "profileName", s.ProfileName) - populate(objectMap, "provisioningState", s.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretProperties. -func (s *SecretProperties) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deploymentStatus": - err = unpopulate(val, "DeploymentStatus", &s.DeploymentStatus) - delete(rawMsg, key) - case "parameters": - s.Parameters, err = unmarshalSecretParametersClassification(val) - delete(rawMsg, key) - case "profileName": - err = unpopulate(val, "ProfileName", &s.ProfileName) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyProperties. -func (s SecurityPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "deploymentStatus", s.DeploymentStatus) - populate(objectMap, "parameters", s.Parameters) - populate(objectMap, "profileName", s.ProfileName) - populate(objectMap, "provisioningState", s.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyProperties. -func (s *SecurityPolicyProperties) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "deploymentStatus": - err = unpopulate(val, "DeploymentStatus", &s.DeploymentStatus) - delete(rawMsg, key) - case "parameters": - s.Parameters, err = unmarshalSecurityPolicyPropertiesParametersClassification(val) - delete(rawMsg, key) - case "profileName": - err = unpopulate(val, "ProfileName", &s.ProfileName) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyUpdateParameters. -func (s SecurityPolicyUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyUpdateProperties. -func (s SecurityPolicyUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "parameters", s.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyUpdateProperties. -func (s *SecurityPolicyUpdateProperties) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "parameters": - s.Parameters, err = unmarshalSecurityPolicyPropertiesParametersClassification(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyWebApplicationFirewallAssociation. -func (s SecurityPolicyWebApplicationFirewallAssociation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "domains", s.Domains) - populate(objectMap, "patternsToMatch", s.PatternsToMatch) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityPolicyWebApplicationFirewallParameters. -func (s SecurityPolicyWebApplicationFirewallParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "associations", s.Associations) - objectMap["type"] = SecurityPolicyTypeWebApplicationFirewall - populate(objectMap, "wafPolicy", s.WafPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPolicyWebApplicationFirewallParameters. -func (s *SecurityPolicyWebApplicationFirewallParameters) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "associations": - err = unpopulate(val, "Associations", &s.Associations) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - case "wafPolicy": - err = unpopulate(val, "WafPolicy", &s.WafPolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServerPortMatchConditionParameters. -func (s ServerPortMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", s.MatchValues) - populate(objectMap, "negateCondition", s.NegateCondition) - populate(objectMap, "operator", s.Operator) - populate(objectMap, "transforms", s.Transforms) - populate(objectMap, "typeName", s.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SocketAddrMatchConditionParameters. -func (s SocketAddrMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", s.MatchValues) - populate(objectMap, "negateCondition", s.NegateCondition) - populate(objectMap, "operator", s.Operator) - populate(objectMap, "transforms", s.Transforms) - populate(objectMap, "typeName", s.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type URLFileExtensionMatchConditionParameters. -func (u URLFileExtensionMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", u.MatchValues) - populate(objectMap, "negateCondition", u.NegateCondition) - populate(objectMap, "operator", u.Operator) - populate(objectMap, "transforms", u.Transforms) - populate(objectMap, "typeName", u.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type URLFileNameMatchConditionParameters. -func (u URLFileNameMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", u.MatchValues) - populate(objectMap, "negateCondition", u.NegateCondition) - populate(objectMap, "operator", u.Operator) - populate(objectMap, "transforms", u.Transforms) - populate(objectMap, "typeName", u.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type URLPathMatchConditionParameters. -func (u URLPathMatchConditionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchValues", u.MatchValues) - populate(objectMap, "negateCondition", u.NegateCondition) - populate(objectMap, "operator", u.Operator) - populate(objectMap, "transforms", u.Transforms) - populate(objectMap, "typeName", u.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type URLRedirectAction. -func (u URLRedirectAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = DeliveryRuleActionURLRedirect - populate(objectMap, "parameters", u.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type URLRedirectAction. -func (u *URLRedirectAction) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &u.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type URLRewriteAction. -func (u URLRewriteAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = DeliveryRuleActionURLRewrite - populate(objectMap, "parameters", u.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type URLRewriteAction. -func (u *URLRewriteAction) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &u.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type URLSigningAction. -func (u URLSigningAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["name"] = DeliveryRuleActionURLSigning - populate(objectMap, "parameters", u.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type URLSigningAction. -func (u *URLSigningAction) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &u.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &u.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type URLSigningActionParameters. -func (u URLSigningActionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "algorithm", u.Algorithm) - populate(objectMap, "parameterNameOverride", u.ParameterNameOverride) - populate(objectMap, "typeName", u.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type URLSigningKeyParameters. -func (u URLSigningKeyParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "keyId", u.KeyID) - populate(objectMap, "secretSource", u.SecretSource) - populate(objectMap, "secretVersion", u.SecretVersion) - objectMap["type"] = SecretTypeURLSigningKey - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type URLSigningKeyParameters. -func (u *URLSigningKeyParameters) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyId": - err = unpopulate(val, "KeyID", &u.KeyID) - delete(rawMsg, key) - case "secretSource": - err = unpopulate(val, "SecretSource", &u.SecretSource) - delete(rawMsg, key) - case "secretVersion": - err = unpopulate(val, "SecretVersion", &u.SecretVersion) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &u.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserManagedHTTPSParameters. -func (u UserManagedHTTPSParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["certificateSource"] = CertificateSourceAzureKeyVault - populate(objectMap, "certificateSourceParameters", u.CertificateSourceParameters) - populate(objectMap, "minimumTlsVersion", u.MinimumTLSVersion) - populate(objectMap, "protocolType", u.ProtocolType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserManagedHTTPSParameters. -func (u *UserManagedHTTPSParameters) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "certificateSource": - err = unpopulate(val, "CertificateSource", &u.CertificateSource) - delete(rawMsg, key) - case "certificateSourceParameters": - err = unpopulate(val, "CertificateSourceParameters", &u.CertificateSourceParameters) - delete(rawMsg, key) - case "minimumTlsVersion": - err = unpopulate(val, "MinimumTLSVersion", &u.MinimumTLSVersion) - delete(rawMsg, key) - case "protocolType": - err = unpopulate(val, "ProtocolType", &u.ProtocolType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WafMetricsResponse. -func (w *WafMetricsResponse) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dateTimeBegin": - err = unpopulateTimeRFC3339(val, "DateTimeBegin", &w.DateTimeBegin) - delete(rawMsg, key) - case "dateTimeEnd": - err = unpopulateTimeRFC3339(val, "DateTimeEnd", &w.DateTimeEnd) - delete(rawMsg, key) - case "granularity": - err = unpopulate(val, "Granularity", &w.Granularity) - delete(rawMsg, key) - case "series": - err = unpopulate(val, "Series", &w.Series) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WafRankingsResponse. -func (w *WafRankingsResponse) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "data": - err = unpopulate(val, "Data", &w.Data) - delete(rawMsg, key) - case "dateTimeBegin": - err = unpopulateTimeRFC3339(val, "DateTimeBegin", &w.DateTimeBegin) - delete(rawMsg, key) - case "dateTimeEnd": - err = unpopulateTimeRFC3339(val, "DateTimeEnd", &w.DateTimeEnd) - delete(rawMsg, key) - case "groups": - err = unpopulate(val, "Groups", &w.Groups) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicy. -func (w WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", w.Etag) - populate(objectMap, "id", w.ID) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "sku", w.SKU) - populate(objectMap, "systemData", w.SystemData) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicyPatchParameters. -func (w WebApplicationFirewallPolicyPatchParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", w.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WebApplicationFirewallPolicyProperties. -func (w WebApplicationFirewallPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customRules", w.CustomRules) - populate(objectMap, "endpointLinks", w.EndpointLinks) - populate(objectMap, "managedRules", w.ManagedRules) - populate(objectMap, "policySettings", w.PolicySettings) - populate(objectMap, "provisioningState", w.ProvisioningState) - populate(objectMap, "rateLimitRules", w.RateLimitRules) - populate(objectMap, "resourceState", w.ResourceState) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -} diff --git a/sdk/resourcemanager/cdn/armcdn/zz_generated_validate_client.go b/sdk/resourcemanager/cdn/armcdn/zz_generated_validate_client.go deleted file mode 100644 index a67ad72def83..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/zz_generated_validate_client.go +++ /dev/null @@ -1,102 +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. - -package armcdn - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ValidateClient contains the methods for the Validate group. -// Don't use this type directly, use NewValidateClient() instead. -type ValidateClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewValidateClient creates a new instance of ValidateClient with the specified values. -// subscriptionID - Azure Subscription ID. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewValidateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ValidateClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ValidateClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Secret - Validate a Secret in the profile. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 -// validateSecretInput - The Secret source. -// options - ValidateClientSecretOptions contains the optional parameters for the ValidateClient.Secret method. -func (client *ValidateClient) Secret(ctx context.Context, validateSecretInput ValidateSecretInput, options *ValidateClientSecretOptions) (ValidateClientSecretResponse, error) { - req, err := client.secretCreateRequest(ctx, validateSecretInput, options) - if err != nil { - return ValidateClientSecretResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ValidateClientSecretResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ValidateClientSecretResponse{}, runtime.NewResponseError(resp) - } - return client.secretHandleResponse(resp) -} - -// secretCreateRequest creates the Secret request. -func (client *ValidateClient) secretCreateRequest(ctx context.Context, validateSecretInput ValidateSecretInput, options *ValidateClientSecretOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/validateSecret" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, validateSecretInput) -} - -// secretHandleResponse handles the Secret response. -func (client *ValidateClient) secretHandleResponse(resp *http.Response) (ValidateClientSecretResponse, error) { - result := ValidateClientSecretResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ValidateSecretOutput); err != nil { - return ValidateClientSecretResponse{}, err - } - return result, nil -}