From f2d428ad2135a1b16cd6ad7fefe69914eefc88f5 Mon Sep 17 00:00:00 2001 From: ReleaseHelper Date: Mon, 9 Oct 2023 01:09:23 +0000 Subject: [PATCH 1/2] [Release] sdk/resourcemanager/cdn/armcdn/2.0.0 generation from spec commit: 7b551033155a63739b6d28f79b9c07569f6179b8 --- sdk/resourcemanager/cdn/armcdn/CHANGELOG.md | 55 ++ .../cdn/armcdn/afdcustomdomains_client.go | 112 ++- .../afdcustomdomains_client_example_test.go | 14 +- .../cdn/armcdn/afdendpoints_client.go | 144 +-- .../afdendpoints_client_example_test.go | 18 +- .../cdn/armcdn/afdorigingroups_client.go | 96 +- .../afdorigingroups_client_example_test.go | 14 +- .../cdn/armcdn/afdorigins_client.go | 89 +- .../armcdn/afdorigins_client_example_test.go | 12 +- .../cdn/armcdn/afdprofiles_client.go | 245 ++++- .../armcdn/afdprofiles_client_example_test.go | 116 ++- .../cdn/armcdn/afdx_live_test.go | 2 +- sdk/resourcemanager/cdn/armcdn/autorest.md | 7 +- .../cdn/armcdn/cdn_live_test.go | 2 +- .../cdn/armcdn/client_factory.go | 78 +- sdk/resourcemanager/cdn/armcdn/constants.go | 167 ++-- .../cdn/armcdn/customdomains_client.go | 174 ++-- .../customdomains_client_example_test.go | 87 +- .../cdn/armcdn/edgenodes_client.go | 7 +- .../armcdn/edgenodes_client_example_test.go | 4 +- .../cdn/armcdn/endpoints_client.go | 199 ++-- .../armcdn/endpoints_client_example_test.go | 32 +- sdk/resourcemanager/cdn/armcdn/go.mod | 10 +- sdk/resourcemanager/cdn/armcdn/go.sum | 16 +- sdk/resourcemanager/cdn/armcdn/interfaces.go | 61 ++ .../cdn/armcdn/loganalytics_client.go | 93 +- .../loganalytics_client_example_test.go | 22 +- .../cdn/armcdn/managedrulesets_client.go | 7 +- .../managedrulesets_client_example_test.go | 4 +- .../cdn/armcdn/management_client.go | 83 +- .../armcdn/management_client_example_test.go | 10 +- sdk/resourcemanager/cdn/armcdn/models.go | 885 ++++-------------- .../cdn/armcdn/models_serde.go | 505 +++++++++- .../cdn/armcdn/operations_client.go | 7 +- .../armcdn/operations_client_example_test.go | 4 +- sdk/resourcemanager/cdn/armcdn/options.go | 664 +++++++++++++ .../cdn/armcdn/origingroups_client.go | 89 +- .../origingroups_client_example_test.go | 12 +- .../cdn/armcdn/origins_client.go | 89 +- .../cdn/armcdn/origins_client_example_test.go | 12 +- .../cdn/armcdn/policies_client.go | 82 +- .../armcdn/policies_client_example_test.go | 12 +- .../cdn/armcdn/polymorphic_helpers.go | 28 +- .../cdn/armcdn/profiles_client.go | 335 ++++++- .../armcdn/profiles_client_example_test.go | 118 ++- .../cdn/armcdn/resourceusage_client.go | 7 +- .../resourceusage_client_example_test.go | 4 +- .../cdn/armcdn/response_types.go | 158 +++- .../cdn/armcdn/routes_client.go | 89 +- .../cdn/armcdn/routes_client_example_test.go | 12 +- .../cdn/armcdn/rules_client.go | 89 +- .../cdn/armcdn/rules_client_example_test.go | 12 +- .../cdn/armcdn/rulesets_client.go | 63 +- .../armcdn/rulesets_client_example_test.go | 12 +- .../cdn/armcdn/secrets_client.go | 65 +- .../cdn/armcdn/secrets_client_example_test.go | 10 +- .../cdn/armcdn/securitypolicies_client.go | 89 +- .../securitypolicies_client_example_test.go | 12 +- .../cdn/armcdn/time_rfc3339.go | 3 +- .../cdn/armcdn/validate_client.go | 93 -- .../armcdn/validate_client_example_test.go | 47 - 61 files changed, 3725 insertions(+), 1862 deletions(-) create mode 100644 sdk/resourcemanager/cdn/armcdn/interfaces.go create mode 100644 sdk/resourcemanager/cdn/armcdn/options.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/validate_client.go delete mode 100644 sdk/resourcemanager/cdn/armcdn/validate_client_example_test.go diff --git a/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md b/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md index 2336cde1b867..b69d10a60f37 100644 --- a/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md +++ b/sdk/resourcemanager/cdn/armcdn/CHANGELOG.md @@ -1,5 +1,60 @@ # Release History +## 2.0.0 (2023-10-27) +### Breaking Changes + +- Type of `EndpointProperties.CustomDomains` has been changed from `[]*CustomDomain` to `[]*DeepCreatedCustomDomain` +- Type of `MetricsResponse.Granularity` has been changed from `*MetricsResponseGranularity` to `*MetricsGranularity` +- Type of `MetricsResponseSeriesItem.Unit` has been changed from `*MetricsResponseSeriesItemUnit` to `*MetricsSeriesUnit` +- Type of `WafMetricsResponse.Granularity` has been changed from `*WafMetricsResponseGranularity` to `*WafMetricsGranularity` +- Type of `WafMetricsResponseSeriesItem.Unit` has been changed from `*WafMetricsResponseSeriesItemUnit` to `*WafMetricsSeriesUnit` +- Enum `MetricsResponseGranularity` has been removed +- Enum `MetricsResponseSeriesItemUnit` has been removed +- Enum `WafMetricsResponseGranularity` has been removed +- Enum `WafMetricsResponseSeriesItemUnit` has been removed +- Function `*ClientFactory.NewValidateClient` has been removed +- Function `NewValidateClient` has been removed +- Function `*ValidateClient.Secret` has been removed +- Operation `*CustomDomainsClient.DisableCustomHTTPS` has been changed to LRO, use `*CustomDomainsClient.BeginDisableCustomHTTPS` instead. +- Operation `*CustomDomainsClient.EnableCustomHTTPS` has been changed to LRO, use `*CustomDomainsClient.BeginEnableCustomHTTPS` instead. + +### Features Added + +- New value `ProfileResourceStateAbortingMigration`, `ProfileResourceStateCommittingMigration`, `ProfileResourceStateMigrated`, `ProfileResourceStateMigrating`, `ProfileResourceStatePendingMigrationCommit` added to enum type `ProfileResourceState` +- New enum type `CanMigrateDefaultSKU` with values `CanMigrateDefaultSKUPremiumAzureFrontDoor`, `CanMigrateDefaultSKUStandardAzureFrontDoor` +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` +- New enum type `MetricsGranularity` with values `MetricsGranularityP1D`, `MetricsGranularityPT1H`, `MetricsGranularityPT5M` +- New enum type `MetricsSeriesUnit` with values `MetricsSeriesUnitBitsPerSecond`, `MetricsSeriesUnitBytes`, `MetricsSeriesUnitCount`, `MetricsSeriesUnitMilliSeconds` +- New enum type `WafMetricsGranularity` with values `WafMetricsGranularityP1D`, `WafMetricsGranularityPT1H`, `WafMetricsGranularityPT5M` +- New enum type `WafMetricsSeriesUnit` with values `WafMetricsSeriesUnitCount` +- New function `*AFDProfilesClient.CheckEndpointNameAvailability(context.Context, string, string, CheckEndpointNameAvailabilityInput, *AFDProfilesClientCheckEndpointNameAvailabilityOptions) (AFDProfilesClientCheckEndpointNameAvailabilityResponse, error)` +- New function `*AFDProfilesClient.BeginUpgrade(context.Context, string, string, ProfileUpgradeParameters, *AFDProfilesClientBeginUpgradeOptions) (*runtime.Poller[AFDProfilesClientUpgradeResponse], error)` +- New function `*AFDProfilesClient.ValidateSecret(context.Context, string, string, ValidateSecretInput, *AFDProfilesClientValidateSecretOptions) (AFDProfilesClientValidateSecretResponse, error)` +- New function `*ProfilesClient.BeginCanMigrate(context.Context, string, CanMigrateParameters, *ProfilesClientBeginCanMigrateOptions) (*runtime.Poller[ProfilesClientCanMigrateResponse], error)` +- New function `*ProfilesClient.BeginMigrate(context.Context, string, MigrationParameters, *ProfilesClientBeginMigrateOptions) (*runtime.Poller[ProfilesClientMigrateResponse], error)` +- New function `*ProfilesClient.BeginMigrationCommit(context.Context, string, string, *ProfilesClientBeginMigrationCommitOptions) (*runtime.Poller[ProfilesClientMigrationCommitResponse], error)` +- New struct `CanMigrateParameters` +- New struct `CanMigrateProperties` +- New struct `CanMigrateResult` +- New struct `DeepCreatedCustomDomain` +- New struct `DeepCreatedCustomDomainProperties` +- New struct `ManagedServiceIdentity` +- New struct `MigrateResult` +- New struct `MigrateResultProperties` +- New struct `MigrationErrorType` +- New struct `MigrationParameters` +- New struct `MigrationWebApplicationFirewallMapping` +- New struct `ProfileChangeSKUWafMapping` +- New struct `ProfileUpgradeParameters` +- New struct `UserAssignedIdentity` +- New field `ExtendedProperties` in struct `AFDDomainProperties` +- New field `CertificateAuthority`, `ExpirationDate`, `SecretSource`, `Subject`, `SubjectAlternativeNames`, `Thumbprint` in struct `AzureFirstPartyManagedCertificateParameters` +- New field `Identity` in struct `Profile` +- New field `ExtendedProperties` in struct `ProfileProperties` +- New field `Identity` in struct `ProfileUpdateParameters` +- New field `ExtendedProperties` in struct `WebApplicationFirewallPolicyProperties` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go index 60eac4aacac5..a6355ab908c6 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewAFDCustomDomainsClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Creates a new domain within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -61,9 +60,10 @@ func (client *AFDCustomDomainsClient) BeginCreate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDCustomDomainsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDCustomDomainsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDCustomDomainsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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 2023-05-01 func (client *AFDCustomDomainsClient) create(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomain AFDDomain, options *AFDCustomDomainsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, customDomainName, customDomain, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -112,17 +114,20 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, customDomain) + if err := runtime.MarshalAsJSON(req, customDomain); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -135,9 +140,10 @@ func (client *AFDCustomDomainsClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDCustomDomainsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDCustomDomainsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDCustomDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -147,20 +153,22 @@ func (client *AFDCustomDomainsClient) BeginDelete(ctx context.Context, resourceG // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *AFDCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, customDomainName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -187,7 +195,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,25 +205,28 @@ func (client *AFDCustomDomainsClient) deleteCreateRequest(ctx context.Context, r // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. // - customDomainName - Name of the domain under the profile which is unique globally. // - options - AFDCustomDomainsClientGetOptions contains the optional parameters for the AFDCustomDomainsClient.Get method. func (client *AFDCustomDomainsClient) Get(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientGetOptions) (AFDCustomDomainsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, customDomainName, options) if err != nil { return AFDCustomDomainsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AFDCustomDomainsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AFDCustomDomainsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AFDCustomDomainsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -242,7 +253,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,10 +270,10 @@ func (client *AFDCustomDomainsClient) getHandleResponse(resp *http.Response) (AF // NewListByProfilePager - Lists existing AzureFrontDoor domains. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile 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.NewListByProfilePager // method. func (client *AFDCustomDomainsClient) NewListByProfilePager(resourceGroupName string, profileName string, options *AFDCustomDomainsClientListByProfileOptions) *runtime.Pager[AFDCustomDomainsClientListByProfileResponse] { @@ -313,7 +324,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +342,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -344,9 +355,10 @@ func (client *AFDCustomDomainsClient) BeginRefreshValidationToken(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDCustomDomainsClientRefreshValidationTokenResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDCustomDomainsClientRefreshValidationTokenResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDCustomDomainsClientRefreshValidationTokenResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -355,20 +367,22 @@ 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 2023-05-01 func (client *AFDCustomDomainsClient) refreshValidationToken(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, options *AFDCustomDomainsClientBeginRefreshValidationTokenOptions) (*http.Response, error) { + var err error req, err := client.refreshValidationTokenCreateRequest(ctx, resourceGroupName, profileName, customDomainName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // refreshValidationTokenCreateRequest creates the RefreshValidationToken request. @@ -395,7 +409,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -404,7 +418,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -418,9 +432,10 @@ func (client *AFDCustomDomainsClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDCustomDomainsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDCustomDomainsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDCustomDomainsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -429,20 +444,22 @@ 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 2023-05-01 func (client *AFDCustomDomainsClient) update(ctx context.Context, resourceGroupName string, profileName string, customDomainName string, customDomainUpdateProperties AFDDomainUpdateParameters, options *AFDCustomDomainsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, customDomainName, customDomainUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -469,8 +486,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, customDomainUpdateProperties) + if err := runtime.MarshalAsJSON(req, customDomainUpdateProperties); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client_example_test.go index c0b2f309bd47..adb2dad28df0 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/afdcustomdomains_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDCustomDomains_ListByProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDCustomDomains_ListByProfile.json func ExampleAFDCustomDomainsClient_NewListByProfilePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +75,7 @@ func ExampleAFDCustomDomainsClient_NewListByProfilePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDCustomDomains_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDCustomDomains_Get.json func ExampleAFDCustomDomainsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -124,7 +124,7 @@ func ExampleAFDCustomDomainsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDCustomDomains_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDCustomDomains_Create.json func ExampleAFDCustomDomainsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -188,7 +188,7 @@ func ExampleAFDCustomDomainsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDCustomDomains_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDCustomDomains_Update.json func ExampleAFDCustomDomainsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -251,7 +251,7 @@ func ExampleAFDCustomDomainsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDCustomDomains_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDCustomDomains_Delete.json func ExampleAFDCustomDomainsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -272,7 +272,7 @@ func ExampleAFDCustomDomainsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDCustomDomains_RefreshValidationToken.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDCustomDomains_RefreshValidationToken.json func ExampleAFDCustomDomainsClient_BeginRefreshValidationToken() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go index 687ed50bd71a..3d1d592d3d41 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -48,7 +47,7 @@ func NewAFDEndpointsClient(subscriptionID string, credential azcore.TokenCredent // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -62,9 +61,10 @@ func (client *AFDEndpointsClient) BeginCreate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDEndpointsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDEndpointsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDEndpointsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,20 +74,22 @@ func (client *AFDEndpointsClient) BeginCreate(ctx context.Context, resourceGroup // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *AFDEndpointsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint AFDEndpoint, options *AFDEndpointsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, endpoint, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -114,17 +116,20 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, endpoint) + if err := runtime.MarshalAsJSON(req, endpoint); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -137,9 +142,10 @@ func (client *AFDEndpointsClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDEndpointsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDEndpointsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDEndpointsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -149,20 +155,22 @@ func (client *AFDEndpointsClient) BeginDelete(ctx context.Context, resourceGroup // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *AFDEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *AFDEndpointsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -189,7 +197,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,25 +207,28 @@ func (client *AFDEndpointsClient) deleteCreateRequest(ctx context.Context, resou // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - options - AFDEndpointsClientGetOptions contains the optional parameters for the AFDEndpointsClient.Get method. func (client *AFDEndpointsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *AFDEndpointsClientGetOptions) (AFDEndpointsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { return AFDEndpointsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AFDEndpointsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AFDEndpointsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AFDEndpointsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -244,7 +255,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +272,7 @@ func (client *AFDEndpointsClient) getHandleResponse(resp *http.Response) (AFDEnd // NewListByProfilePager - Lists existing AzureFrontDoor endpoints. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -315,7 +326,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,10 +341,9 @@ 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. +// NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -392,7 +402,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -410,7 +420,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -426,9 +436,10 @@ func (client *AFDEndpointsClient) BeginPurgeContent(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDEndpointsClientPurgeContentResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDEndpointsClientPurgeContentResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDEndpointsClientPurgeContentResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -437,20 +448,22 @@ 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 2023-05-01 func (client *AFDEndpointsClient) purgeContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contents AfdPurgeParameters, options *AFDEndpointsClientBeginPurgeContentOptions) (*http.Response, error) { + var err error req, err := client.purgeContentCreateRequest(ctx, resourceGroupName, profileName, endpointName, contents, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // purgeContentCreateRequest creates the PurgeContent request. @@ -477,10 +490,13 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, contents) + if err := runtime.MarshalAsJSON(req, contents); err != nil { + return nil, err + } + return req, nil } // BeginUpdate - Updates an existing AzureFrontDoor endpoint with the specified endpoint name under the specified subscription, @@ -489,7 +505,7 @@ func (client *AFDEndpointsClient) purgeContentCreateRequest(ctx context.Context, // domains, use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -503,9 +519,10 @@ func (client *AFDEndpointsClient) BeginUpdate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDEndpointsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDEndpointsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDEndpointsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -517,20 +534,22 @@ func (client *AFDEndpointsClient) BeginUpdate(ctx context.Context, resourceGroup // domains, use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *AFDEndpointsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties AFDEndpointUpdateParameters, options *AFDEndpointsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, endpointUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -557,17 +576,20 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, endpointUpdateProperties) + if err := runtime.MarshalAsJSON(req, endpointUpdateProperties); err != nil { + return nil, err + } + return req, nil } -// 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -576,18 +598,21 @@ func (client *AFDEndpointsClient) updateCreateRequest(ctx context.Context, resou // - options - AFDEndpointsClientValidateCustomDomainOptions contains the optional parameters for the AFDEndpointsClient.ValidateCustomDomain // method. func (client *AFDEndpointsClient) ValidateCustomDomain(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput, options *AFDEndpointsClientValidateCustomDomainOptions) (AFDEndpointsClientValidateCustomDomainResponse, error) { + var err error req, err := client.validateCustomDomainCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainProperties, options) if err != nil { return AFDEndpointsClientValidateCustomDomainResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AFDEndpointsClientValidateCustomDomainResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AFDEndpointsClientValidateCustomDomainResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AFDEndpointsClientValidateCustomDomainResponse{}, err } - return client.validateCustomDomainHandleResponse(resp) + resp, err := client.validateCustomDomainHandleResponse(httpResp) + return resp, err } // validateCustomDomainCreateRequest creates the ValidateCustomDomain request. @@ -614,10 +639,13 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, customDomainProperties) + if err := runtime.MarshalAsJSON(req, customDomainProperties); err != nil { + return nil, err + } + return req, nil } // validateCustomDomainHandleResponse handles the ValidateCustomDomain response. diff --git a/sdk/resourcemanager/cdn/armcdn/afdendpoints_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client_example_test.go index ac76b476a149..b9af5ebc963b 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdendpoints_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/afdendpoints_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_ListByProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDEndpoints_ListByProfile.json func ExampleAFDEndpointsClient_NewListByProfilePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +61,7 @@ func ExampleAFDEndpointsClient_NewListByProfilePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDEndpoints_Get.json func ExampleAFDEndpointsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleAFDEndpointsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDEndpoints_Create.json func ExampleAFDEndpointsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -142,7 +142,7 @@ func ExampleAFDEndpointsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDEndpoints_Update.json func ExampleAFDEndpointsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -186,7 +186,7 @@ func ExampleAFDEndpointsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDEndpoints_Delete.json func ExampleAFDEndpointsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -207,7 +207,7 @@ func ExampleAFDEndpointsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_PurgeContent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDEndpoints_PurgeContent.json func ExampleAFDEndpointsClient_BeginPurgeContent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -233,7 +233,7 @@ func ExampleAFDEndpointsClient_BeginPurgeContent() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_ListResourceUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDEndpoints_ListResourceUsage.json func ExampleAFDEndpointsClient_NewListResourceUsagePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -271,7 +271,7 @@ func ExampleAFDEndpointsClient_NewListResourceUsagePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_ValidateCustomDomain.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDEndpoints_ValidateCustomDomain.json func ExampleAFDEndpointsClient_ValidateCustomDomain() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go index 8361bb914494..d0fe47ae804c 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewAFDOriginGroupsClient(subscriptionID string, credential azcore.TokenCred // BeginCreate - Creates a new origin group within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -61,9 +60,10 @@ func (client *AFDOriginGroupsClient) BeginCreate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginGroupsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginGroupsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDOriginGroupsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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 2023-05-01 func (client *AFDOriginGroupsClient) create(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroup AFDOriginGroup, options *AFDOriginGroupsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originGroup, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -112,16 +114,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, originGroup) + if err := runtime.MarshalAsJSON(req, originGroup); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -134,9 +139,10 @@ func (client *AFDOriginGroupsClient) BeginDelete(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginGroupsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginGroupsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDOriginGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,20 +151,22 @@ 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 2023-05-01 func (client *AFDOriginGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, options *AFDOriginGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, originGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -185,7 +193,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,25 +202,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. // - originGroupName - Name of the origin group which is unique within the endpoint. // - options - AFDOriginGroupsClientGetOptions contains the optional parameters for the AFDOriginGroupsClient.Get method. func (client *AFDOriginGroupsClient) Get(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, options *AFDOriginGroupsClientGetOptions) (AFDOriginGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, originGroupName, options) if err != nil { return AFDOriginGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AFDOriginGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AFDOriginGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AFDOriginGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -239,7 +250,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +267,7 @@ func (client *AFDOriginGroupsClient) getHandleResponse(resp *http.Response) (AFD // NewListByProfilePager - Lists all of the existing origin groups within a profile. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -310,7 +321,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,10 +336,9 @@ 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. +// NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -387,7 +397,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -405,7 +415,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -419,9 +429,10 @@ func (client *AFDOriginGroupsClient) BeginUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginGroupsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginGroupsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDOriginGroupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -430,20 +441,22 @@ 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 2023-05-01 func (client *AFDOriginGroupsClient) update(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originGroupUpdateProperties AFDOriginGroupUpdateParameters, options *AFDOriginGroupsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originGroupUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -470,8 +483,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, originGroupUpdateProperties) + if err := runtime.MarshalAsJSON(req, originGroupUpdateProperties); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client_example_test.go index 529465176217..c20a0584622a 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigingroups_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOriginGroups_ListByProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOriginGroups_ListByProfile.json func ExampleAFDOriginGroupsClient_NewListByProfilePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExampleAFDOriginGroupsClient_NewListByProfilePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOriginGroups_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOriginGroups_Get.json func ExampleAFDOriginGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -108,7 +108,7 @@ func ExampleAFDOriginGroupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOriginGroups_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOriginGroups_Create.json func ExampleAFDOriginGroupsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -168,7 +168,7 @@ func ExampleAFDOriginGroupsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOriginGroups_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOriginGroups_Update.json func ExampleAFDOriginGroupsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -228,7 +228,7 @@ func ExampleAFDOriginGroupsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOriginGroups_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOriginGroups_Delete.json func ExampleAFDOriginGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -249,7 +249,7 @@ func ExampleAFDOriginGroupsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOriginGroups_ListResourceUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOriginGroups_ListResourceUsage.json func ExampleAFDOriginGroupsClient_NewListResourceUsagePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go b/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go index 3203dc2f9dff..bdf70f687531 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigins_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewAFDOriginsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Creates a new origin within the specified origin group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -61,9 +60,10 @@ func (client *AFDOriginsClient) BeginCreate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDOriginsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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 2023-05-01 func (client *AFDOriginsClient) create(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, origin AFDOrigin, options *AFDOriginsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originName, origin, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -116,16 +118,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, origin) + if err := runtime.MarshalAsJSON(req, origin); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -138,9 +143,10 @@ func (client *AFDOriginsClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDOriginsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -149,20 +155,22 @@ 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 2023-05-01 func (client *AFDOriginsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, options *AFDOriginsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -193,7 +201,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +210,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -210,18 +218,21 @@ func (client *AFDOriginsClient) deleteCreateRequest(ctx context.Context, resourc // - originName - Name of the origin which is unique within the profile. // - options - AFDOriginsClientGetOptions contains the optional parameters for the AFDOriginsClient.Get method. func (client *AFDOriginsClient) Get(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, options *AFDOriginsClientGetOptions) (AFDOriginsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originName, options) if err != nil { return AFDOriginsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AFDOriginsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AFDOriginsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AFDOriginsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -252,7 +263,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +280,7 @@ func (client *AFDOriginsClient) getHandleResponse(resp *http.Response) (AFDOrigi // NewListByOriginGroupPager - Lists all of the existing origins within an origin group. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -328,7 +339,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +357,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -360,9 +371,10 @@ func (client *AFDOriginsClient) BeginUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDOriginsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AFDOriginsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -371,20 +383,22 @@ 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 2023-05-01 func (client *AFDOriginsClient) update(ctx context.Context, resourceGroupName string, profileName string, originGroupName string, originName string, originUpdateProperties AFDOriginUpdateParameters, options *AFDOriginsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, originGroupName, originName, originUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -415,8 +429,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, originUpdateProperties) + if err := runtime.MarshalAsJSON(req, originUpdateProperties); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/afdorigins_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdorigins_client_example_test.go index d88058637167..8c635ee6523f 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdorigins_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/afdorigins_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOrigins_ListByOriginGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOrigins_ListByOriginGroup.json func ExampleAFDOriginsClient_NewListByOriginGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExampleAFDOriginsClient_NewListByOriginGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOrigins_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOrigins_Get.json func ExampleAFDOriginsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleAFDOriginsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOrigins_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOrigins_Create.json func ExampleAFDOriginsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -146,7 +146,7 @@ func ExampleAFDOriginsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOrigins_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOrigins_Update.json func ExampleAFDOriginsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -193,7 +193,7 @@ func ExampleAFDOriginsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDOrigins_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDOrigins_Delete.json func ExampleAFDOriginsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go index 1d1b91f50067..8e53073abef4 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go +++ b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -44,29 +43,99 @@ func NewAFDProfilesClient(subscriptionID string, credential azcore.TokenCredenti return client, nil } -// CheckHostNameAvailability - Check the name availability of a host name. +// CheckEndpointNameAvailability - Check the availability of an afdx endpoint name, and return the globally unique endpoint +// host name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the -// resource group. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. +// - checkEndpointNameAvailabilityInput - Input to check. +// - options - AFDProfilesClientCheckEndpointNameAvailabilityOptions contains the optional parameters for the AFDProfilesClient.CheckEndpointNameAvailability +// method. +func (client *AFDProfilesClient) CheckEndpointNameAvailability(ctx context.Context, resourceGroupName string, profileName string, checkEndpointNameAvailabilityInput CheckEndpointNameAvailabilityInput, options *AFDProfilesClientCheckEndpointNameAvailabilityOptions) (AFDProfilesClientCheckEndpointNameAvailabilityResponse, error) { + var err error + req, err := client.checkEndpointNameAvailabilityCreateRequest(ctx, resourceGroupName, profileName, checkEndpointNameAvailabilityInput, options) + if err != nil { + return AFDProfilesClientCheckEndpointNameAvailabilityResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AFDProfilesClientCheckEndpointNameAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AFDProfilesClientCheckEndpointNameAvailabilityResponse{}, err + } + resp, err := client.checkEndpointNameAvailabilityHandleResponse(httpResp) + return resp, err +} + +// checkEndpointNameAvailabilityCreateRequest creates the CheckEndpointNameAvailability request. +func (client *AFDProfilesClient) checkEndpointNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, profileName string, checkEndpointNameAvailabilityInput CheckEndpointNameAvailabilityInput, options *AFDProfilesClientCheckEndpointNameAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkEndpointNameAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if profileName == "" { + return nil, errors.New("parameter profileName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{profileName}", url.PathEscape(profileName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, checkEndpointNameAvailabilityInput); err != nil { + return nil, err + } + return req, nil +} + +// checkEndpointNameAvailabilityHandleResponse handles the CheckEndpointNameAvailability response. +func (client *AFDProfilesClient) checkEndpointNameAvailabilityHandleResponse(resp *http.Response) (AFDProfilesClientCheckEndpointNameAvailabilityResponse, error) { + result := AFDProfilesClientCheckEndpointNameAvailabilityResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CheckEndpointNameAvailabilityOutput); err != nil { + return AFDProfilesClientCheckEndpointNameAvailabilityResponse{}, err + } + return result, nil +} + +// 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 2023-05-01 +// - resourceGroupName - Name of the Resource group within the Azure subscription. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource +// group. // - checkHostNameAvailabilityInput - Custom domain to be validated. // - options - AFDProfilesClientCheckHostNameAvailabilityOptions contains the optional parameters for the AFDProfilesClient.CheckHostNameAvailability // method. func (client *AFDProfilesClient) CheckHostNameAvailability(ctx context.Context, resourceGroupName string, profileName string, checkHostNameAvailabilityInput CheckHostNameAvailabilityInput, options *AFDProfilesClientCheckHostNameAvailabilityOptions) (AFDProfilesClientCheckHostNameAvailabilityResponse, error) { + var err error req, err := client.checkHostNameAvailabilityCreateRequest(ctx, resourceGroupName, profileName, checkHostNameAvailabilityInput, options) if err != nil { return AFDProfilesClientCheckHostNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AFDProfilesClientCheckHostNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AFDProfilesClientCheckHostNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AFDProfilesClientCheckHostNameAvailabilityResponse{}, err } - return client.checkHostNameAvailabilityHandleResponse(resp) + resp, err := client.checkHostNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkHostNameAvailabilityCreateRequest creates the CheckHostNameAvailability request. @@ -89,10 +158,13 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, checkHostNameAvailabilityInput) + if err := runtime.MarshalAsJSON(req, checkHostNameAvailabilityInput); err != nil { + return nil, err + } + return req, nil } // checkHostNameAvailabilityHandleResponse handles the CheckHostNameAvailability response. @@ -104,12 +176,12 @@ func (client *AFDProfilesClient) checkHostNameAvailabilityHandleResponse(resp *h return result, nil } -// NewListResourceUsagePager - Checks the quota and actual usage of AzureFrontDoor endpoints under the given CDN profile. +// NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. -// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the -// resource group. +// - 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.NewListResourceUsagePager // method. func (client *AFDProfilesClient) NewListResourceUsagePager(resourceGroupName string, profileName string, options *AFDProfilesClientListResourceUsageOptions) *runtime.Pager[AFDProfilesClientListResourceUsageResponse] { @@ -160,7 +232,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,3 +246,142 @@ 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 2023-05-01 +// - resourceGroupName - Name of the Resource group within the Azure subscription. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. +// - profileUpgradeParameters - Profile upgrade input parameter. +// - 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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AFDProfilesClientUpgradeResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[AFDProfilesClientUpgradeResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Upgrade - Upgrade a profile from StandardAzureFrontDoor to PremiumAzureFrontDoor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *AFDProfilesClient) upgrade(ctx context.Context, resourceGroupName string, profileName string, profileUpgradeParameters ProfileUpgradeParameters, options *AFDProfilesClientBeginUpgradeOptions) (*http.Response, error) { + var err error + req, err := client.upgradeCreateRequest(ctx, resourceGroupName, profileName, profileUpgradeParameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, profileUpgradeParameters); err != nil { + return nil, err + } + return req, nil +} + +// ValidateSecret - Validate a Secret in the profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - Name of the Resource group within the Azure subscription. +// - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium which is unique within the resource group. +// - validateSecretInput - The Secret source. +// - 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) { + var err error + req, err := client.validateSecretCreateRequest(ctx, resourceGroupName, profileName, validateSecretInput, options) + if err != nil { + return AFDProfilesClientValidateSecretResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AFDProfilesClientValidateSecretResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AFDProfilesClientValidateSecretResponse{}, err + } + resp, err := client.validateSecretHandleResponse(httpResp) + return resp, err +} + +// 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, validateSecretInput); err != nil { + return nil, err + } + return req, nil +} + +// 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/afdprofiles_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client_example_test.go index cf4d2d698b0e..50a301c7ad5c 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdprofiles_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/afdprofiles_client_example_test.go @@ -15,10 +15,40 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDProfiles_ListResourceUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDProfiles_CheckEndpointNameAvailability.json +func ExampleAFDProfilesClient_CheckEndpointNameAvailability() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcdn.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAFDProfilesClient().CheckEndpointNameAvailability(ctx, "myResourceGroup", "profile1", armcdn.CheckEndpointNameAvailabilityInput{ + Name: to.Ptr("sampleName"), + Type: to.Ptr(armcdn.ResourceTypeMicrosoftCdnProfilesAfdEndpoints), + AutoGeneratedDomainNameLabelScope: to.Ptr(armcdn.AutoGeneratedDomainNameLabelScopeTenantReuse), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CheckEndpointNameAvailabilityOutput = armcdn.CheckEndpointNameAvailabilityOutput{ + // AvailableHostname: to.Ptr(""), + // Message: to.Ptr("Name not available"), + // NameAvailable: to.Ptr(false), + // Reason: to.Ptr("Name is already in use"), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDProfiles_ListResourceUsage.json func ExampleAFDProfilesClient_NewListResourceUsagePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,7 +86,7 @@ func ExampleAFDProfilesClient_NewListResourceUsagePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDProfiles_CheckHostNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDProfiles_CheckHostNameAvailability.json func ExampleAFDProfilesClient_CheckHostNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,3 +112,83 @@ func ExampleAFDProfilesClient_CheckHostNameAvailability() { // Reason: to.Ptr("Conflict"), // } } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDProfiles_ValidateSecret.json +func ExampleAFDProfilesClient_ValidateSecret() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcdn.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAFDProfilesClient().ValidateSecret(ctx, "RG", "profile1", armcdn.ValidateSecretInput{ + SecretSource: &armcdn.ResourceReference{ + ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.KeyVault/vault/kvName/certificate/certName"), + }, + SecretType: to.Ptr(armcdn.SecretTypeCustomerCertificate), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateSecretOutput = armcdn.ValidateSecretOutput{ + // Status: to.Ptr(armcdn.StatusValid), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/AFDProfiles_Upgrade.json +func ExampleAFDProfilesClient_BeginUpgrade() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcdn.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAFDProfilesClient().BeginUpgrade(ctx, "RG", "profile1", armcdn.ProfileUpgradeParameters{ + WafMappingList: []*armcdn.ProfileChangeSKUWafMapping{ + { + ChangeToWafPolicy: &armcdn.ResourceReference{ + ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/waf2"), + }, + SecurityPolicyName: to.Ptr("securityPolicy1"), + }}, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Profile = armcdn.Profile{ + // Name: to.Ptr("profile1"), + // Type: to.Ptr("Microsoft.Cdn/profiles"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"), + // Location: to.Ptr("Global"), + // Tags: map[string]*string{ + // }, + // Kind: to.Ptr("frontdoor"), + // Properties: &armcdn.ProfileProperties{ + // ExtendedProperties: map[string]*string{ + // }, + // FrontDoorID: to.Ptr("id"), + // OriginResponseTimeoutSeconds: to.Ptr[int32](60), + // ProvisioningState: to.Ptr(armcdn.ProfileProvisioningStateSucceeded), + // ResourceState: to.Ptr(armcdn.ProfileResourceState("Enabled")), + // }, + // SKU: &armcdn.SKU{ + // Name: to.Ptr(armcdn.SKUNameStandardAzureFrontDoor), + // }, + // } +} diff --git a/sdk/resourcemanager/cdn/armcdn/afdx_live_test.go b/sdk/resourcemanager/cdn/armcdn/afdx_live_test.go index aae6a9547569..089d897d4b7f 100644 --- a/sdk/resourcemanager/cdn/armcdn/afdx_live_test.go +++ b/sdk/resourcemanager/cdn/armcdn/afdx_live_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cdn/armcdn/autorest.md b/sdk/resourcemanager/cdn/armcdn/autorest.md index e880e960bbc8..fee20f2508f2 100644 --- a/sdk/resourcemanager/cdn/armcdn/autorest.md +++ b/sdk/resourcemanager/cdn/armcdn/autorest.md @@ -5,10 +5,11 @@ ``` 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 +- https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 2.0.0 modelerfour: lenient-model-deduplication: true +tag: package-2023-05 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/cdn/armcdn/cdn_live_test.go b/sdk/resourcemanager/cdn/armcdn/cdn_live_test.go index 4d6d505b0c75..c52fe6da2859 100644 --- a/sdk/resourcemanager/cdn/armcdn/cdn_live_test.go +++ b/sdk/resourcemanager/cdn/armcdn/cdn_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/cdn/armcdn/client_factory.go b/sdk/resourcemanager/cdn/armcdn/client_factory.go index 84b1cc564ebc..c1e449a93042 100644 --- a/sdk/resourcemanager/cdn/armcdn/client_factory.go +++ b/sdk/resourcemanager/cdn/armcdn/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -38,16 +37,6 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewManagementClient() *ManagementClient { - subClient, _ := NewManagementClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewAFDProfilesClient() *AFDProfilesClient { - subClient, _ := NewAFDProfilesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewAFDCustomDomainsClient() *AFDCustomDomainsClient { subClient, _ := NewAFDCustomDomainsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -68,48 +57,48 @@ func (c *ClientFactory) NewAFDOriginsClient() *AFDOriginsClient { return subClient } -func (c *ClientFactory) NewRoutesClient() *RoutesClient { - subClient, _ := NewRoutesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAFDProfilesClient() *AFDProfilesClient { + subClient, _ := NewAFDProfilesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRuleSetsClient() *RuleSetsClient { - subClient, _ := NewRuleSetsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCustomDomainsClient() *CustomDomainsClient { + subClient, _ := NewCustomDomainsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRulesClient() *RulesClient { - subClient, _ := NewRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewEdgeNodesClient() *EdgeNodesClient { + subClient, _ := NewEdgeNodesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewSecurityPoliciesClient() *SecurityPoliciesClient { - subClient, _ := NewSecurityPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewEndpointsClient() *EndpointsClient { + subClient, _ := NewEndpointsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSecretsClient() *SecretsClient { - subClient, _ := NewSecretsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewLogAnalyticsClient() *LogAnalyticsClient { + subClient, _ := NewLogAnalyticsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewValidateClient() *ValidateClient { - subClient, _ := NewValidateClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewManagedRuleSetsClient() *ManagedRuleSetsClient { + subClient, _ := NewManagedRuleSetsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewLogAnalyticsClient() *LogAnalyticsClient { - subClient, _ := NewLogAnalyticsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewManagementClient() *ManagementClient { + subClient, _ := NewManagementClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProfilesClient() *ProfilesClient { - subClient, _ := NewProfilesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewEndpointsClient() *EndpointsClient { - subClient, _ := NewEndpointsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOriginGroupsClient() *OriginGroupsClient { + subClient, _ := NewOriginGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -118,13 +107,13 @@ func (c *ClientFactory) NewOriginsClient() *OriginsClient { return subClient } -func (c *ClientFactory) NewOriginGroupsClient() *OriginGroupsClient { - subClient, _ := NewOriginGroupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPoliciesClient() *PoliciesClient { + subClient, _ := NewPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCustomDomainsClient() *CustomDomainsClient { - subClient, _ := NewCustomDomainsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProfilesClient() *ProfilesClient { + subClient, _ := NewProfilesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -133,22 +122,27 @@ func (c *ClientFactory) NewResourceUsageClient() *ResourceUsageClient { return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewRoutesClient() *RoutesClient { + subClient, _ := NewRoutesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewEdgeNodesClient() *EdgeNodesClient { - subClient, _ := NewEdgeNodesClient(c.credential, c.options) +func (c *ClientFactory) NewRuleSetsClient() *RuleSetsClient { + subClient, _ := NewRuleSetsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPoliciesClient() *PoliciesClient { - subClient, _ := NewPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRulesClient() *RulesClient { + subClient, _ := NewRulesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewManagedRuleSetsClient() *ManagedRuleSetsClient { - subClient, _ := NewManagedRuleSetsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSecretsClient() *SecretsClient { + subClient, _ := NewSecretsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSecurityPoliciesClient() *SecurityPoliciesClient { + subClient, _ := NewSecurityPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/cdn/armcdn/constants.go b/sdk/resourcemanager/cdn/armcdn/constants.go index 90e18a3fba63..ca2ea36f414c 100644 --- a/sdk/resourcemanager/cdn/armcdn/constants.go +++ b/sdk/resourcemanager/cdn/armcdn/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn const ( moduleName = "armcdn" - moduleVersion = "v1.1.1" + moduleVersion = "v2.0.0" ) // AFDEndpointProtocols - Supported protocols for the customer's endpoint. @@ -220,6 +219,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 ( @@ -640,15 +655,15 @@ func PossibleForwardingProtocolValues() []ForwardingProtocol { type GeoFilterActions string const ( - GeoFilterActionsBlock GeoFilterActions = "Block" GeoFilterActionsAllow GeoFilterActions = "Allow" + GeoFilterActionsBlock GeoFilterActions = "Block" ) // PossibleGeoFilterActionsValues returns the possible values for the GeoFilterActions const type. func PossibleGeoFilterActionsValues() []GeoFilterActions { return []GeoFilterActions{ - GeoFilterActionsBlock, GeoFilterActionsAllow, + GeoFilterActionsBlock, } } @@ -731,17 +746,17 @@ func PossibleHeaderActionParametersTypeNameValues() []HeaderActionParametersType type HealthProbeRequestType string const ( - HealthProbeRequestTypeNotSet HealthProbeRequestType = "NotSet" HealthProbeRequestTypeGET HealthProbeRequestType = "GET" HealthProbeRequestTypeHEAD HealthProbeRequestType = "HEAD" + HealthProbeRequestTypeNotSet HealthProbeRequestType = "NotSet" ) // PossibleHealthProbeRequestTypeValues returns the possible values for the HealthProbeRequestType const type. func PossibleHealthProbeRequestTypeValues() []HealthProbeRequestType { return []HealthProbeRequestType{ - HealthProbeRequestTypeNotSet, HealthProbeRequestTypeGET, HealthProbeRequestTypeHEAD, + HealthProbeRequestTypeNotSet, } } @@ -1015,6 +1030,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 @@ -1082,39 +1117,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, } } @@ -1456,17 +1491,17 @@ func PossiblePrivateEndpointStatusValues() []PrivateEndpointStatus { type ProbeProtocol string const ( - ProbeProtocolNotSet ProbeProtocol = "NotSet" ProbeProtocolHTTP ProbeProtocol = "Http" ProbeProtocolHTTPS ProbeProtocol = "Https" + ProbeProtocolNotSet ProbeProtocol = "NotSet" ) // PossibleProbeProtocolValues returns the possible values for the ProbeProtocol const type. func PossibleProbeProtocolValues() []ProbeProtocol { return []ProbeProtocol{ - ProbeProtocolNotSet, ProbeProtocolHTTP, ProbeProtocolHTTPS, + ProbeProtocolNotSet, } } @@ -1496,19 +1531,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, } } @@ -1572,19 +1617,19 @@ func PossibleQueryStringBehaviorValues() []QueryStringBehavior { type QueryStringCachingBehavior string const ( - QueryStringCachingBehaviorIgnoreQueryString QueryStringCachingBehavior = "IgnoreQueryString" QueryStringCachingBehaviorBypassCaching QueryStringCachingBehavior = "BypassCaching" - QueryStringCachingBehaviorUseQueryString QueryStringCachingBehavior = "UseQueryString" + QueryStringCachingBehaviorIgnoreQueryString QueryStringCachingBehavior = "IgnoreQueryString" QueryStringCachingBehaviorNotSet QueryStringCachingBehavior = "NotSet" + QueryStringCachingBehaviorUseQueryString QueryStringCachingBehavior = "UseQueryString" ) // PossibleQueryStringCachingBehaviorValues returns the possible values for the QueryStringCachingBehavior const type. func PossibleQueryStringCachingBehaviorValues() []QueryStringCachingBehavior { return []QueryStringCachingBehavior{ - QueryStringCachingBehaviorIgnoreQueryString, QueryStringCachingBehaviorBypassCaching, - QueryStringCachingBehaviorUseQueryString, + QueryStringCachingBehaviorIgnoreQueryString, QueryStringCachingBehaviorNotSet, + QueryStringCachingBehaviorUseQueryString, } } @@ -1948,16 +1993,16 @@ type ResponseBasedDetectedErrorTypes string const ( ResponseBasedDetectedErrorTypesNone ResponseBasedDetectedErrorTypes = "None" - ResponseBasedDetectedErrorTypesTCPErrorsOnly ResponseBasedDetectedErrorTypes = "TcpErrorsOnly" ResponseBasedDetectedErrorTypesTCPAndHTTPErrors ResponseBasedDetectedErrorTypes = "TcpAndHttpErrors" + ResponseBasedDetectedErrorTypesTCPErrorsOnly ResponseBasedDetectedErrorTypes = "TcpErrorsOnly" ) // PossibleResponseBasedDetectedErrorTypesValues returns the possible values for the ResponseBasedDetectedErrorTypes const type. func PossibleResponseBasedDetectedErrorTypesValues() []ResponseBasedDetectedErrorTypes { return []ResponseBasedDetectedErrorTypes{ ResponseBasedDetectedErrorTypesNone, - ResponseBasedDetectedErrorTypesTCPErrorsOnly, ResponseBasedDetectedErrorTypesTCPAndHTTPErrors, + ResponseBasedDetectedErrorTypesTCPErrorsOnly, } } @@ -2199,20 +2244,20 @@ func PossibleServerPortOperatorValues() []ServerPortOperator { type SharedPrivateLinkResourceStatus string const ( - SharedPrivateLinkResourceStatusPending SharedPrivateLinkResourceStatus = "Pending" SharedPrivateLinkResourceStatusApproved SharedPrivateLinkResourceStatus = "Approved" - SharedPrivateLinkResourceStatusRejected SharedPrivateLinkResourceStatus = "Rejected" SharedPrivateLinkResourceStatusDisconnected SharedPrivateLinkResourceStatus = "Disconnected" + SharedPrivateLinkResourceStatusPending SharedPrivateLinkResourceStatus = "Pending" + SharedPrivateLinkResourceStatusRejected SharedPrivateLinkResourceStatus = "Rejected" SharedPrivateLinkResourceStatusTimeout SharedPrivateLinkResourceStatus = "Timeout" ) // PossibleSharedPrivateLinkResourceStatusValues returns the possible values for the SharedPrivateLinkResourceStatus const type. func PossibleSharedPrivateLinkResourceStatusValues() []SharedPrivateLinkResourceStatus { return []SharedPrivateLinkResourceStatus{ - SharedPrivateLinkResourceStatusPending, SharedPrivateLinkResourceStatusApproved, - SharedPrivateLinkResourceStatusRejected, SharedPrivateLinkResourceStatusDisconnected, + SharedPrivateLinkResourceStatusPending, + SharedPrivateLinkResourceStatusRejected, SharedPrivateLinkResourceStatusTimeout, } } @@ -2597,33 +2642,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/customdomains_client.go b/sdk/resourcemanager/cdn/armcdn/customdomains_client.go index de4570a7bfc7..4b24f27632a5 100644 --- a/sdk/resourcemanager/cdn/armcdn/customdomains_client.go +++ b/sdk/resourcemanager/cdn/armcdn/customdomains_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewCustomDomainsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreate - Creates a new custom domain within an endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -61,7 +60,8 @@ func (client *CustomDomainsClient) BeginCreate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[CustomDomainsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[CustomDomainsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ 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 2023-05-01 func (client *CustomDomainsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters, options *CustomDomainsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -114,16 +116,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, customDomainProperties) + if err := runtime.MarshalAsJSON(req, customDomainProperties); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -136,7 +141,8 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[CustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[CustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,20 +151,22 @@ 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 2023-05-01 func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -189,39 +197,58 @@ 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", "2023-05-01") 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - 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 + } + poller, err := runtime.NewPoller[CustomDomainsClientDisableCustomHTTPSResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[CustomDomainsClientDisableCustomHTTPSResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DisableCustomHTTPS - Disable https delivery of the custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *CustomDomainsClient) disableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginDisableCustomHTTPSOptions) (*http.Response, error) { + var err error req, err := client.disableCustomHTTPSCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainName, options) if err != nil { - return CustomDomainsClientDisableCustomHTTPSResponse{}, err + return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return CustomDomainsClientDisableCustomHTTPSResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return CustomDomainsClientDisableCustomHTTPSResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return client.disableCustomHTTPSHandleResponse(resp) + return httpResp, 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") @@ -248,48 +275,58 @@ 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", "2023-05-01") 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - 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 + } + poller, err := runtime.NewPoller[CustomDomainsClientEnableCustomHTTPSResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[CustomDomainsClientEnableCustomHTTPSResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// EnableCustomHTTPS - Enable https delivery of the custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *CustomDomainsClient) enableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientBeginEnableCustomHTTPSOptions) (*http.Response, error) { + var err error req, err := client.enableCustomHTTPSCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainName, options) if err != nil { - return CustomDomainsClientEnableCustomHTTPSResponse{}, err + return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return CustomDomainsClientEnableCustomHTTPSResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return CustomDomainsClientEnableCustomHTTPSResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return client.enableCustomHTTPSHandleResponse(resp) + return httpResp, 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") @@ -316,46 +353,43 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CustomDomainHTTPSParameters != nil { - return req, runtime.MarshalAsJSON(req, options.CustomDomainHTTPSParameters) + if err := runtime.MarshalAsJSON(req, options.CustomDomainHTTPSParameters); err != nil { + return nil, err + } + return req, nil } 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - customDomainName - Name of the custom domain within an endpoint. // - options - CustomDomainsClientGetOptions contains the optional parameters for the CustomDomainsClient.Get method. func (client *CustomDomainsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, options *CustomDomainsClientGetOptions) (CustomDomainsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainName, options) if err != nil { return CustomDomainsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomDomainsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CustomDomainsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CustomDomainsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -386,7 +420,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -403,7 +437,7 @@ func (client *CustomDomainsClient) getHandleResponse(resp *http.Response) (Custo // NewListByEndpointPager - Lists all of the existing custom domains within an endpoint. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -461,7 +495,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/customdomains_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/customdomains_client_example_test.go index 5dc05b58e1e4..f3b6d352852f 100644 --- a/sdk/resourcemanager/cdn/armcdn/customdomains_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/customdomains_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CustomDomains_ListByEndpoint.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CustomDomains_ListByEndpoint.json func ExampleCustomDomainsClient_NewListByEndpointPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -58,7 +58,7 @@ func ExampleCustomDomainsClient_NewListByEndpointPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CustomDomains_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CustomDomains_Get.json func ExampleCustomDomainsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleCustomDomainsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CustomDomains_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CustomDomains_Create.json func ExampleCustomDomainsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleCustomDomainsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CustomDomains_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CustomDomains_Delete.json func ExampleCustomDomainsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -151,8 +151,8 @@ func ExampleCustomDomainsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CustomDomains_DisableCustomHttps.json -func ExampleCustomDomainsClient_DisableCustomHTTPS() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CustomDomains_DisableCustomHttps.json +func ExampleCustomDomainsClient_BeginDisableCustomHTTPS() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -162,14 +162,33 @@ func ExampleCustomDomainsClient_DisableCustomHTTPS() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewCustomDomainsClient().DisableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", nil) + poller, err := clientFactory.NewCustomDomainsClient().BeginDisableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CustomDomain = armcdn.CustomDomain{ + // Name: to.Ptr("www-someDomain-net"), + // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"), + // Properties: &armcdn.CustomDomainProperties{ + // CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateDisabled), + // CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstateCertificateDeleted), + // HostName: to.Ptr("www.someDomain.net"), + // ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")), + // ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json -func ExampleCustomDomainsClient_EnableCustomHTTPS_customDomainsEnableCustomHttpsUsingCdnManagedCertificate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CustomDomains_EnableCustomHttpsUsingCDNManagedCertificate.json +func ExampleCustomDomainsClient_BeginEnableCustomHTTPS_customDomainsEnableCustomHttpsUsingCdnManagedCertificate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -179,14 +198,34 @@ func ExampleCustomDomainsClient_EnableCustomHTTPS_customDomainsEnableCustomHttps if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewCustomDomainsClient().EnableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", &armcdn.CustomDomainsClientEnableCustomHTTPSOptions{CustomDomainHTTPSParameters: nil}) + poller, err := clientFactory.NewCustomDomainsClient().BeginEnableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", &armcdn.CustomDomainsClientBeginEnableCustomHTTPSOptions{CustomDomainHTTPSParameters: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CustomDomain = armcdn.CustomDomain{ + // Name: to.Ptr("www-someDomain-net"), + // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"), + // Properties: &armcdn.CustomDomainProperties{ + // CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateEnabled), + // CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstateCertificateDeployed), + // HostName: to.Ptr("www.someDomain.net"), + // ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")), + // ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive), + // ValidationData: to.Ptr("validationdata"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CustomDomains_EnableCustomHttpsUsingBYOC.json -func ExampleCustomDomainsClient_EnableCustomHTTPS_customDomainsEnableCustomHttpsUsingYourOwnCertificate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CustomDomains_EnableCustomHttpsUsingBYOC.json +func ExampleCustomDomainsClient_BeginEnableCustomHTTPS_customDomainsEnableCustomHttpsUsingYourOwnCertificate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -196,8 +235,28 @@ func ExampleCustomDomainsClient_EnableCustomHTTPS_customDomainsEnableCustomHttps if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewCustomDomainsClient().EnableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", &armcdn.CustomDomainsClientEnableCustomHTTPSOptions{CustomDomainHTTPSParameters: nil}) + poller, err := clientFactory.NewCustomDomainsClient().BeginEnableCustomHTTPS(ctx, "RG", "profile1", "endpoint1", "www-someDomain-net", &armcdn.CustomDomainsClientBeginEnableCustomHTTPSOptions{CustomDomainHTTPSParameters: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CustomDomain = armcdn.CustomDomain{ + // Name: to.Ptr("www-someDomain-net"), + // Type: to.Ptr("Microsoft.Cdn/profiles/endpoints/customdomains"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customdomains/www-someDomain-net"), + // Properties: &armcdn.CustomDomainProperties{ + // CustomHTTPSProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningStateEnabled), + // CustomHTTPSProvisioningSubstate: to.Ptr(armcdn.CustomHTTPSProvisioningSubstateCertificateDeployed), + // HostName: to.Ptr("www.someDomain.net"), + // ProvisioningState: to.Ptr(armcdn.CustomHTTPSProvisioningState("Succeeded")), + // ResourceState: to.Ptr(armcdn.CustomDomainResourceStateActive), + // ValidationData: to.Ptr("validationdata"), + // }, + // } } diff --git a/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go b/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go index f5b13936b59d..feacfbdc2c74 100644 --- a/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go +++ b/sdk/resourcemanager/cdn/armcdn/edgenodes_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -40,7 +39,7 @@ func NewEdgeNodesClient(credential azcore.TokenCredential, options *arm.ClientOp // NewListPager - Edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - options - EdgeNodesClientListOptions contains the optional parameters for the EdgeNodesClient.NewListPager method. func (client *EdgeNodesClient) NewListPager(options *EdgeNodesClientListOptions) *runtime.Pager[EdgeNodesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[EdgeNodesClientListResponse]{ @@ -78,7 +77,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/edgenodes_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/edgenodes_client_example_test.go index 68e91f8ae909..258c88b11ee5 100644 --- a/sdk/resourcemanager/cdn/armcdn/edgenodes_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/edgenodes_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/EdgeNodes_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/EdgeNodes_List.json func ExampleEdgeNodesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/endpoints_client.go b/sdk/resourcemanager/cdn/armcdn/endpoints_client.go index b98ba2515e02..a8afdd3ad16c 100644 --- a/sdk/resourcemanager/cdn/armcdn/endpoints_client.go +++ b/sdk/resourcemanager/cdn/armcdn/endpoints_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -48,7 +47,7 @@ func NewEndpointsClient(subscriptionID string, credential azcore.TokenCredential // and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -60,7 +59,8 @@ func (client *EndpointsClient) BeginCreate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[EndpointsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[EndpointsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[EndpointsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *EndpointsClient) BeginCreate(ctx context.Context, resourceGroupNam // profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *EndpointsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint Endpoint, options *EndpointsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, endpoint, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -110,17 +112,20 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, endpoint) + if err := runtime.MarshalAsJSON(req, endpoint); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -131,7 +136,8 @@ func (client *EndpointsClient) BeginDelete(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[EndpointsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[EndpointsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[EndpointsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +147,22 @@ func (client *EndpointsClient) BeginDelete(ctx context.Context, resourceGroupNam // and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *EndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,7 +189,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,24 +199,27 @@ func (client *EndpointsClient) deleteCreateRequest(ctx context.Context, resource // profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - options - EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method. func (client *EndpointsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientGetOptions) (EndpointsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { return EndpointsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EndpointsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EndpointsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EndpointsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -235,7 +246,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +263,7 @@ func (client *EndpointsClient) getHandleResponse(resp *http.Response) (Endpoints // NewListByProfilePager - Lists existing CDN endpoints. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - options - EndpointsClientListByProfileOptions contains the optional parameters for the EndpointsClient.NewListByProfilePager @@ -305,7 +316,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +333,7 @@ func (client *EndpointsClient) listByProfileHandleResponse(resp *http.Response) // NewListResourceUsagePager - Checks the quota and usage of geo filters and custom domains under the given endpoint. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -380,7 +391,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -398,7 +409,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -412,7 +423,8 @@ func (client *EndpointsClient) BeginLoadContent(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller[EndpointsClientLoadContentResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[EndpointsClientLoadContentResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[EndpointsClientLoadContentResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -421,20 +433,22 @@ 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 2023-05-01 func (client *EndpointsClient) loadContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters, options *EndpointsClientBeginLoadContentOptions) (*http.Response, error) { + var err error req, err := client.loadContentCreateRequest(ctx, resourceGroupName, profileName, endpointName, contentFilePaths, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // loadContentCreateRequest creates the LoadContent request. @@ -461,16 +475,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, contentFilePaths) + if err := runtime.MarshalAsJSON(req, contentFilePaths); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -485,7 +502,8 @@ func (client *EndpointsClient) BeginPurgeContent(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[EndpointsClientPurgeContentResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[EndpointsClientPurgeContentResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[EndpointsClientPurgeContentResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -494,20 +512,22 @@ 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 2023-05-01 func (client *EndpointsClient) purgeContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters, options *EndpointsClientBeginPurgeContentOptions) (*http.Response, error) { + var err error req, err := client.purgeContentCreateRequest(ctx, resourceGroupName, profileName, endpointName, contentFilePaths, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // purgeContentCreateRequest creates the PurgeContent request. @@ -534,16 +554,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, contentFilePaths) + if err := runtime.MarshalAsJSON(req, contentFilePaths); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -554,7 +577,8 @@ func (client *EndpointsClient) BeginStart(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[EndpointsClientStartResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[EndpointsClientStartResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[EndpointsClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -563,20 +587,22 @@ 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 2023-05-01 func (client *EndpointsClient) start(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginStartOptions) (*http.Response, error) { + var err error req, err := client.startCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // startCreateRequest creates the Start request. @@ -603,7 +629,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -612,7 +638,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -623,7 +649,8 @@ func (client *EndpointsClient) BeginStop(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[EndpointsClientStopResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[EndpointsClientStopResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[EndpointsClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -632,20 +659,22 @@ 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 2023-05-01 func (client *EndpointsClient) stop(ctx context.Context, resourceGroupName string, profileName string, endpointName string, options *EndpointsClientBeginStopOptions) (*http.Response, error) { + var err error req, err := client.stopCreateRequest(ctx, resourceGroupName, profileName, endpointName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // stopCreateRequest creates the Stop request. @@ -672,7 +701,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -684,7 +713,7 @@ func (client *EndpointsClient) stopCreateRequest(ctx context.Context, resourceGr // use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -696,7 +725,8 @@ func (client *EndpointsClient) BeginUpdate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[EndpointsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[EndpointsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[EndpointsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -708,20 +738,22 @@ func (client *EndpointsClient) BeginUpdate(ctx context.Context, resourceGroupNam // use the Update Custom Domain operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *EndpointsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters, options *EndpointsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, endpointUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -748,16 +780,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, endpointUpdateProperties) + if err := runtime.MarshalAsJSON(req, endpointUpdateProperties); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -765,18 +800,21 @@ func (client *EndpointsClient) updateCreateRequest(ctx context.Context, resource // - options - EndpointsClientValidateCustomDomainOptions contains the optional parameters for the EndpointsClient.ValidateCustomDomain // method. func (client *EndpointsClient) ValidateCustomDomain(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput, options *EndpointsClientValidateCustomDomainOptions) (EndpointsClientValidateCustomDomainResponse, error) { + var err error req, err := client.validateCustomDomainCreateRequest(ctx, resourceGroupName, profileName, endpointName, customDomainProperties, options) if err != nil { return EndpointsClientValidateCustomDomainResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EndpointsClientValidateCustomDomainResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EndpointsClientValidateCustomDomainResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EndpointsClientValidateCustomDomainResponse{}, err } - return client.validateCustomDomainHandleResponse(resp) + resp, err := client.validateCustomDomainHandleResponse(httpResp) + return resp, err } // validateCustomDomainCreateRequest creates the ValidateCustomDomain request. @@ -803,10 +841,13 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, customDomainProperties) + if err := runtime.MarshalAsJSON(req, customDomainProperties); err != nil { + return nil, err + } + return req, nil } // validateCustomDomainHandleResponse handles the ValidateCustomDomain response. diff --git a/sdk/resourcemanager/cdn/armcdn/endpoints_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/endpoints_client_example_test.go index 86fd4425bec7..675a9dd81bdd 100644 --- a/sdk/resourcemanager/cdn/armcdn/endpoints_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/endpoints_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_ListByProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_ListByProfile.json func ExampleEndpointsClient_NewListByProfilePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -64,10 +64,10 @@ func ExampleEndpointsClient_NewListByProfilePager() { // OriginHostHeader: to.Ptr("www.bing.com"), // ProbePath: to.Ptr("/image"), // QueryStringCachingBehavior: to.Ptr(armcdn.QueryStringCachingBehaviorNotSet), - // CustomDomains: []*armcdn.CustomDomain{ + // CustomDomains: []*armcdn.DeepCreatedCustomDomain{ // { // Name: to.Ptr("www-someDomain-net"), - // Properties: &armcdn.CustomDomainProperties{ + // Properties: &armcdn.DeepCreatedCustomDomainProperties{ // HostName: to.Ptr("www.someDomain.Net"), // }, // }}, @@ -113,7 +113,7 @@ func ExampleEndpointsClient_NewListByProfilePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_Get.json func ExampleEndpointsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -153,10 +153,10 @@ func ExampleEndpointsClient_Get() { // OriginHostHeader: to.Ptr("www.bing.com"), // ProbePath: to.Ptr("/image"), // QueryStringCachingBehavior: to.Ptr(armcdn.QueryStringCachingBehaviorNotSet), - // CustomDomains: []*armcdn.CustomDomain{ + // CustomDomains: []*armcdn.DeepCreatedCustomDomain{ // { // Name: to.Ptr("www-someDomain-net"), - // Properties: &armcdn.CustomDomainProperties{ + // Properties: &armcdn.DeepCreatedCustomDomainProperties{ // HostName: to.Ptr("www.someDomain.Net"), // }, // }}, @@ -196,7 +196,7 @@ func ExampleEndpointsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_Create.json func ExampleEndpointsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -461,7 +461,7 @@ func ExampleEndpointsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_Update.json func ExampleEndpointsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -543,7 +543,7 @@ func ExampleEndpointsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_Delete.json func ExampleEndpointsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -564,7 +564,7 @@ func ExampleEndpointsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_Start.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_Start.json func ExampleEndpointsClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -622,7 +622,7 @@ func ExampleEndpointsClient_BeginStart() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_Stop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_Stop.json func ExampleEndpointsClient_BeginStop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -680,7 +680,7 @@ func ExampleEndpointsClient_BeginStop() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_PurgeContent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_PurgeContent.json func ExampleEndpointsClient_BeginPurgeContent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -704,7 +704,7 @@ func ExampleEndpointsClient_BeginPurgeContent() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_LoadContent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_LoadContent.json func ExampleEndpointsClient_BeginLoadContent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -728,7 +728,7 @@ func ExampleEndpointsClient_BeginLoadContent() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_ValidateCustomDomain.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_ValidateCustomDomain.json func ExampleEndpointsClient_ValidateCustomDomain() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -753,7 +753,7 @@ func ExampleEndpointsClient_ValidateCustomDomain() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Endpoints_ListResourceUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Endpoints_ListResourceUsage.json func ExampleEndpointsClient_NewListResourceUsagePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/go.mod b/sdk/resourcemanager/cdn/armcdn/go.mod index 120efd1f04e5..7cbcdcbde013 100644 --- a/sdk/resourcemanager/cdn/armcdn/go.mod +++ b/sdk/resourcemanager/cdn/armcdn/go.mod @@ -1,9 +1,9 @@ -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.4.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 @@ -21,9 +21,9 @@ require ( github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect gopkg.in/yaml.v2 v2.4.0 // 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 57a48677bc2c..93fdfc2850cd 100644 --- a/sdk/resourcemanager/cdn/armcdn/go.sum +++ b/sdk/resourcemanager/cdn/armcdn/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= @@ -31,13 +31,13 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/sdk/resourcemanager/cdn/armcdn/interfaces.go b/sdk/resourcemanager/cdn/armcdn/interfaces.go new file mode 100644 index 000000000000..1c88786ca14a --- /dev/null +++ b/sdk/resourcemanager/cdn/armcdn/interfaces.go @@ -0,0 +1,61 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcdn + +// CustomDomainHTTPSParametersClassification provides polymorphic access to related types. +// Call the interface's GetCustomDomainHTTPSParameters() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CustomDomainHTTPSParameters, *ManagedHTTPSParameters, *UserManagedHTTPSParameters +type CustomDomainHTTPSParametersClassification interface { + // GetCustomDomainHTTPSParameters returns the CustomDomainHTTPSParameters content of the underlying type. + GetCustomDomainHTTPSParameters() *CustomDomainHTTPSParameters +} + +// DeliveryRuleActionAutoGeneratedClassification provides polymorphic access to related types. +// Call the interface's GetDeliveryRuleActionAutoGenerated() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DeliveryRuleActionAutoGenerated, *DeliveryRuleCacheExpirationAction, *DeliveryRuleCacheKeyQueryStringAction, *DeliveryRuleRequestHeaderAction, +// - *DeliveryRuleResponseHeaderAction, *DeliveryRuleRouteConfigurationOverrideAction, *OriginGroupOverrideAction, *URLRedirectAction, +// - *URLRewriteAction, *URLSigningAction +type DeliveryRuleActionAutoGeneratedClassification interface { + // GetDeliveryRuleActionAutoGenerated returns the DeliveryRuleActionAutoGenerated content of the underlying type. + GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated +} + +// DeliveryRuleConditionClassification provides polymorphic access to related types. +// Call the interface's GetDeliveryRuleCondition() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DeliveryRuleClientPortCondition, *DeliveryRuleCondition, *DeliveryRuleCookiesCondition, *DeliveryRuleHTTPVersionCondition, +// - *DeliveryRuleHostNameCondition, *DeliveryRuleIsDeviceCondition, *DeliveryRulePostArgsCondition, *DeliveryRuleQueryStringCondition, +// - *DeliveryRuleRemoteAddressCondition, *DeliveryRuleRequestBodyCondition, *DeliveryRuleRequestHeaderCondition, *DeliveryRuleRequestMethodCondition, +// - *DeliveryRuleRequestSchemeCondition, *DeliveryRuleRequestURICondition, *DeliveryRuleSSLProtocolCondition, *DeliveryRuleServerPortCondition, +// - *DeliveryRuleSocketAddrCondition, *DeliveryRuleURLFileExtensionCondition, *DeliveryRuleURLFileNameCondition, *DeliveryRuleURLPathCondition +type DeliveryRuleConditionClassification interface { + // GetDeliveryRuleCondition returns the DeliveryRuleCondition content of the underlying type. + GetDeliveryRuleCondition() *DeliveryRuleCondition +} + +// SecretParametersClassification provides polymorphic access to related types. +// Call the interface's GetSecretParameters() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFirstPartyManagedCertificateParameters, *CustomerCertificateParameters, *ManagedCertificateParameters, *SecretParameters, +// - *URLSigningKeyParameters +type SecretParametersClassification interface { + // GetSecretParameters returns the SecretParameters content of the underlying type. + GetSecretParameters() *SecretParameters +} + +// SecurityPolicyPropertiesParametersClassification provides polymorphic access to related types. +// Call the interface's GetSecurityPolicyPropertiesParameters() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *SecurityPolicyPropertiesParameters, *SecurityPolicyWebApplicationFirewallParameters +type SecurityPolicyPropertiesParametersClassification interface { + // GetSecurityPolicyPropertiesParameters returns the SecurityPolicyPropertiesParameters content of the underlying type. + GetSecurityPolicyPropertiesParameters() *SecurityPolicyPropertiesParameters +} diff --git a/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go b/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go index 9de58dcb27f7..8f9263caac95 100644 --- a/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go +++ b/sdk/resourcemanager/cdn/armcdn/loganalytics_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -49,25 +48,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. // - options - LogAnalyticsClientGetLogAnalyticsLocationsOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsLocations // method. func (client *LogAnalyticsClient) GetLogAnalyticsLocations(ctx context.Context, resourceGroupName string, profileName string, options *LogAnalyticsClientGetLogAnalyticsLocationsOptions) (LogAnalyticsClientGetLogAnalyticsLocationsResponse, error) { + var err error req, err := client.getLogAnalyticsLocationsCreateRequest(ctx, resourceGroupName, profileName, options) if err != nil { return LogAnalyticsClientGetLogAnalyticsLocationsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LogAnalyticsClientGetLogAnalyticsLocationsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LogAnalyticsClientGetLogAnalyticsLocationsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LogAnalyticsClientGetLogAnalyticsLocationsResponse{}, err } - return client.getLogAnalyticsLocationsHandleResponse(resp) + resp, err := client.getLogAnalyticsLocationsHandleResponse(httpResp) + return resp, err } // getLogAnalyticsLocationsCreateRequest creates the GetLogAnalyticsLocations request. @@ -90,7 +92,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,25 +110,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. // - options - LogAnalyticsClientGetLogAnalyticsMetricsOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsMetrics // method. func (client *LogAnalyticsClient) GetLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []LogMetric, dateTimeBegin time.Time, dateTimeEnd time.Time, granularity LogMetricsGranularity, customDomains []string, protocols []string, options *LogAnalyticsClientGetLogAnalyticsMetricsOptions) (LogAnalyticsClientGetLogAnalyticsMetricsResponse, error) { + var err error req, err := client.getLogAnalyticsMetricsCreateRequest(ctx, resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, granularity, customDomains, protocols, options) if err != nil { return LogAnalyticsClientGetLogAnalyticsMetricsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LogAnalyticsClientGetLogAnalyticsMetricsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LogAnalyticsClientGetLogAnalyticsMetricsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LogAnalyticsClientGetLogAnalyticsMetricsResponse{}, err } - return client.getLogAnalyticsMetricsHandleResponse(resp) + resp, err := client.getLogAnalyticsMetricsHandleResponse(httpResp) + return resp, err } // getLogAnalyticsMetricsCreateRequest creates the GetLogAnalyticsMetrics request. @@ -149,7 +154,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", "2023-05-01") for _, qv := range metrics { reqQP.Add("metrics", string(qv)) } @@ -194,25 +199,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. // - options - LogAnalyticsClientGetLogAnalyticsRankingsOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsRankings // method. func (client *LogAnalyticsClient) GetLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, rankings []LogRanking, metrics []LogRankingMetric, maxRanking int32, dateTimeBegin time.Time, dateTimeEnd time.Time, options *LogAnalyticsClientGetLogAnalyticsRankingsOptions) (LogAnalyticsClientGetLogAnalyticsRankingsResponse, error) { + var err error req, err := client.getLogAnalyticsRankingsCreateRequest(ctx, resourceGroupName, profileName, rankings, metrics, maxRanking, dateTimeBegin, dateTimeEnd, options) if err != nil { return LogAnalyticsClientGetLogAnalyticsRankingsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LogAnalyticsClientGetLogAnalyticsRankingsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LogAnalyticsClientGetLogAnalyticsRankingsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LogAnalyticsClientGetLogAnalyticsRankingsResponse{}, err } - return client.getLogAnalyticsRankingsHandleResponse(resp) + resp, err := client.getLogAnalyticsRankingsHandleResponse(httpResp) + return resp, err } // getLogAnalyticsRankingsCreateRequest creates the GetLogAnalyticsRankings request. @@ -235,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", "2023-05-01") for _, qv := range rankings { reqQP.Add("rankings", string(qv)) } @@ -267,25 +275,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. // - options - LogAnalyticsClientGetLogAnalyticsResourcesOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsResources // method. func (client *LogAnalyticsClient) GetLogAnalyticsResources(ctx context.Context, resourceGroupName string, profileName string, options *LogAnalyticsClientGetLogAnalyticsResourcesOptions) (LogAnalyticsClientGetLogAnalyticsResourcesResponse, error) { + var err error req, err := client.getLogAnalyticsResourcesCreateRequest(ctx, resourceGroupName, profileName, options) if err != nil { return LogAnalyticsClientGetLogAnalyticsResourcesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LogAnalyticsClientGetLogAnalyticsResourcesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LogAnalyticsClientGetLogAnalyticsResourcesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LogAnalyticsClientGetLogAnalyticsResourcesResponse{}, err } - return client.getLogAnalyticsResourcesHandleResponse(resp) + resp, err := client.getLogAnalyticsResourcesHandleResponse(httpResp) + return resp, err } // getLogAnalyticsResourcesCreateRequest creates the GetLogAnalyticsResources request. @@ -308,7 +319,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,25 +337,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. // - options - LogAnalyticsClientGetWafLogAnalyticsMetricsOptions contains the optional parameters for the LogAnalyticsClient.GetWafLogAnalyticsMetrics // method. func (client *LogAnalyticsClient) GetWafLogAnalyticsMetrics(ctx context.Context, resourceGroupName string, profileName string, metrics []WafMetric, dateTimeBegin time.Time, dateTimeEnd time.Time, granularity WafGranularity, options *LogAnalyticsClientGetWafLogAnalyticsMetricsOptions) (LogAnalyticsClientGetWafLogAnalyticsMetricsResponse, error) { + var err error req, err := client.getWafLogAnalyticsMetricsCreateRequest(ctx, resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, granularity, options) if err != nil { return LogAnalyticsClientGetWafLogAnalyticsMetricsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LogAnalyticsClientGetWafLogAnalyticsMetricsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LogAnalyticsClientGetWafLogAnalyticsMetricsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LogAnalyticsClientGetWafLogAnalyticsMetricsResponse{}, err } - return client.getWafLogAnalyticsMetricsHandleResponse(resp) + resp, err := client.getWafLogAnalyticsMetricsHandleResponse(httpResp) + return resp, err } // getWafLogAnalyticsMetricsCreateRequest creates the GetWafLogAnalyticsMetrics request. @@ -367,7 +381,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", "2023-05-01") for _, qv := range metrics { reqQP.Add("metrics", string(qv)) } @@ -406,25 +420,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. which is unique within the resource group. // - options - LogAnalyticsClientGetWafLogAnalyticsRankingsOptions contains the optional parameters for the LogAnalyticsClient.GetWafLogAnalyticsRankings // method. func (client *LogAnalyticsClient) GetWafLogAnalyticsRankings(ctx context.Context, resourceGroupName string, profileName string, metrics []WafMetric, dateTimeBegin time.Time, dateTimeEnd time.Time, maxRanking int32, rankings []WafRankingType, options *LogAnalyticsClientGetWafLogAnalyticsRankingsOptions) (LogAnalyticsClientGetWafLogAnalyticsRankingsResponse, error) { + var err error req, err := client.getWafLogAnalyticsRankingsCreateRequest(ctx, resourceGroupName, profileName, metrics, dateTimeBegin, dateTimeEnd, maxRanking, rankings, options) if err != nil { return LogAnalyticsClientGetWafLogAnalyticsRankingsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LogAnalyticsClientGetWafLogAnalyticsRankingsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LogAnalyticsClientGetWafLogAnalyticsRankingsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LogAnalyticsClientGetWafLogAnalyticsRankingsResponse{}, err } - return client.getWafLogAnalyticsRankingsHandleResponse(resp) + resp, err := client.getWafLogAnalyticsRankingsHandleResponse(httpResp) + return resp, err } // getWafLogAnalyticsRankingsCreateRequest creates the GetWafLogAnalyticsRankings request. @@ -447,7 +464,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", "2023-05-01") for _, qv := range metrics { reqQP.Add("metrics", string(qv)) } diff --git a/sdk/resourcemanager/cdn/armcdn/loganalytics_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/loganalytics_client_example_test.go index 3e4ca28dff63..5766b05ad767 100644 --- a/sdk/resourcemanager/cdn/armcdn/loganalytics_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/loganalytics_client_example_test.go @@ -16,10 +16,10 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/LogAnalytics_GetLogAnalyticsMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/LogAnalytics_GetLogAnalyticsMetrics.json func ExampleLogAnalyticsClient_GetLogAnalyticsMetrics() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,7 +48,7 @@ func ExampleLogAnalyticsClient_GetLogAnalyticsMetrics() { // res.MetricsResponse = armcdn.MetricsResponse{ // DateTimeBegin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T12:30:27.554+08:00"); return t}()), // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T13:00:27.554+08:00"); return t}()), - // Granularity: to.Ptr(armcdn.MetricsResponseGranularityPT5M), + // Granularity: to.Ptr(armcdn.MetricsGranularityPT5M), // Series: []*armcdn.MetricsResponseSeriesItem{ // { // Data: []*armcdn.Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems{ @@ -82,12 +82,12 @@ func ExampleLogAnalyticsClient_GetLogAnalyticsMetrics() { // Value: to.Ptr("https"), // }}, // Metric: to.Ptr("clientRequestCount"), - // Unit: to.Ptr(armcdn.MetricsResponseSeriesItemUnitCount), + // Unit: to.Ptr(armcdn.MetricsSeriesUnitCount), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/LogAnalytics_GetLogAnalyticsRankings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/LogAnalytics_GetLogAnalyticsRankings.json func ExampleLogAnalyticsClient_GetLogAnalyticsRankings() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -163,7 +163,7 @@ func ExampleLogAnalyticsClient_GetLogAnalyticsRankings() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/LogAnalytics_GetLogAnalyticsLocations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/LogAnalytics_GetLogAnalyticsLocations.json func ExampleLogAnalyticsClient_GetLogAnalyticsLocations() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -224,7 +224,7 @@ func ExampleLogAnalyticsClient_GetLogAnalyticsLocations() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/LogAnalytics_GetLogAnalyticsResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/LogAnalytics_GetLogAnalyticsResources.json func ExampleLogAnalyticsClient_GetLogAnalyticsResources() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -280,7 +280,7 @@ func ExampleLogAnalyticsClient_GetLogAnalyticsResources() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/LogAnalytics_GetWafLogAnalyticsMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/LogAnalytics_GetWafLogAnalyticsMetrics.json func ExampleLogAnalyticsClient_GetWafLogAnalyticsMetrics() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -307,7 +307,7 @@ func ExampleLogAnalyticsClient_GetWafLogAnalyticsMetrics() { // res.WafMetricsResponse = armcdn.WafMetricsResponse{ // DateTimeBegin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T14:30:27.554+08:00"); return t}()), // DateTimeEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-04T17:00:27.554+08:00"); return t}()), - // Granularity: to.Ptr(armcdn.WafMetricsResponseGranularityPT5M), + // Granularity: to.Ptr(armcdn.WafMetricsGranularityPT5M), // Series: []*armcdn.WafMetricsResponseSeriesItem{ // { // Data: []*armcdn.Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems{ @@ -410,12 +410,12 @@ func ExampleLogAnalyticsClient_GetWafLogAnalyticsMetrics() { // Groups: []*armcdn.WafMetricsResponseSeriesPropertiesItemsItem{ // }, // Metric: to.Ptr("clientRequestCount"), - // Unit: to.Ptr(armcdn.WafMetricsResponseSeriesItemUnitCount), + // Unit: to.Ptr(armcdn.WafMetricsSeriesUnitCount), // }}, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/LogAnalytics_GetWafLogAnalyticsRankings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/LogAnalytics_GetWafLogAnalyticsRankings.json func ExampleLogAnalyticsClient_GetWafLogAnalyticsRankings() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go index f51fe032c088..2b573cabd594 100644 --- a/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -46,7 +45,7 @@ func NewManagedRuleSetsClient(subscriptionID string, credential azcore.TokenCred // NewListPager - Lists all available managed rule sets. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - options - ManagedRuleSetsClientListOptions contains the optional parameters for the ManagedRuleSetsClient.NewListPager // method. func (client *ManagedRuleSetsClient) NewListPager(options *ManagedRuleSetsClientListOptions) *runtime.Pager[ManagedRuleSetsClientListResponse] { @@ -89,7 +88,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/managedrulesets_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client_example_test.go index d70c06e8e7e9..1dd4c2299f10 100644 --- a/sdk/resourcemanager/cdn/armcdn/managedrulesets_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/managedrulesets_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/WafListManagedRuleSets.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/WafListManagedRuleSets.json func ExampleManagedRuleSetsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/management_client.go b/sdk/resourcemanager/cdn/armcdn/management_client.go index 370af36a3719..62fd4a72affb 100644 --- a/sdk/resourcemanager/cdn/armcdn/management_client.go +++ b/sdk/resourcemanager/cdn/armcdn/management_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -48,24 +47,27 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // unique, such as a afdx endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - checkEndpointNameAvailabilityInput - Input to check. // - options - ManagementClientCheckEndpointNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckEndpointNameAvailability // method. func (client *ManagementClient) CheckEndpointNameAvailability(ctx context.Context, resourceGroupName string, checkEndpointNameAvailabilityInput CheckEndpointNameAvailabilityInput, options *ManagementClientCheckEndpointNameAvailabilityOptions) (ManagementClientCheckEndpointNameAvailabilityResponse, error) { + var err error req, err := client.checkEndpointNameAvailabilityCreateRequest(ctx, resourceGroupName, checkEndpointNameAvailabilityInput, options) if err != nil { return ManagementClientCheckEndpointNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementClientCheckEndpointNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientCheckEndpointNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementClientCheckEndpointNameAvailabilityResponse{}, err } - return client.checkEndpointNameAvailabilityHandleResponse(resp) + resp, err := client.checkEndpointNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkEndpointNameAvailabilityCreateRequest creates the CheckEndpointNameAvailability request. @@ -84,10 +86,13 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, checkEndpointNameAvailabilityInput) + if err := runtime.MarshalAsJSON(req, checkEndpointNameAvailabilityInput); err != nil { + return nil, err + } + return req, nil } // checkEndpointNameAvailabilityHandleResponse handles the CheckEndpointNameAvailability response. @@ -103,23 +108,26 @@ func (client *ManagementClient) checkEndpointNameAvailabilityHandleResponse(resp // unique, such as a CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - checkNameAvailabilityInput - Input to check. // - options - ManagementClientCheckNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckNameAvailability // method. func (client *ManagementClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, options *ManagementClientCheckNameAvailabilityOptions) (ManagementClientCheckNameAvailabilityResponse, error) { + var err error req, err := client.checkNameAvailabilityCreateRequest(ctx, checkNameAvailabilityInput, options) if err != nil { return ManagementClientCheckNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementClientCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementClientCheckNameAvailabilityResponse{}, err } - return client.checkNameAvailabilityHandleResponse(resp) + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. @@ -130,10 +138,13 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, checkNameAvailabilityInput) + if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { + return nil, err + } + return req, nil } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. @@ -149,23 +160,26 @@ func (client *ManagementClient) checkNameAvailabilityHandleResponse(resp *http.R // is globally unique, such as a CDN endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - checkNameAvailabilityInput - Input to check. // - options - ManagementClientCheckNameAvailabilityWithSubscriptionOptions contains the optional parameters for the ManagementClient.CheckNameAvailabilityWithSubscription // method. func (client *ManagementClient) CheckNameAvailabilityWithSubscription(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, options *ManagementClientCheckNameAvailabilityWithSubscriptionOptions) (ManagementClientCheckNameAvailabilityWithSubscriptionResponse, error) { + var err error req, err := client.checkNameAvailabilityWithSubscriptionCreateRequest(ctx, checkNameAvailabilityInput, options) if err != nil { return ManagementClientCheckNameAvailabilityWithSubscriptionResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementClientCheckNameAvailabilityWithSubscriptionResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientCheckNameAvailabilityWithSubscriptionResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementClientCheckNameAvailabilityWithSubscriptionResponse{}, err } - return client.checkNameAvailabilityWithSubscriptionHandleResponse(resp) + resp, err := client.checkNameAvailabilityWithSubscriptionHandleResponse(httpResp) + return resp, err } // checkNameAvailabilityWithSubscriptionCreateRequest creates the CheckNameAvailabilityWithSubscription request. @@ -180,10 +194,13 @@ func (client *ManagementClient) checkNameAvailabilityWithSubscriptionCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, checkNameAvailabilityInput) + if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { + return nil, err + } + return req, nil } // checkNameAvailabilityWithSubscriptionHandleResponse handles the CheckNameAvailabilityWithSubscription response. @@ -200,23 +217,26 @@ func (client *ManagementClient) checkNameAvailabilityWithSubscriptionHandleRespo // endpoint. This path is relative to the origin path specified in the endpoint configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - validateProbeInput - Input to check. // - options - ManagementClientValidateProbeOptions contains the optional parameters for the ManagementClient.ValidateProbe // method. func (client *ManagementClient) ValidateProbe(ctx context.Context, validateProbeInput ValidateProbeInput, options *ManagementClientValidateProbeOptions) (ManagementClientValidateProbeResponse, error) { + var err error req, err := client.validateProbeCreateRequest(ctx, validateProbeInput, options) if err != nil { return ManagementClientValidateProbeResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementClientValidateProbeResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ManagementClientValidateProbeResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagementClientValidateProbeResponse{}, err } - return client.validateProbeHandleResponse(resp) + resp, err := client.validateProbeHandleResponse(httpResp) + return resp, err } // validateProbeCreateRequest creates the ValidateProbe request. @@ -231,10 +251,13 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, validateProbeInput) + if err := runtime.MarshalAsJSON(req, validateProbeInput); err != nil { + return nil, err + } + return req, nil } // validateProbeHandleResponse handles the ValidateProbe response. diff --git a/sdk/resourcemanager/cdn/armcdn/management_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/management_client_example_test.go index f4ddbf05a022..c5f680758d35 100644 --- a/sdk/resourcemanager/cdn/armcdn/management_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/management_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CheckEndpointNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CheckEndpointNameAvailability.json func ExampleManagementClient_CheckEndpointNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,7 +48,7 @@ func ExampleManagementClient_CheckEndpointNameAvailability() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CheckNameAvailability.json func ExampleManagementClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -76,7 +76,7 @@ func ExampleManagementClient_CheckNameAvailability() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CheckNameAvailabilityWithSubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/CheckNameAvailabilityWithSubscription.json func ExampleManagementClient_CheckNameAvailabilityWithSubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,7 +104,7 @@ func ExampleManagementClient_CheckNameAvailabilityWithSubscription() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/ValidateProbe.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/ValidateProbe.json func ExampleManagementClient_ValidateProbe() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/models.go b/sdk/resourcemanager/cdn/armcdn/models.go index af7f280b9822..f6df276b0c97 100644 --- a/sdk/resourcemanager/cdn/armcdn/models.go +++ b/sdk/resourcemanager/cdn/armcdn/models.go @@ -3,50 +3,13 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn import "time" -// AFDCustomDomainsClientBeginCreateOptions contains the optional parameters for the AFDCustomDomainsClient.BeginCreate method. -type AFDCustomDomainsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDCustomDomainsClientBeginDeleteOptions contains the optional parameters for the AFDCustomDomainsClient.BeginDelete method. -type AFDCustomDomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDCustomDomainsClientBeginRefreshValidationTokenOptions contains the optional parameters for the AFDCustomDomainsClient.BeginRefreshValidationToken -// method. -type AFDCustomDomainsClientBeginRefreshValidationTokenOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDCustomDomainsClientBeginUpdateOptions contains the optional parameters for the AFDCustomDomainsClient.BeginUpdate method. -type AFDCustomDomainsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDCustomDomainsClientGetOptions contains the optional parameters for the AFDCustomDomainsClient.Get method. -type AFDCustomDomainsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AFDCustomDomainsClientListByProfileOptions contains the optional parameters for the AFDCustomDomainsClient.NewListByProfilePager -// method. -type AFDCustomDomainsClientListByProfileOptions struct { - // placeholder for future optional parameters -} - // AFDDomain - Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. // www.contoso.com. type AFDDomain struct { @@ -96,6 +59,9 @@ type AFDDomainProperties struct { // Resource reference to the Azure DNS zone AzureDNSZone *ResourceReference + // Key-Value pair representing migration properties for domains. + ExtendedProperties map[string]*string + // Resource reference to the Azure resource where custom domain ownership was prevalidated PreValidatedCustomDomainResourceID *ResourceReference @@ -144,9 +110,9 @@ type AFDDomainUpdatePropertiesParameters struct { ProfileName *string } -// 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 @@ -219,57 +185,9 @@ type AFDEndpointUpdateParameters struct { Tags map[string]*string } -// AFDEndpointsClientBeginCreateOptions contains the optional parameters for the AFDEndpointsClient.BeginCreate method. -type AFDEndpointsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDEndpointsClientBeginDeleteOptions contains the optional parameters for the AFDEndpointsClient.BeginDelete method. -type AFDEndpointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDEndpointsClientBeginPurgeContentOptions contains the optional parameters for the AFDEndpointsClient.BeginPurgeContent -// method. -type AFDEndpointsClientBeginPurgeContentOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDEndpointsClientBeginUpdateOptions contains the optional parameters for the AFDEndpointsClient.BeginUpdate method. -type AFDEndpointsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDEndpointsClientGetOptions contains the optional parameters for the AFDEndpointsClient.Get method. -type AFDEndpointsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AFDEndpointsClientListByProfileOptions contains the optional parameters for the AFDEndpointsClient.NewListByProfilePager -// method. -type AFDEndpointsClientListByProfileOptions struct { - // placeholder for future optional parameters -} - -// AFDEndpointsClientListResourceUsageOptions contains the optional parameters for the AFDEndpointsClient.NewListResourceUsagePager -// method. -type AFDEndpointsClientListResourceUsageOptions struct { - // placeholder for future optional parameters -} - -// AFDEndpointsClientValidateCustomDomainOptions contains the optional parameters for the AFDEndpointsClient.ValidateCustomDomain -// method. -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 @@ -288,7 +206,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 @@ -312,7 +230,7 @@ type AFDOriginGroupListResult struct { // URL to get the next set of origin objects if there are any. NextLink *string - // 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 } @@ -366,48 +284,13 @@ type AFDOriginGroupUpdatePropertiesParameters struct { ProfileName *string } -// AFDOriginGroupsClientBeginCreateOptions contains the optional parameters for the AFDOriginGroupsClient.BeginCreate method. -type AFDOriginGroupsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDOriginGroupsClientBeginDeleteOptions contains the optional parameters for the AFDOriginGroupsClient.BeginDelete method. -type AFDOriginGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDOriginGroupsClientBeginUpdateOptions contains the optional parameters for the AFDOriginGroupsClient.BeginUpdate method. -type AFDOriginGroupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDOriginGroupsClientGetOptions contains the optional parameters for the AFDOriginGroupsClient.Get method. -type AFDOriginGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AFDOriginGroupsClientListByProfileOptions contains the optional parameters for the AFDOriginGroupsClient.NewListByProfilePager -// method. -type AFDOriginGroupsClientListByProfileOptions struct { - // placeholder for future optional parameters -} - -// AFDOriginGroupsClientListResourceUsageOptions contains the optional parameters for the AFDOriginGroupsClient.NewListResourceUsagePager -// method. -type AFDOriginGroupsClientListResourceUsageOptions struct { - // placeholder for future optional parameters -} - // AFDOriginListResult - Result of the request to list origins. It contains a list of origin objects and a URL link to get // the next set of results. type AFDOriginListResult struct { // URL to get the next set of origin objects if there are any. NextLink *string - // 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 } @@ -434,8 +317,9 @@ type AFDOriginProperties struct { HostName *string // 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 // Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any @@ -487,8 +371,9 @@ type AFDOriginUpdatePropertiesParameters struct { HostName *string // 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 // Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any @@ -505,47 +390,6 @@ type AFDOriginUpdatePropertiesParameters struct { OriginGroupName *string } -// AFDOriginsClientBeginCreateOptions contains the optional parameters for the AFDOriginsClient.BeginCreate method. -type AFDOriginsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDOriginsClientBeginDeleteOptions contains the optional parameters for the AFDOriginsClient.BeginDelete method. -type AFDOriginsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDOriginsClientBeginUpdateOptions contains the optional parameters for the AFDOriginsClient.BeginUpdate method. -type AFDOriginsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AFDOriginsClientGetOptions contains the optional parameters for the AFDOriginsClient.Get method. -type AFDOriginsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AFDOriginsClientListByOriginGroupOptions contains the optional parameters for the AFDOriginsClient.NewListByOriginGroupPager -// method. -type AFDOriginsClientListByOriginGroupOptions struct { - // placeholder for future optional parameters -} - -// AFDProfilesClientCheckHostNameAvailabilityOptions contains the optional parameters for the AFDProfilesClient.CheckHostNameAvailability -// method. -type AFDProfilesClientCheckHostNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// AFDProfilesClientListResourceUsageOptions contains the optional parameters for the AFDProfilesClient.NewListResourceUsagePager -// method. -type AFDProfilesClientListResourceUsageOptions struct { - // placeholder for future optional parameters -} - // AFDStateProperties - The tracking states for afd resources. type AFDStateProperties struct { // READ-ONLY @@ -613,6 +457,25 @@ type AzureFirstPartyManagedCertificate struct { type AzureFirstPartyManagedCertificateParameters struct { // REQUIRED; The type of the secret resource. Type *SecretType + + // The list of SANs. + SubjectAlternativeNames []*string + + // READ-ONLY; Certificate issuing authority. + CertificateAuthority *string + + // READ-ONLY; Certificate expiration date. + ExpirationDate *string + + // READ-ONLY; Resource reference to the Azure Key Vault certificate. Expected to be in format of + // /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ + SecretSource *ResourceReference + + // READ-ONLY; Subject name in the certificate. + Subject *string + + // READ-ONLY; Certificate thumbprint. + Thumbprint *string } // GetSecretParameters implements the SecretParametersClassification interface for type AzureFirstPartyManagedCertificateParameters. @@ -672,6 +535,33 @@ type CacheKeyQueryStringActionParameters struct { QueryParameters *string } +// 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 +} + +type CanMigrateProperties struct { + Errors []*MigrationErrorType + + // READ-ONLY; Flag that says if the profile can be migrated + CanMigrate *bool + + // READ-ONLY; Recommended sku for the migration + DefaultSKU *CanMigrateDefaultSKU +} + +// CanMigrateResult - Result for canMigrate operation. +type CanMigrateResult struct { + Properties *CanMigrateProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource type. + Type *string +} + // Certificate used for https type Certificate struct { // The type of the secret resource. @@ -857,15 +747,6 @@ type CustomDomain struct { Type *string } -// CustomDomainHTTPSParametersClassification provides polymorphic access to related types. -// Call the interface's GetCustomDomainHTTPSParameters() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CustomDomainHTTPSParameters, *ManagedHTTPSParameters, *UserManagedHTTPSParameters -type CustomDomainHTTPSParametersClassification interface { - // GetCustomDomainHTTPSParameters returns the CustomDomainHTTPSParameters content of the underlying type. - GetCustomDomainHTTPSParameters() *CustomDomainHTTPSParameters -} - // CustomDomainHTTPSParameters - The JSON object that contains the properties to secure a custom domain. type CustomDomainHTTPSParameters struct { // REQUIRED; Defines the source of the SSL certificate. @@ -930,44 +811,6 @@ type CustomDomainPropertiesParameters struct { HostName *string } -// CustomDomainsClientBeginCreateOptions contains the optional parameters for the CustomDomainsClient.BeginCreate method. -type CustomDomainsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CustomDomainsClientBeginDeleteOptions contains the optional parameters for the CustomDomainsClient.BeginDelete method. -type CustomDomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CustomDomainsClientDisableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.DisableCustomHTTPS -// method. -type CustomDomainsClientDisableCustomHTTPSOptions struct { - // placeholder for future optional parameters -} - -// CustomDomainsClientEnableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.EnableCustomHTTPS -// method. -type CustomDomainsClientEnableCustomHTTPSOptions 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 -} - -// CustomDomainsClientGetOptions contains the optional parameters for the CustomDomainsClient.Get method. -type CustomDomainsClientGetOptions struct { - // placeholder for future optional parameters -} - -// CustomDomainsClientListByEndpointOptions contains the optional parameters for the CustomDomainsClient.NewListByEndpointPager -// method. -type CustomDomainsClientListByEndpointOptions struct { - // placeholder for future optional parameters -} - // CustomRule - Defines the common attributes for a custom rule that can be included in a waf policy type CustomRule struct { // REQUIRED; Describes what action to be applied when rule matches @@ -1061,6 +904,25 @@ func (c *CustomerCertificateParameters) GetSecretParameters() *SecretParameters } } +// DeepCreatedCustomDomain - Custom domains created on the CDN endpoint. +type DeepCreatedCustomDomain struct { + // REQUIRED; Custom domain name. + Name *string + + // Properties of the custom domain created on the CDN endpoint. + Properties *DeepCreatedCustomDomainProperties +} + +// 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 + + // 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 +} + // 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. @@ -1157,17 +1019,6 @@ type DeliveryRule struct { Name *string } -// DeliveryRuleActionAutoGeneratedClassification provides polymorphic access to related types. -// Call the interface's GetDeliveryRuleActionAutoGenerated() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DeliveryRuleActionAutoGenerated, *DeliveryRuleCacheExpirationAction, *DeliveryRuleCacheKeyQueryStringAction, *DeliveryRuleRequestHeaderAction, -// - *DeliveryRuleResponseHeaderAction, *DeliveryRuleRouteConfigurationOverrideAction, *OriginGroupOverrideAction, *URLRedirectAction, -// - *URLRewriteAction, *URLSigningAction -type DeliveryRuleActionAutoGeneratedClassification interface { - // GetDeliveryRuleActionAutoGenerated returns the DeliveryRuleActionAutoGenerated content of the underlying type. - GetDeliveryRuleActionAutoGenerated() *DeliveryRuleActionAutoGenerated -} - // DeliveryRuleActionAutoGenerated - An action for the delivery rule. type DeliveryRuleActionAutoGenerated struct { // REQUIRED; The name of the action for the delivery rule. @@ -1227,19 +1078,6 @@ func (d *DeliveryRuleClientPortCondition) GetDeliveryRuleCondition() *DeliveryRu } } -// DeliveryRuleConditionClassification provides polymorphic access to related types. -// Call the interface's GetDeliveryRuleCondition() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DeliveryRuleClientPortCondition, *DeliveryRuleCondition, *DeliveryRuleCookiesCondition, *DeliveryRuleHTTPVersionCondition, -// - *DeliveryRuleHostNameCondition, *DeliveryRuleIsDeviceCondition, *DeliveryRulePostArgsCondition, *DeliveryRuleQueryStringCondition, -// - *DeliveryRuleRemoteAddressCondition, *DeliveryRuleRequestBodyCondition, *DeliveryRuleRequestHeaderCondition, *DeliveryRuleRequestMethodCondition, -// - *DeliveryRuleRequestSchemeCondition, *DeliveryRuleRequestURICondition, *DeliveryRuleSSLProtocolCondition, *DeliveryRuleServerPortCondition, -// - *DeliveryRuleSocketAddrCondition, *DeliveryRuleURLFileExtensionCondition, *DeliveryRuleURLFileNameCondition, *DeliveryRuleURLPathCondition -type DeliveryRuleConditionClassification interface { - // GetDeliveryRuleCondition returns the DeliveryRuleCondition content of the underlying type. - GetDeliveryRuleCondition() *DeliveryRuleCondition -} - // DeliveryRuleCondition - A condition for the delivery rule. type DeliveryRuleCondition struct { // REQUIRED; The name of the condition for the delivery rule. @@ -1631,11 +1469,6 @@ type EdgeNodeProperties struct { IPAddressGroups []*IPAddressGroup } -// EdgeNodesClientListOptions contains the optional parameters for the EdgeNodesClient.NewListPager method. -type EdgeNodesClientListOptions struct { - // placeholder for future optional parameters -} - // EdgenodeResult - Result of the request to list CDN edgenodes. It contains a list of ip address group and a URL link to // get the next set of results. type EdgenodeResult struct { @@ -1747,7 +1580,7 @@ type EndpointProperties struct { WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink // READ-ONLY; The custom domains under the endpoint. - CustomDomains []*CustomDomain + CustomDomains []*DeepCreatedCustomDomain // READ-ONLY; The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net HostName *string @@ -1843,70 +1676,6 @@ type EndpointUpdateParameters struct { Tags map[string]*string } -// EndpointsClientBeginCreateOptions contains the optional parameters for the EndpointsClient.BeginCreate method. -type EndpointsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EndpointsClientBeginDeleteOptions contains the optional parameters for the EndpointsClient.BeginDelete method. -type EndpointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EndpointsClientBeginLoadContentOptions contains the optional parameters for the EndpointsClient.BeginLoadContent method. -type EndpointsClientBeginLoadContentOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EndpointsClientBeginPurgeContentOptions contains the optional parameters for the EndpointsClient.BeginPurgeContent method. -type EndpointsClientBeginPurgeContentOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EndpointsClientBeginStartOptions contains the optional parameters for the EndpointsClient.BeginStart method. -type EndpointsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EndpointsClientBeginStopOptions contains the optional parameters for the EndpointsClient.BeginStop method. -type EndpointsClientBeginStopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EndpointsClientBeginUpdateOptions contains the optional parameters for the EndpointsClient.BeginUpdate method. -type EndpointsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method. -type EndpointsClientGetOptions struct { - // placeholder for future optional parameters -} - -// EndpointsClientListByProfileOptions contains the optional parameters for the EndpointsClient.NewListByProfilePager method. -type EndpointsClientListByProfileOptions struct { - // placeholder for future optional parameters -} - -// EndpointsClientListResourceUsageOptions contains the optional parameters for the EndpointsClient.NewListResourceUsagePager -// method. -type EndpointsClientListResourceUsageOptions struct { - // placeholder for future optional parameters -} - -// EndpointsClientValidateCustomDomainOptions contains the optional parameters for the EndpointsClient.ValidateCustomDomain -// method. -type EndpointsClientValidateCustomDomainOptions struct { - // placeholder for future optional parameters -} - // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -2131,47 +1900,6 @@ type LoadParameters struct { ContentPaths []*string } -// LogAnalyticsClientGetLogAnalyticsLocationsOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsLocations -// method. -type LogAnalyticsClientGetLogAnalyticsLocationsOptions struct { - // placeholder for future optional parameters -} - -// LogAnalyticsClientGetLogAnalyticsMetricsOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsMetrics -// method. -type LogAnalyticsClientGetLogAnalyticsMetricsOptions struct { - Continents []string - CountryOrRegions []string - GroupBy []LogMetricsGroupBy -} - -// LogAnalyticsClientGetLogAnalyticsRankingsOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsRankings -// method. -type LogAnalyticsClientGetLogAnalyticsRankingsOptions struct { - CustomDomains []string -} - -// LogAnalyticsClientGetLogAnalyticsResourcesOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsResources -// method. -type LogAnalyticsClientGetLogAnalyticsResourcesOptions struct { - // placeholder for future optional parameters -} - -// LogAnalyticsClientGetWafLogAnalyticsMetricsOptions contains the optional parameters for the LogAnalyticsClient.GetWafLogAnalyticsMetrics -// method. -type LogAnalyticsClientGetWafLogAnalyticsMetricsOptions struct { - Actions []WafAction - GroupBy []WafRankingGroupBy - RuleTypes []WafRuleType -} - -// LogAnalyticsClientGetWafLogAnalyticsRankingsOptions contains the optional parameters for the LogAnalyticsClient.GetWafLogAnalyticsRankings -// method. -type LogAnalyticsClientGetWafLogAnalyticsRankingsOptions struct { - Actions []WafAction - RuleTypes []WafRuleType -} - // LogSpecification - Log specification of operation. type LogSpecification struct { // Blob duration of specification. @@ -2237,8 +1965,8 @@ type ManagedHTTPSParameters struct { func (m *ManagedHTTPSParameters) GetCustomDomainHTTPSParameters() *CustomDomainHTTPSParameters { return &CustomDomainHTTPSParameters{ CertificateSource: m.CertificateSource, - ProtocolType: m.ProtocolType, MinimumTLSVersion: m.MinimumTLSVersion, + ProtocolType: m.ProtocolType, } } @@ -2268,7 +1996,7 @@ type ManagedRuleGroupOverride struct { // REQUIRED; Describes the managed rule group within the rule set to override RuleGroupName *string - // 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 } @@ -2350,32 +2078,24 @@ type ManagedRuleSetList struct { ManagedRuleSets []*ManagedRuleSet } -// ManagedRuleSetsClientListOptions contains the optional parameters for the ManagedRuleSetsClient.NewListPager method. -type ManagedRuleSetsClientListOptions struct { - // placeholder for future optional parameters -} - -// ManagementClientCheckEndpointNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckEndpointNameAvailability -// method. -type ManagementClientCheckEndpointNameAvailabilityOptions 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 -// ManagementClientCheckNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckNameAvailability -// method. -type ManagementClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} + // 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 -// ManagementClientCheckNameAvailabilityWithSubscriptionOptions contains the optional parameters for the ManagementClient.CheckNameAvailabilityWithSubscription -// method. -type ManagementClientCheckNameAvailabilityWithSubscriptionOptions struct { - // placeholder for future optional parameters -} + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string -// ManagementClientValidateProbeOptions contains the optional parameters for the ManagementClient.ValidateProbe method. -type ManagementClientValidateProbeOptions struct { - // placeholder for future optional parameters + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string } // MatchCondition - Define match conditions @@ -2445,7 +2165,7 @@ type MetricSpecification struct { type MetricsResponse struct { DateTimeBegin *time.Time DateTimeEnd *time.Time - Granularity *MetricsResponseGranularity + Granularity *MetricsGranularity Series []*MetricsResponseSeriesItem } @@ -2453,7 +2173,7 @@ type MetricsResponseSeriesItem struct { Data []*Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems Groups []*MetricsResponseSeriesPropertiesItemsItem Metric *string - Unit *MetricsResponseSeriesItemUnit + Unit *MetricsSeriesUnit } type MetricsResponseSeriesPropertiesItemsItem struct { @@ -2461,6 +2181,62 @@ type MetricsResponseSeriesPropertiesItemsItem struct { Value *string } +// MigrateResult - Result for migrate operation. +type MigrateResult struct { + Properties *MigrateResultProperties + + // READ-ONLY; Resource ID. + ID *string + + // READ-ONLY; Resource type. + Type *string +} + +type MigrateResultProperties struct { + // READ-ONLY; Arm resource id of the migrated profile + MigratedProfileResourceID *ResourceReference +} + +// 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 + + // READ-ONLY; Error message indicating why the operation failed. + ErrorMessage *string + + // READ-ONLY; Describes what needs to be done to fix the problem + NextSteps *string + + // READ-ONLY; Resource which has the problem. + ResourceName *string +} + +// 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 + + // REQUIRED; Name of the new profile that need to be created. + ProfileName *string + + // REQUIRED; Sku for the migration + SKU *SKU + + // Waf mapping for the migrated profile + MigrationWebApplicationFirewallMappings []*MigrationWebApplicationFirewallMapping +} + +// MigrationWebApplicationFirewallMapping - Web Application Firewall Mapping +type MigrationWebApplicationFirewallMapping struct { + // Migration From Waf policy + MigratedFrom *ResourceReference + + // Migration to Waf policy + MigratedTo *ResourceReference +} + // Operation - CDN REST API operation type Operation struct { // The object that represents the operation. @@ -2500,11 +2276,6 @@ type OperationProperties struct { ServiceSpecification *ServiceSpecification } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // OperationsListResult - Result of the request to list CDN operations. It contains a list of operations and a URL link to // get the next set of results. type OperationsListResult struct { @@ -2644,35 +2415,6 @@ type OriginGroupUpdatePropertiesParameters struct { TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 } -// OriginGroupsClientBeginCreateOptions contains the optional parameters for the OriginGroupsClient.BeginCreate method. -type OriginGroupsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OriginGroupsClientBeginDeleteOptions contains the optional parameters for the OriginGroupsClient.BeginDelete method. -type OriginGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OriginGroupsClientBeginUpdateOptions contains the optional parameters for the OriginGroupsClient.BeginUpdate method. -type OriginGroupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OriginGroupsClientGetOptions contains the optional parameters for the OriginGroupsClient.Get method. -type OriginGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// OriginGroupsClientListByEndpointOptions contains the optional parameters for the OriginGroupsClient.NewListByEndpointPager -// method. -type OriginGroupsClientListByEndpointOptions struct { - // placeholder for future optional parameters -} - // OriginListResult - Result of the request to list origins. It contains a list of origin objects and a URL link to get the // next set of results. type OriginListResult struct { @@ -2778,61 +2520,6 @@ type OriginUpdatePropertiesParameters struct { Weight *int32 } -// OriginsClientBeginCreateOptions contains the optional parameters for the OriginsClient.BeginCreate method. -type OriginsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OriginsClientBeginDeleteOptions contains the optional parameters for the OriginsClient.BeginDelete method. -type OriginsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OriginsClientBeginUpdateOptions contains the optional parameters for the OriginsClient.BeginUpdate method. -type OriginsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// OriginsClientGetOptions contains the optional parameters for the OriginsClient.Get method. -type OriginsClientGetOptions struct { - // placeholder for future optional parameters -} - -// OriginsClientListByEndpointOptions contains the optional parameters for the OriginsClient.NewListByEndpointPager method. -type OriginsClientListByEndpointOptions struct { - // placeholder for future optional parameters -} - -// PoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdate method. -type PoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PoliciesClientBeginUpdateOptions contains the optional parameters for the PoliciesClient.BeginUpdate method. -type PoliciesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PoliciesClientDeleteOptions contains the optional parameters for the PoliciesClient.Delete method. -type PoliciesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// PoliciesClientGetOptions contains the optional parameters for the PoliciesClient.Get method. -type PoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PoliciesClientListOptions contains the optional parameters for the PoliciesClient.NewListPager method. -type PoliciesClientListOptions struct { - // placeholder for future optional parameters -} - // PolicySettings - Defines contents of a web application firewall global configuration type PolicySettings struct { // If the action type is block, customer can override the response body. The body must be specified in base64 encoding. @@ -2881,6 +2568,9 @@ type Profile struct { // profile. SKU *SKU + // Managed service identity (system assigned and/or user assigned identities). + Identity *ManagedServiceIdentity + // The JSON object that contains the properties required to create a profile. Properties *ProfileProperties @@ -2903,6 +2593,15 @@ type Profile struct { Type *string } +// ProfileChangeSKUWafMapping - Parameters required for profile upgrade. +type ProfileChangeSKUWafMapping struct { + // REQUIRED; The new waf resource for the security policy to use. + ChangeToWafPolicy *ResourceReference + + // REQUIRED; The security policy name. + SecurityPolicyName *string +} + // 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 { @@ -2918,6 +2617,9 @@ type ProfileProperties struct { // Send and receive timeout on forwarding request to the origin. When timeout is reached, the request fails and returns. OriginResponseTimeoutSeconds *int32 + // READ-ONLY; Key-Value pair representing additional properties for profiles. + ExtendedProperties map[string]*string + // READ-ONLY; The Id of the frontdoor. FrontDoorID *string @@ -2936,6 +2638,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 + // The JSON object containing profile update parameters. Properties *ProfilePropertiesUpdateParameters @@ -2943,55 +2648,10 @@ type ProfileUpdateParameters struct { Tags map[string]*string } -// ProfilesClientBeginCreateOptions contains the optional parameters for the ProfilesClient.BeginCreate method. -type ProfilesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. -type ProfilesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ProfilesClientBeginUpdateOptions contains the optional parameters for the ProfilesClient.BeginUpdate method. -type ProfilesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ProfilesClientGenerateSsoURIOptions contains the optional parameters for the ProfilesClient.GenerateSsoURI method. -type ProfilesClientGenerateSsoURIOptions struct { - // placeholder for future optional parameters -} - -// ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. -type ProfilesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.NewListByResourceGroupPager -// method. -type ProfilesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ProfilesClientListOptions contains the optional parameters for the ProfilesClient.NewListPager method. -type ProfilesClientListOptions struct { - // placeholder for future optional parameters -} - -// ProfilesClientListResourceUsageOptions contains the optional parameters for the ProfilesClient.NewListResourceUsagePager -// method. -type ProfilesClientListResourceUsageOptions struct { - // placeholder for future optional parameters -} - -// ProfilesClientListSupportedOptimizationTypesOptions contains the optional parameters for the ProfilesClient.ListSupportedOptimizationTypes -// method. -type ProfilesClientListSupportedOptimizationTypesOptions struct { - // placeholder for future optional parameters +// ProfileUpgradeParameters - Parameters required for profile upgrade. +type ProfileUpgradeParameters struct { + // REQUIRED; Web Application Firewall (WAF) and security policy mapping for the profile upgrade + WafMappingList []*ProfileChangeSKUWafMapping } // ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location @@ -3235,11 +2895,6 @@ type ResourceUsage struct { Unit *ResourceUsageUnit } -// ResourceUsageClientListOptions contains the optional parameters for the ResourceUsageClient.NewListPager method. -type ResourceUsageClientListOptions struct { - // placeholder for future optional parameters -} - // ResourceUsageListResult - Output of check resource usage API. type ResourceUsageListResult struct { // URL to get the next set of custom domain objects if there are any. @@ -3421,34 +3076,6 @@ type RouteUpdatePropertiesParameters struct { EndpointName *string } -// RoutesClientBeginCreateOptions contains the optional parameters for the RoutesClient.BeginCreate method. -type RoutesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. -type RoutesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutesClientBeginUpdateOptions contains the optional parameters for the RoutesClient.BeginUpdate method. -type RoutesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutesClientGetOptions contains the optional parameters for the RoutesClient.Get method. -type RoutesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RoutesClientListByEndpointOptions contains the optional parameters for the RoutesClient.NewListByEndpointPager method. -type RoutesClientListByEndpointOptions struct { - // placeholder for future optional parameters -} - // Rule - Friendly Rules name mapping to the any Rules or secret related information. type Rule struct { // The JSON object that contains the properties of the Rules to create. @@ -3544,33 +3171,6 @@ type RuleSetProperties struct { ProvisioningState *AfdProvisioningState } -// RuleSetsClientBeginDeleteOptions contains the optional parameters for the RuleSetsClient.BeginDelete method. -type RuleSetsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RuleSetsClientCreateOptions contains the optional parameters for the RuleSetsClient.Create method. -type RuleSetsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// RuleSetsClientGetOptions contains the optional parameters for the RuleSetsClient.Get method. -type RuleSetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// RuleSetsClientListByProfileOptions contains the optional parameters for the RuleSetsClient.NewListByProfilePager method. -type RuleSetsClientListByProfileOptions struct { - // placeholder for future optional parameters -} - -// RuleSetsClientListResourceUsageOptions contains the optional parameters for the RuleSetsClient.NewListResourceUsagePager -// method. -type RuleSetsClientListResourceUsageOptions struct { - // placeholder for future optional parameters -} - // RuleUpdateParameters - The domain JSON object required for domain creation or update. type RuleUpdateParameters struct { // The JSON object that contains the properties of the rule to update. @@ -3598,34 +3198,6 @@ type RuleUpdatePropertiesParameters struct { RuleSetName *string } -// RulesClientBeginCreateOptions contains the optional parameters for the RulesClient.BeginCreate method. -type RulesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RulesClientBeginDeleteOptions contains the optional parameters for the RulesClient.BeginDelete method. -type RulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RulesClientBeginUpdateOptions contains the optional parameters for the RulesClient.BeginUpdate method. -type RulesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RulesClientGetOptions contains the optional parameters for the RulesClient.Get method. -type RulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RulesClientListByRuleSetOptions contains the optional parameters for the RulesClient.NewListByRuleSetPager method. -type RulesClientListByRuleSetOptions struct { - // placeholder for future optional parameters -} - // SKU - StandardVerizon = The SKU name for a Standard Verizon CDN profile. PremiumVerizon = The SKU name for a Premium Verizon // CDN profile. CustomVerizon = The SKU name for a Custom Verizon CDN profile. // StandardAkamai = The SKU name for an Akamai CDN profile. StandardChinaCdn = The SKU name for a China CDN profile for VOD, @@ -3690,16 +3262,6 @@ type SecretListResult struct { Value []*Secret } -// SecretParametersClassification provides polymorphic access to related types. -// Call the interface's GetSecretParameters() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureFirstPartyManagedCertificateParameters, *CustomerCertificateParameters, *ManagedCertificateParameters, *SecretParameters, -// - *URLSigningKeyParameters -type SecretParametersClassification interface { - // GetSecretParameters returns the SecretParameters content of the underlying type. - GetSecretParameters() *SecretParameters -} - // SecretParameters - The json object containing secret parameters type SecretParameters struct { // REQUIRED; The type of the secret resource. @@ -3724,57 +3286,6 @@ type SecretProperties struct { ProvisioningState *AfdProvisioningState } -// SecretsClientBeginCreateOptions contains the optional parameters for the SecretsClient.BeginCreate method. -type SecretsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecretsClientBeginDeleteOptions contains the optional parameters for the SecretsClient.BeginDelete method. -type SecretsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecretsClientGetOptions contains the optional parameters for the SecretsClient.Get method. -type SecretsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SecretsClientListByProfileOptions contains the optional parameters for the SecretsClient.NewListByProfilePager method. -type SecretsClientListByProfileOptions struct { - // placeholder for future optional parameters -} - -// SecurityPoliciesClientBeginCreateOptions contains the optional parameters for the SecurityPoliciesClient.BeginCreate method. -type SecurityPoliciesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityPoliciesClientBeginDeleteOptions contains the optional parameters for the SecurityPoliciesClient.BeginDelete method. -type SecurityPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityPoliciesClientBeginPatchOptions contains the optional parameters for the SecurityPoliciesClient.BeginPatch method. -type SecurityPoliciesClientBeginPatchOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecurityPoliciesClientGetOptions contains the optional parameters for the SecurityPoliciesClient.Get method. -type SecurityPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SecurityPoliciesClientListByProfileOptions contains the optional parameters for the SecurityPoliciesClient.NewListByProfilePager -// method. -type SecurityPoliciesClientListByProfileOptions struct { - // placeholder for future optional parameters -} - // SecurityPolicy association for AzureFrontDoor profile type SecurityPolicy struct { // The json object that contains properties required to create a security policy @@ -3818,15 +3329,6 @@ type SecurityPolicyProperties struct { ProvisioningState *AfdProvisioningState } -// SecurityPolicyPropertiesParametersClassification provides polymorphic access to related types. -// Call the interface's GetSecurityPolicyPropertiesParameters() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *SecurityPolicyPropertiesParameters, *SecurityPolicyWebApplicationFirewallParameters -type SecurityPolicyPropertiesParametersClassification interface { - // GetSecurityPolicyPropertiesParameters returns the SecurityPolicyPropertiesParameters content of the underlying type. - GetSecurityPolicyPropertiesParameters() *SecurityPolicyPropertiesParameters -} - // SecurityPolicyPropertiesParameters - The json object containing security policy parameters type SecurityPolicyPropertiesParameters struct { // REQUIRED; The type of the Security policy to create. @@ -4234,6 +3736,15 @@ type UsagesListResult struct { Value []*Usage } +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. + ClientID *string + + // READ-ONLY; The principal ID of the assigned identity. + PrincipalID *string +} + // 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. @@ -4253,16 +3764,11 @@ type UserManagedHTTPSParameters struct { func (u *UserManagedHTTPSParameters) GetCustomDomainHTTPSParameters() *CustomDomainHTTPSParameters { return &CustomDomainHTTPSParameters{ CertificateSource: u.CertificateSource, - ProtocolType: u.ProtocolType, MinimumTLSVersion: u.MinimumTLSVersion, + ProtocolType: u.ProtocolType, } } -// 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. @@ -4331,7 +3837,7 @@ type ValidationToken struct { type WafMetricsResponse struct { DateTimeBegin *time.Time DateTimeEnd *time.Time - Granularity *WafMetricsResponseGranularity + Granularity *WafMetricsGranularity Series []*WafMetricsResponseSeriesItem } @@ -4339,7 +3845,7 @@ type WafMetricsResponseSeriesItem struct { Data []*Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems Groups []*WafMetricsResponseSeriesPropertiesItemsItem Metric *string - Unit *WafMetricsResponseSeriesItemUnit + Unit *WafMetricsSeriesUnit } type WafMetricsResponseSeriesPropertiesItemsItem struct { @@ -4411,6 +3917,9 @@ type WebApplicationFirewallPolicyProperties struct { // Describes custom rules inside the policy. CustomRules *CustomRuleList + // Key-Value pair representing additional properties for Web Application Firewall policy. + ExtendedProperties map[string]*string + // Describes managed rules inside the policy. ManagedRules *ManagedRuleSetList diff --git a/sdk/resourcemanager/cdn/armcdn/models_serde.go b/sdk/resourcemanager/cdn/armcdn/models_serde.go index d7e5cd48fe9e..9181a2a49b82 100644 --- a/sdk/resourcemanager/cdn/armcdn/models_serde.go +++ b/sdk/resourcemanager/cdn/armcdn/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -131,6 +130,7 @@ func (a AFDDomainProperties) MarshalJSON() ([]byte, error) { 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) @@ -158,6 +158,9 @@ func (a *AFDDomainProperties) UnmarshalJSON(data []byte) error { 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) @@ -1072,6 +1075,12 @@ func (a *AzureFirstPartyManagedCertificate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFirstPartyManagedCertificateParameters. func (a AzureFirstPartyManagedCertificateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "certificateAuthority", a.CertificateAuthority) + populate(objectMap, "expirationDate", a.ExpirationDate) + populate(objectMap, "secretSource", a.SecretSource) + populate(objectMap, "subject", a.Subject) + populate(objectMap, "subjectAlternativeNames", a.SubjectAlternativeNames) + populate(objectMap, "thumbprint", a.Thumbprint) objectMap["type"] = SecretTypeAzureFirstPartyManagedCertificate return json.Marshal(objectMap) } @@ -1085,6 +1094,24 @@ func (a *AzureFirstPartyManagedCertificateParameters) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { + case "certificateAuthority": + err = unpopulate(val, "CertificateAuthority", &a.CertificateAuthority) + delete(rawMsg, key) + case "expirationDate": + err = unpopulate(val, "ExpirationDate", &a.ExpirationDate) + delete(rawMsg, key) + case "secretSource": + err = unpopulate(val, "SecretSource", &a.SecretSource) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &a.Subject) + delete(rawMsg, key) + case "subjectAlternativeNames": + err = unpopulate(val, "SubjectAlternativeNames", &a.SubjectAlternativeNames) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &a.Thumbprint) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) @@ -1213,6 +1240,103 @@ func (c *CacheKeyQueryStringActionParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CanMigrateParameters. +func (c CanMigrateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 CanMigrateProperties. +func (c CanMigrateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 CanMigrateProperties. +func (c *CanMigrateProperties) UnmarshalJSON(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 CanMigrateResult. +func (c CanMigrateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + 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 Certificate. func (c Certificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2186,6 +2310,68 @@ func (c *CustomerCertificateParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DeepCreatedCustomDomain. +func (d DeepCreatedCustomDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) + 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]any) @@ -4778,6 +4964,45 @@ func (m *ManagedRuleSetList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) @@ -5032,6 +5257,177 @@ func (m *MetricsResponseSeriesPropertiesItemsItem) UnmarshalJSON(data []byte) er return nil } +// MarshalJSON implements the json.Marshaller interface for type MigrateResult. +func (m MigrateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + 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 "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + 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 MigrateResultProperties. +func (m MigrateResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "migratedProfileResourceId", m.MigratedProfileResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrateResultProperties. +func (m *MigrateResultProperties) UnmarshalJSON(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 "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]any) + 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]any) + 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]any) + 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]any) @@ -5793,6 +6189,7 @@ func (p *PostArgsMatchConditionParameters) UnmarshalJSON(data []byte) error { func (p Profile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -5816,6 +6213,9 @@ func (p *Profile) UnmarshalJSON(data []byte) error { 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) @@ -5848,6 +6248,37 @@ func (p *Profile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProfileChangeSKUWafMapping. +func (p ProfileChangeSKUWafMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) @@ -5882,6 +6313,7 @@ func (p *ProfileListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProfileProperties. func (p ProfileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "extendedProperties", p.ExtendedProperties) populate(objectMap, "frontDoorId", p.FrontDoorID) populate(objectMap, "originResponseTimeoutSeconds", p.OriginResponseTimeoutSeconds) populate(objectMap, "provisioningState", p.ProvisioningState) @@ -5898,6 +6330,9 @@ func (p *ProfileProperties) UnmarshalJSON(data []byte) error { 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) @@ -5948,6 +6383,7 @@ func (p *ProfilePropertiesUpdateParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProfileUpdateParameters. func (p ProfileUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "identity", p.Identity) populate(objectMap, "properties", p.Properties) populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) @@ -5962,6 +6398,9 @@ func (p *ProfileUpdateParameters) UnmarshalJSON(data []byte) error { 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) @@ -5976,6 +6415,33 @@ func (p *ProfileUpdateParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProfileUpgradeParameters. +func (p ProfileUpgradeParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) @@ -8797,6 +9263,37 @@ func (u *UsagesListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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]any) @@ -9354,6 +9851,7 @@ func (w WebApplicationFirewallPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) 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) @@ -9377,6 +9875,9 @@ func (w *WebApplicationFirewallPolicyProperties) UnmarshalJSON(data []byte) erro 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) diff --git a/sdk/resourcemanager/cdn/armcdn/operations_client.go b/sdk/resourcemanager/cdn/armcdn/operations_client.go index d89f71bdb98f..3413b75c24a7 100644 --- a/sdk/resourcemanager/cdn/armcdn/operations_client.go +++ b/sdk/resourcemanager/cdn/armcdn/operations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available CDN REST API operations. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +77,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/operations_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/operations_client_example_test.go index 5ef750d136e2..538cca556524 100644 --- a/sdk/resourcemanager/cdn/armcdn/operations_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/operations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Operations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Operations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/options.go b/sdk/resourcemanager/cdn/armcdn/options.go new file mode 100644 index 000000000000..44aa1e609d1a --- /dev/null +++ b/sdk/resourcemanager/cdn/armcdn/options.go @@ -0,0 +1,664 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcdn + +// AFDCustomDomainsClientBeginCreateOptions contains the optional parameters for the AFDCustomDomainsClient.BeginCreate method. +type AFDCustomDomainsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDCustomDomainsClientBeginDeleteOptions contains the optional parameters for the AFDCustomDomainsClient.BeginDelete method. +type AFDCustomDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDCustomDomainsClientBeginRefreshValidationTokenOptions contains the optional parameters for the AFDCustomDomainsClient.BeginRefreshValidationToken +// method. +type AFDCustomDomainsClientBeginRefreshValidationTokenOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDCustomDomainsClientBeginUpdateOptions contains the optional parameters for the AFDCustomDomainsClient.BeginUpdate method. +type AFDCustomDomainsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDCustomDomainsClientGetOptions contains the optional parameters for the AFDCustomDomainsClient.Get method. +type AFDCustomDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AFDCustomDomainsClientListByProfileOptions contains the optional parameters for the AFDCustomDomainsClient.NewListByProfilePager +// method. +type AFDCustomDomainsClientListByProfileOptions struct { + // placeholder for future optional parameters +} + +// AFDEndpointsClientBeginCreateOptions contains the optional parameters for the AFDEndpointsClient.BeginCreate method. +type AFDEndpointsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDEndpointsClientBeginDeleteOptions contains the optional parameters for the AFDEndpointsClient.BeginDelete method. +type AFDEndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDEndpointsClientBeginPurgeContentOptions contains the optional parameters for the AFDEndpointsClient.BeginPurgeContent +// method. +type AFDEndpointsClientBeginPurgeContentOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDEndpointsClientBeginUpdateOptions contains the optional parameters for the AFDEndpointsClient.BeginUpdate method. +type AFDEndpointsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDEndpointsClientGetOptions contains the optional parameters for the AFDEndpointsClient.Get method. +type AFDEndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AFDEndpointsClientListByProfileOptions contains the optional parameters for the AFDEndpointsClient.NewListByProfilePager +// method. +type AFDEndpointsClientListByProfileOptions struct { + // placeholder for future optional parameters +} + +// AFDEndpointsClientListResourceUsageOptions contains the optional parameters for the AFDEndpointsClient.NewListResourceUsagePager +// method. +type AFDEndpointsClientListResourceUsageOptions struct { + // placeholder for future optional parameters +} + +// AFDEndpointsClientValidateCustomDomainOptions contains the optional parameters for the AFDEndpointsClient.ValidateCustomDomain +// method. +type AFDEndpointsClientValidateCustomDomainOptions struct { + // placeholder for future optional parameters +} + +// AFDOriginGroupsClientBeginCreateOptions contains the optional parameters for the AFDOriginGroupsClient.BeginCreate method. +type AFDOriginGroupsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDOriginGroupsClientBeginDeleteOptions contains the optional parameters for the AFDOriginGroupsClient.BeginDelete method. +type AFDOriginGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDOriginGroupsClientBeginUpdateOptions contains the optional parameters for the AFDOriginGroupsClient.BeginUpdate method. +type AFDOriginGroupsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDOriginGroupsClientGetOptions contains the optional parameters for the AFDOriginGroupsClient.Get method. +type AFDOriginGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AFDOriginGroupsClientListByProfileOptions contains the optional parameters for the AFDOriginGroupsClient.NewListByProfilePager +// method. +type AFDOriginGroupsClientListByProfileOptions struct { + // placeholder for future optional parameters +} + +// AFDOriginGroupsClientListResourceUsageOptions contains the optional parameters for the AFDOriginGroupsClient.NewListResourceUsagePager +// method. +type AFDOriginGroupsClientListResourceUsageOptions struct { + // placeholder for future optional parameters +} + +// AFDOriginsClientBeginCreateOptions contains the optional parameters for the AFDOriginsClient.BeginCreate method. +type AFDOriginsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDOriginsClientBeginDeleteOptions contains the optional parameters for the AFDOriginsClient.BeginDelete method. +type AFDOriginsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDOriginsClientBeginUpdateOptions contains the optional parameters for the AFDOriginsClient.BeginUpdate method. +type AFDOriginsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AFDOriginsClientGetOptions contains the optional parameters for the AFDOriginsClient.Get method. +type AFDOriginsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AFDOriginsClientListByOriginGroupOptions contains the optional parameters for the AFDOriginsClient.NewListByOriginGroupPager +// method. +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 +} + +// AFDProfilesClientCheckEndpointNameAvailabilityOptions contains the optional parameters for the AFDProfilesClient.CheckEndpointNameAvailability +// method. +type AFDProfilesClientCheckEndpointNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// AFDProfilesClientCheckHostNameAvailabilityOptions contains the optional parameters for the AFDProfilesClient.CheckHostNameAvailability +// method. +type AFDProfilesClientCheckHostNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// AFDProfilesClientListResourceUsageOptions contains the optional parameters for the AFDProfilesClient.NewListResourceUsagePager +// method. +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 +} + +// CustomDomainsClientBeginCreateOptions contains the optional parameters for the CustomDomainsClient.BeginCreate method. +type CustomDomainsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomDomainsClientBeginDeleteOptions contains the optional parameters for the CustomDomainsClient.BeginDelete method. +type CustomDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomDomainsClientBeginDisableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.BeginDisableCustomHTTPS +// method. +type CustomDomainsClientBeginDisableCustomHTTPSOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomDomainsClientBeginEnableCustomHTTPSOptions contains the optional parameters for the CustomDomainsClient.BeginEnableCustomHTTPS +// method. +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. +type CustomDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CustomDomainsClientListByEndpointOptions contains the optional parameters for the CustomDomainsClient.NewListByEndpointPager +// method. +type CustomDomainsClientListByEndpointOptions struct { + // placeholder for future optional parameters +} + +// EdgeNodesClientListOptions contains the optional parameters for the EdgeNodesClient.NewListPager method. +type EdgeNodesClientListOptions struct { + // placeholder for future optional parameters +} + +// EndpointsClientBeginCreateOptions contains the optional parameters for the EndpointsClient.BeginCreate method. +type EndpointsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EndpointsClientBeginDeleteOptions contains the optional parameters for the EndpointsClient.BeginDelete method. +type EndpointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EndpointsClientBeginLoadContentOptions contains the optional parameters for the EndpointsClient.BeginLoadContent method. +type EndpointsClientBeginLoadContentOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EndpointsClientBeginPurgeContentOptions contains the optional parameters for the EndpointsClient.BeginPurgeContent method. +type EndpointsClientBeginPurgeContentOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EndpointsClientBeginStartOptions contains the optional parameters for the EndpointsClient.BeginStart method. +type EndpointsClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EndpointsClientBeginStopOptions contains the optional parameters for the EndpointsClient.BeginStop method. +type EndpointsClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EndpointsClientBeginUpdateOptions contains the optional parameters for the EndpointsClient.BeginUpdate method. +type EndpointsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method. +type EndpointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// EndpointsClientListByProfileOptions contains the optional parameters for the EndpointsClient.NewListByProfilePager method. +type EndpointsClientListByProfileOptions struct { + // placeholder for future optional parameters +} + +// EndpointsClientListResourceUsageOptions contains the optional parameters for the EndpointsClient.NewListResourceUsagePager +// method. +type EndpointsClientListResourceUsageOptions struct { + // placeholder for future optional parameters +} + +// EndpointsClientValidateCustomDomainOptions contains the optional parameters for the EndpointsClient.ValidateCustomDomain +// method. +type EndpointsClientValidateCustomDomainOptions struct { + // placeholder for future optional parameters +} + +// LogAnalyticsClientGetLogAnalyticsLocationsOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsLocations +// method. +type LogAnalyticsClientGetLogAnalyticsLocationsOptions struct { + // placeholder for future optional parameters +} + +// LogAnalyticsClientGetLogAnalyticsMetricsOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsMetrics +// method. +type LogAnalyticsClientGetLogAnalyticsMetricsOptions struct { + Continents []string + CountryOrRegions []string + GroupBy []LogMetricsGroupBy +} + +// LogAnalyticsClientGetLogAnalyticsRankingsOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsRankings +// method. +type LogAnalyticsClientGetLogAnalyticsRankingsOptions struct { + CustomDomains []string +} + +// LogAnalyticsClientGetLogAnalyticsResourcesOptions contains the optional parameters for the LogAnalyticsClient.GetLogAnalyticsResources +// method. +type LogAnalyticsClientGetLogAnalyticsResourcesOptions struct { + // placeholder for future optional parameters +} + +// LogAnalyticsClientGetWafLogAnalyticsMetricsOptions contains the optional parameters for the LogAnalyticsClient.GetWafLogAnalyticsMetrics +// method. +type LogAnalyticsClientGetWafLogAnalyticsMetricsOptions struct { + Actions []WafAction + GroupBy []WafRankingGroupBy + RuleTypes []WafRuleType +} + +// LogAnalyticsClientGetWafLogAnalyticsRankingsOptions contains the optional parameters for the LogAnalyticsClient.GetWafLogAnalyticsRankings +// method. +type LogAnalyticsClientGetWafLogAnalyticsRankingsOptions struct { + Actions []WafAction + RuleTypes []WafRuleType +} + +// ManagedRuleSetsClientListOptions contains the optional parameters for the ManagedRuleSetsClient.NewListPager method. +type ManagedRuleSetsClientListOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientCheckEndpointNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckEndpointNameAvailability +// method. +type ManagementClientCheckEndpointNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientCheckNameAvailabilityOptions contains the optional parameters for the ManagementClient.CheckNameAvailability +// method. +type ManagementClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientCheckNameAvailabilityWithSubscriptionOptions contains the optional parameters for the ManagementClient.CheckNameAvailabilityWithSubscription +// method. +type ManagementClientCheckNameAvailabilityWithSubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientValidateProbeOptions contains the optional parameters for the ManagementClient.ValidateProbe method. +type ManagementClientValidateProbeOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// OriginGroupsClientBeginCreateOptions contains the optional parameters for the OriginGroupsClient.BeginCreate method. +type OriginGroupsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OriginGroupsClientBeginDeleteOptions contains the optional parameters for the OriginGroupsClient.BeginDelete method. +type OriginGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OriginGroupsClientBeginUpdateOptions contains the optional parameters for the OriginGroupsClient.BeginUpdate method. +type OriginGroupsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OriginGroupsClientGetOptions contains the optional parameters for the OriginGroupsClient.Get method. +type OriginGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OriginGroupsClientListByEndpointOptions contains the optional parameters for the OriginGroupsClient.NewListByEndpointPager +// method. +type OriginGroupsClientListByEndpointOptions struct { + // placeholder for future optional parameters +} + +// OriginsClientBeginCreateOptions contains the optional parameters for the OriginsClient.BeginCreate method. +type OriginsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OriginsClientBeginDeleteOptions contains the optional parameters for the OriginsClient.BeginDelete method. +type OriginsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OriginsClientBeginUpdateOptions contains the optional parameters for the OriginsClient.BeginUpdate method. +type OriginsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OriginsClientGetOptions contains the optional parameters for the OriginsClient.Get method. +type OriginsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OriginsClientListByEndpointOptions contains the optional parameters for the OriginsClient.NewListByEndpointPager method. +type OriginsClientListByEndpointOptions struct { + // placeholder for future optional parameters +} + +// PoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the PoliciesClient.BeginCreateOrUpdate method. +type PoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PoliciesClientBeginUpdateOptions contains the optional parameters for the PoliciesClient.BeginUpdate method. +type PoliciesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PoliciesClientDeleteOptions contains the optional parameters for the PoliciesClient.Delete method. +type PoliciesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// PoliciesClientGetOptions contains the optional parameters for the PoliciesClient.Get method. +type PoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PoliciesClientListOptions contains the optional parameters for the PoliciesClient.NewListPager method. +type PoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// ProfilesClientBeginCanMigrateOptions contains the optional parameters for the ProfilesClient.BeginCanMigrate method. +type ProfilesClientBeginCanMigrateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ProfilesClientBeginCreateOptions contains the optional parameters for the ProfilesClient.BeginCreate method. +type ProfilesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ProfilesClientBeginDeleteOptions contains the optional parameters for the ProfilesClient.BeginDelete method. +type ProfilesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ProfilesClientBeginMigrateOptions contains the optional parameters for the ProfilesClient.BeginMigrate method. +type ProfilesClientBeginMigrateOptions struct { + // Resumes the LRO from the provided token. + 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 +} + +// ProfilesClientGenerateSsoURIOptions contains the optional parameters for the ProfilesClient.GenerateSsoURI method. +type ProfilesClientGenerateSsoURIOptions struct { + // placeholder for future optional parameters +} + +// ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. +type ProfilesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.NewListByResourceGroupPager +// method. +type ProfilesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ProfilesClientListOptions contains the optional parameters for the ProfilesClient.NewListPager method. +type ProfilesClientListOptions struct { + // placeholder for future optional parameters +} + +// ProfilesClientListResourceUsageOptions contains the optional parameters for the ProfilesClient.NewListResourceUsagePager +// method. +type ProfilesClientListResourceUsageOptions struct { + // placeholder for future optional parameters +} + +// ProfilesClientListSupportedOptimizationTypesOptions contains the optional parameters for the ProfilesClient.ListSupportedOptimizationTypes +// method. +type ProfilesClientListSupportedOptimizationTypesOptions struct { + // placeholder for future optional parameters +} + +// ResourceUsageClientListOptions contains the optional parameters for the ResourceUsageClient.NewListPager method. +type ResourceUsageClientListOptions struct { + // placeholder for future optional parameters +} + +// RoutesClientBeginCreateOptions contains the optional parameters for the RoutesClient.BeginCreate method. +type RoutesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutesClientBeginDeleteOptions contains the optional parameters for the RoutesClient.BeginDelete method. +type RoutesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutesClientBeginUpdateOptions contains the optional parameters for the RoutesClient.BeginUpdate method. +type RoutesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutesClientGetOptions contains the optional parameters for the RoutesClient.Get method. +type RoutesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RoutesClientListByEndpointOptions contains the optional parameters for the RoutesClient.NewListByEndpointPager method. +type RoutesClientListByEndpointOptions struct { + // placeholder for future optional parameters +} + +// RuleSetsClientBeginDeleteOptions contains the optional parameters for the RuleSetsClient.BeginDelete method. +type RuleSetsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RuleSetsClientCreateOptions contains the optional parameters for the RuleSetsClient.Create method. +type RuleSetsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// RuleSetsClientGetOptions contains the optional parameters for the RuleSetsClient.Get method. +type RuleSetsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RuleSetsClientListByProfileOptions contains the optional parameters for the RuleSetsClient.NewListByProfilePager method. +type RuleSetsClientListByProfileOptions struct { + // placeholder for future optional parameters +} + +// RuleSetsClientListResourceUsageOptions contains the optional parameters for the RuleSetsClient.NewListResourceUsagePager +// method. +type RuleSetsClientListResourceUsageOptions struct { + // placeholder for future optional parameters +} + +// RulesClientBeginCreateOptions contains the optional parameters for the RulesClient.BeginCreate method. +type RulesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RulesClientBeginDeleteOptions contains the optional parameters for the RulesClient.BeginDelete method. +type RulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RulesClientBeginUpdateOptions contains the optional parameters for the RulesClient.BeginUpdate method. +type RulesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RulesClientGetOptions contains the optional parameters for the RulesClient.Get method. +type RulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RulesClientListByRuleSetOptions contains the optional parameters for the RulesClient.NewListByRuleSetPager method. +type RulesClientListByRuleSetOptions struct { + // placeholder for future optional parameters +} + +// SecretsClientBeginCreateOptions contains the optional parameters for the SecretsClient.BeginCreate method. +type SecretsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecretsClientBeginDeleteOptions contains the optional parameters for the SecretsClient.BeginDelete method. +type SecretsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecretsClientGetOptions contains the optional parameters for the SecretsClient.Get method. +type SecretsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecretsClientListByProfileOptions contains the optional parameters for the SecretsClient.NewListByProfilePager method. +type SecretsClientListByProfileOptions struct { + // placeholder for future optional parameters +} + +// SecurityPoliciesClientBeginCreateOptions contains the optional parameters for the SecurityPoliciesClient.BeginCreate method. +type SecurityPoliciesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityPoliciesClientBeginDeleteOptions contains the optional parameters for the SecurityPoliciesClient.BeginDelete method. +type SecurityPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityPoliciesClientBeginPatchOptions contains the optional parameters for the SecurityPoliciesClient.BeginPatch method. +type SecurityPoliciesClientBeginPatchOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityPoliciesClientGetOptions contains the optional parameters for the SecurityPoliciesClient.Get method. +type SecurityPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityPoliciesClientListByProfileOptions contains the optional parameters for the SecurityPoliciesClient.NewListByProfilePager +// method. +type SecurityPoliciesClientListByProfileOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/cdn/armcdn/origingroups_client.go b/sdk/resourcemanager/cdn/armcdn/origingroups_client.go index 7834b5df1fdd..10f15a80aaa5 100644 --- a/sdk/resourcemanager/cdn/armcdn/origingroups_client.go +++ b/sdk/resourcemanager/cdn/armcdn/origingroups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewOriginGroupsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Creates a new origin group within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -61,7 +60,8 @@ func (client *OriginGroupsClient) BeginCreate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[OriginGroupsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[OriginGroupsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[OriginGroupsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ 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 2023-05-01 func (client *OriginGroupsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroup OriginGroup, options *OriginGroupsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, originGroupName, originGroup, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -114,16 +116,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, originGroup) + if err := runtime.MarshalAsJSON(req, originGroup); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -136,7 +141,8 @@ func (client *OriginGroupsClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[OriginGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[OriginGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[OriginGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,20 +151,22 @@ 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 2023-05-01 func (client *OriginGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, options *OriginGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, originGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -189,7 +197,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,25 +206,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - originGroupName - Name of the origin group which is unique within the endpoint. // - options - OriginGroupsClientGetOptions contains the optional parameters for the OriginGroupsClient.Get method. func (client *OriginGroupsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, options *OriginGroupsClientGetOptions) (OriginGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, endpointName, originGroupName, options) if err != nil { return OriginGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OriginGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OriginGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OriginGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -247,7 +258,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +275,7 @@ func (client *OriginGroupsClient) getHandleResponse(resp *http.Response) (Origin // NewListByEndpointPager - Lists all of the existing origin groups within an endpoint. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -322,7 +333,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,7 +351,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -354,7 +365,8 @@ func (client *OriginGroupsClient) BeginUpdate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[OriginGroupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[OriginGroupsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[OriginGroupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -363,20 +375,22 @@ 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 2023-05-01 func (client *OriginGroupsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroupUpdateProperties OriginGroupUpdateParameters, options *OriginGroupsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -407,8 +421,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, originGroupUpdateProperties) + if err := runtime.MarshalAsJSON(req, originGroupUpdateProperties); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/origingroups_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/origingroups_client_example_test.go index eb865e5de16c..894fa444bba6 100644 --- a/sdk/resourcemanager/cdn/armcdn/origingroups_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/origingroups_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/OriginGroups_ListByEndpoint.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/OriginGroups_ListByEndpoint.json func ExampleOriginGroupsClient_NewListByEndpointPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -69,7 +69,7 @@ func ExampleOriginGroupsClient_NewListByEndpointPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/OriginGroups_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/OriginGroups_Get.json func ExampleOriginGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -117,7 +117,7 @@ func ExampleOriginGroupsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/OriginGroups_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/OriginGroups_Create.json func ExampleOriginGroupsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -181,7 +181,7 @@ func ExampleOriginGroupsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/OriginGroups_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/OriginGroups_Update.json func ExampleOriginGroupsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -237,7 +237,7 @@ func ExampleOriginGroupsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/OriginGroups_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/OriginGroups_Delete.json func ExampleOriginGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/origins_client.go b/sdk/resourcemanager/cdn/armcdn/origins_client.go index cbcfe4cdbe9f..7f3a58a14583 100644 --- a/sdk/resourcemanager/cdn/armcdn/origins_client.go +++ b/sdk/resourcemanager/cdn/armcdn/origins_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewOriginsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new origin within the specified endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -60,7 +59,8 @@ func (client *OriginsClient) BeginCreate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[OriginsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[OriginsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[OriginsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ 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 2023-05-01 func (client *OriginsClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, origin Origin, options *OriginsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, originName, origin, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -113,16 +115,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, origin) + if err := runtime.MarshalAsJSON(req, origin); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -134,7 +139,8 @@ func (client *OriginsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[OriginsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[OriginsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[OriginsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,20 +149,22 @@ 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 2023-05-01 func (client *OriginsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, options *OriginsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, originName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -187,7 +195,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,25 +204,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. // - originName - Name of the origin which is unique within the endpoint. // - options - OriginsClientGetOptions contains the optional parameters for the OriginsClient.Get method. func (client *OriginsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, options *OriginsClientGetOptions) (OriginsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, endpointName, originName, options) if err != nil { return OriginsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OriginsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OriginsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OriginsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -245,7 +256,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +273,7 @@ func (client *OriginsClient) getHandleResponse(resp *http.Response) (OriginsClie // NewListByEndpointPager - Lists all of the existing origins within an endpoint. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -320,7 +331,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,7 +349,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - endpointName - Name of the endpoint under the profile which is unique globally. @@ -351,7 +362,8 @@ func (client *OriginsClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[OriginsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[OriginsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[OriginsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -360,20 +372,22 @@ 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 2023-05-01 func (client *OriginsClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters, options *OriginsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, originName, originUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -404,8 +418,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, originUpdateProperties) + if err := runtime.MarshalAsJSON(req, originUpdateProperties); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/origins_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/origins_client_example_test.go index 68c27cacb3a8..444459d47245 100644 --- a/sdk/resourcemanager/cdn/armcdn/origins_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/origins_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Origins_ListByEndpoint.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Origins_ListByEndpoint.json func ExampleOriginsClient_NewListByEndpointPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExampleOriginsClient_NewListByEndpointPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Origins_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Origins_Get.json func ExampleOriginsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -100,7 +100,7 @@ func ExampleOriginsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Origins_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Origins_Create.json func ExampleOriginsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -157,7 +157,7 @@ func ExampleOriginsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Origins_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Origins_Update.json func ExampleOriginsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -210,7 +210,7 @@ func ExampleOriginsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Origins_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Origins_Delete.json func ExampleOriginsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/policies_client.go b/sdk/resourcemanager/cdn/armcdn/policies_client.go index 7b100a78b4d9..2cd925981130 100644 --- a/sdk/resourcemanager/cdn/armcdn/policies_client.go +++ b/sdk/resourcemanager/cdn/armcdn/policies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewPoliciesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update policy with specified rule set name within a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - cdnWebApplicationFirewallPolicy - Policy to be created. @@ -59,7 +58,8 @@ func (client *PoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[PoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PoliciesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ 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 2023-05-01 func (client *PoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicy WebApplicationFirewallPolicy, options *PoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, policyName, cdnWebApplicationFirewallPolicy, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -104,30 +106,35 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, cdnWebApplicationFirewallPolicy) + if err := runtime.MarshalAsJSON(req, cdnWebApplicationFirewallPolicy); err != nil { + return nil, err + } + return req, nil } // Delete - Deletes Policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - options - PoliciesClientDeleteOptions contains the optional parameters for the PoliciesClient.Delete method. func (client *PoliciesClient) Delete(ctx context.Context, resourceGroupName string, policyName string, options *PoliciesClientDeleteOptions) (PoliciesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, policyName, options) if err != nil { return PoliciesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PoliciesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return PoliciesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return PoliciesClientDeleteResponse{}, err } return PoliciesClientDeleteResponse{}, nil } @@ -152,7 +159,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -161,23 +168,26 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - options - PoliciesClientGetOptions contains the optional parameters for the PoliciesClient.Get method. func (client *PoliciesClient) Get(ctx context.Context, resourceGroupName string, policyName string, options *PoliciesClientGetOptions) (PoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, policyName, options) if err != nil { return PoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -200,7 +210,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,7 +227,7 @@ func (client *PoliciesClient) getHandleResponse(resp *http.Response) (PoliciesCl // NewListPager - Lists all of the protection policies within a resource group. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - options - PoliciesClientListOptions contains the optional parameters for the PoliciesClient.NewListPager method. func (client *PoliciesClient) NewListPager(resourceGroupName string, options *PoliciesClientListOptions) *runtime.Pager[PoliciesClientListResponse] { @@ -264,7 +274,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +293,7 @@ func (client *PoliciesClient) listHandleResponse(resp *http.Response) (PoliciesC // and resource group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - policyName - The name of the CdnWebApplicationFirewallPolicy. // - cdnWebApplicationFirewallPolicyPatchParameters - CdnWebApplicationFirewallPolicy parameters to be patched. @@ -294,7 +304,8 @@ func (client *PoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[PoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PoliciesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -304,20 +315,22 @@ func (client *PoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName // and resource group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *PoliciesClient) update(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicyPatchParameters WebApplicationFirewallPolicyPatchParameters, options *PoliciesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -340,8 +353,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, cdnWebApplicationFirewallPolicyPatchParameters) + if err := runtime.MarshalAsJSON(req, cdnWebApplicationFirewallPolicyPatchParameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/policies_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/policies_client_example_test.go index d72f683fb05d..af5a3c10d668 100644 --- a/sdk/resourcemanager/cdn/armcdn/policies_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/policies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/WafListPolicies.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/WafListPolicies.json func ExamplePoliciesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -271,7 +271,7 @@ func ExamplePoliciesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/WafPolicyGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/WafPolicyGet.json func ExamplePoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -406,7 +406,7 @@ func ExamplePoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/WafPolicyCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/WafPolicyCreateOrUpdate.json func ExamplePoliciesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -638,7 +638,7 @@ func ExamplePoliciesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/WafPatchPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/WafPatchPolicy.json func ExamplePoliciesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -780,7 +780,7 @@ func ExamplePoliciesClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/WafPolicyDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/WafPolicyDelete.json func ExamplePoliciesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go b/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go index 98c7c45c329e..e6ea07af0b72 100644 --- a/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go +++ b/sdk/resourcemanager/cdn/armcdn/polymorphic_helpers.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -28,7 +27,10 @@ func unmarshalCustomDomainHTTPSParametersClassification(rawMsg json.RawMessage) default: b = &CustomDomainHTTPSParameters{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDeliveryRuleActionAutoGeneratedClassification(rawMsg json.RawMessage) (DeliveryRuleActionAutoGeneratedClassification, error) { @@ -62,7 +64,10 @@ func unmarshalDeliveryRuleActionAutoGeneratedClassification(rawMsg json.RawMessa default: b = &DeliveryRuleActionAutoGenerated{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDeliveryRuleActionAutoGeneratedClassificationArray(rawMsg json.RawMessage) ([]DeliveryRuleActionAutoGeneratedClassification, error) { @@ -135,7 +140,10 @@ func unmarshalDeliveryRuleConditionClassification(rawMsg json.RawMessage) (Deliv default: b = &DeliveryRuleCondition{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDeliveryRuleConditionClassificationArray(rawMsg json.RawMessage) ([]DeliveryRuleConditionClassification, error) { @@ -178,7 +186,10 @@ func unmarshalSecretParametersClassification(rawMsg json.RawMessage) (SecretPara default: b = &SecretParameters{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalSecurityPolicyPropertiesParametersClassification(rawMsg json.RawMessage) (SecurityPolicyPropertiesParametersClassification, error) { @@ -196,5 +207,8 @@ func unmarshalSecurityPolicyPropertiesParametersClassification(rawMsg json.RawMe default: b = &SecurityPolicyPropertiesParameters{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/profiles_client.go b/sdk/resourcemanager/cdn/armcdn/profiles_client.go index 9e5507022545..39f483f5e582 100644 --- a/sdk/resourcemanager/cdn/armcdn/profiles_client.go +++ b/sdk/resourcemanager/cdn/armcdn/profiles_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -44,11 +43,80 @@ func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } +// BeginCanMigrate - Checks if CDN profile can be migrated to Azure Frontdoor(Standard/Premium) profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - Name of the Resource group within the Azure subscription. +// - canMigrateParameters - Properties needed to check if cdn profile or classic frontdoor can be migrated. +// - options - ProfilesClientBeginCanMigrateOptions contains the optional parameters for the ProfilesClient.BeginCanMigrate +// method. +func (client *ProfilesClient) BeginCanMigrate(ctx context.Context, resourceGroupName string, canMigrateParameters CanMigrateParameters, options *ProfilesClientBeginCanMigrateOptions) (*runtime.Poller[ProfilesClientCanMigrateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.canMigrate(ctx, resourceGroupName, canMigrateParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProfilesClientCanMigrateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ProfilesClientCanMigrateResponse](options.ResumeToken, client.internal.Pipeline(), 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 2023-05-01 +func (client *ProfilesClient) canMigrate(ctx context.Context, resourceGroupName string, canMigrateParameters CanMigrateParameters, options *ProfilesClientBeginCanMigrateOptions) (*http.Response, error) { + var err error + req, err := client.canMigrateCreateRequest(ctx, resourceGroupName, canMigrateParameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// canMigrateCreateRequest creates the CanMigrate request. +func (client *ProfilesClient) canMigrateCreateRequest(ctx context.Context, resourceGroupName string, canMigrateParameters CanMigrateParameters, options *ProfilesClientBeginCanMigrateOptions) (*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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, canMigrateParameters); err != nil { + return nil, err + } + return req, nil +} + // BeginCreate - Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profile with a profile name under // the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -60,7 +128,8 @@ func (client *ProfilesClient) BeginCreate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ProfilesClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ProfilesClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ProfilesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +139,22 @@ func (client *ProfilesClient) BeginCreate(ctx context.Context, resourceGroupName // specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *ProfilesClient) create(ctx context.Context, resourceGroupName string, profileName string, profile Profile, options *ProfilesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, profile, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,10 +177,13 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, profile) + if err := runtime.MarshalAsJSON(req, profile); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes an existing Azure Front Door Standard or Azure Front Door Premium or CDN profile with the specified @@ -117,7 +191,7 @@ func (client *ProfilesClient) createCreateRequest(ctx context.Context, resourceG // including endpoints, origins and custom domains. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -128,7 +202,8 @@ func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ProfilesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ProfilesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ProfilesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +214,22 @@ func (client *ProfilesClient) BeginDelete(ctx context.Context, resourceGroupName // including endpoints, origins and custom domains. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *ProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -175,7 +252,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,23 +264,26 @@ func (client *ProfilesClient) deleteCreateRequest(ctx context.Context, resourceG // profile. The SSO URI changes approximately every 10 minutes. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the CDN profile which is unique within the resource group. // - options - ProfilesClientGenerateSsoURIOptions contains the optional parameters for the ProfilesClient.GenerateSsoURI method. func (client *ProfilesClient) GenerateSsoURI(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientGenerateSsoURIOptions) (ProfilesClientGenerateSsoURIResponse, error) { + var err error req, err := client.generateSsoURICreateRequest(ctx, resourceGroupName, profileName, options) if err != nil { return ProfilesClientGenerateSsoURIResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProfilesClientGenerateSsoURIResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProfilesClientGenerateSsoURIResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProfilesClientGenerateSsoURIResponse{}, err } - return client.generateSsoURIHandleResponse(resp) + resp, err := client.generateSsoURIHandleResponse(httpResp) + return resp, err } // generateSsoURICreateRequest creates the GenerateSsoURI request. @@ -226,7 +306,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,24 +325,27 @@ func (client *ProfilesClient) generateSsoURIHandleResponse(resp *http.Response) // the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. // - options - ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method. func (client *ProfilesClient) Get(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientGetOptions) (ProfilesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, options) if err != nil { return ProfilesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProfilesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProfilesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProfilesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -285,7 +368,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,7 +385,7 @@ func (client *ProfilesClient) getHandleResponse(resp *http.Response) (ProfilesCl // NewListPager - Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within an Azure subscription. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - options - ProfilesClientListOptions contains the optional parameters for the ProfilesClient.NewListPager method. func (client *ProfilesClient) NewListPager(options *ProfilesClientListOptions) *runtime.Pager[ProfilesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProfilesClientListResponse]{ @@ -344,7 +427,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -362,7 +445,7 @@ func (client *ProfilesClient) listHandleResponse(resp *http.Response) (ProfilesC // NewListByResourceGroupPager - Lists all of the Azure Front Door Standard, Azure Front Door Premium, and CDN profiles within // a resource group. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - options - ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.NewListByResourceGroupPager // method. @@ -410,7 +493,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -428,7 +511,7 @@ func (client *ProfilesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door Standard or // Azure Front Door Premium or CDN profile. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -482,7 +565,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -501,25 +584,28 @@ func (client *ProfilesClient) listResourceUsageHandleResponse(resp *http.Respons // with an optimization type from the listed values. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. // - options - ProfilesClientListSupportedOptimizationTypesOptions contains the optional parameters for the ProfilesClient.ListSupportedOptimizationTypes // method. func (client *ProfilesClient) ListSupportedOptimizationTypes(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientListSupportedOptimizationTypesOptions) (ProfilesClientListSupportedOptimizationTypesResponse, error) { + var err error req, err := client.listSupportedOptimizationTypesCreateRequest(ctx, resourceGroupName, profileName, options) if err != nil { return ProfilesClientListSupportedOptimizationTypesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProfilesClientListSupportedOptimizationTypesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProfilesClientListSupportedOptimizationTypesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProfilesClientListSupportedOptimizationTypesResponse{}, err } - return client.listSupportedOptimizationTypesHandleResponse(resp) + resp, err := client.listSupportedOptimizationTypesHandleResponse(httpResp) + return resp, err } // listSupportedOptimizationTypesCreateRequest creates the ListSupportedOptimizationTypes request. @@ -542,7 +628,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -557,11 +643,150 @@ 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 2023-05-01 +// - resourceGroupName - Name of the Resource group within the Azure subscription. +// - migrationParameters - Properties needed to migrate the profile. +// - options - ProfilesClientBeginMigrateOptions contains the optional parameters for the ProfilesClient.BeginMigrate method. +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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProfilesClientMigrateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ProfilesClientMigrateResponse](options.ResumeToken, client.internal.Pipeline(), 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 2023-05-01 +func (client *ProfilesClient) migrate(ctx context.Context, resourceGroupName string, migrationParameters MigrationParameters, options *ProfilesClientBeginMigrateOptions) (*http.Response, error) { + var err error + req, err := client.migrateCreateRequest(ctx, resourceGroupName, migrationParameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, migrationParameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginMigrationCommit - Commit the migrated Azure Frontdoor(Standard/Premium) profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - Name of the Resource group within the Azure subscription. +// - profileName - Name of the CDN profile which is unique within the resource group. +// - options - ProfilesClientBeginMigrationCommitOptions contains the optional parameters for the ProfilesClient.BeginMigrationCommit +// 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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ProfilesClientMigrationCommitResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ProfilesClientMigrationCommitResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// MigrationCommit - Commit the migrated Azure Frontdoor(Standard/Premium) profile. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *ProfilesClient) migrationCommit(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientBeginMigrationCommitOptions) (*http.Response, error) { + var err error + req, err := client.migrationCommitCreateRequest(ctx, resourceGroupName, profileName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium or CDN profile which is unique within the // resource group. @@ -573,7 +798,8 @@ func (client *ProfilesClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ProfilesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ProfilesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ProfilesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -583,20 +809,22 @@ func (client *ProfilesClient) BeginUpdate(ctx context.Context, resourceGroupName // name under the specified subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *ProfilesClient) update(ctx context.Context, resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters, options *ProfilesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, profileUpdateParameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -619,8 +847,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, profileUpdateParameters) + if err := runtime.MarshalAsJSON(req, profileUpdateParameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go index e2779e969e91..008dc86271d4 100644 --- a/sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/profiles_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Profiles_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_List.json func ExampleProfilesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleProfilesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Profiles_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_ListByResourceGroup.json func ExampleProfilesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -146,7 +146,7 @@ func ExampleProfilesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Profiles_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_Get.json func ExampleProfilesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -184,7 +184,7 @@ func ExampleProfilesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Profiles_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_Create.json func ExampleProfilesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -231,7 +231,7 @@ func ExampleProfilesClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Profiles_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_Update.json func ExampleProfilesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -278,7 +278,7 @@ func ExampleProfilesClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Profiles_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_Delete.json func ExampleProfilesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -299,7 +299,105 @@ func ExampleProfilesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Profiles_GenerateSsoUri.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_CanMigrate.json +func ExampleProfilesClient_BeginCanMigrate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcdn.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewProfilesClient().BeginCanMigrate(ctx, "RG", armcdn.CanMigrateParameters{ + ClassicResourceReference: &armcdn.ResourceReference{ + ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.CanMigrateResult = armcdn.CanMigrateResult{ + // Type: to.Ptr("Microsoft.Cdn/canmigrate"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/yaoshitest/providers/Microsoft.Cdn/operationresults/operationid/profileresults/DummyProfile/canmigrateresults/DummyProfile"), + // Properties: &armcdn.CanMigrateProperties{ + // CanMigrate: to.Ptr(true), + // DefaultSKU: to.Ptr(armcdn.CanMigrateDefaultSKUStandardAzureFrontDoor), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_Migrate.json +func ExampleProfilesClient_BeginMigrate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcdn.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewProfilesClient().BeginMigrate(ctx, "RG", armcdn.MigrationParameters{ + ClassicResourceReference: &armcdn.ResourceReference{ + ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Network/frontdoors/frontdoorname"), + }, + ProfileName: to.Ptr("profile1"), + SKU: &armcdn.SKU{ + Name: to.Ptr(armcdn.SKUNameStandardAzureFrontDoor), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.MigrateResult = armcdn.MigrateResult{ + // Type: to.Ptr("Microsoft.Cdn/migrate"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/operationresults/operationid/profileresults/profile1/migrateresults/profile1"), + // Properties: &armcdn.MigrateResultProperties{ + // MigratedProfileResourceID: &armcdn.ResourceReference{ + // ID: to.Ptr("/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_MigrationCommit.json +func ExampleProfilesClient_BeginMigrationCommit() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcdn.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewProfilesClient().BeginMigrationCommit(ctx, "RG", "profile1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_GenerateSsoUri.json func ExampleProfilesClient_GenerateSsoURI() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -322,7 +420,7 @@ func ExampleProfilesClient_GenerateSsoURI() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Profiles_ListSupportedOptimizationTypes.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_ListSupportedOptimizationTypes.json func ExampleProfilesClient_ListSupportedOptimizationTypes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -347,7 +445,7 @@ func ExampleProfilesClient_ListSupportedOptimizationTypes() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Profiles_ListResourceUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_ListResourceUsage.json func ExampleProfilesClient_NewListResourceUsagePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go b/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go index 0d1e98554a48..7594ef6ad58b 100644 --- a/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go +++ b/sdk/resourcemanager/cdn/armcdn/resourceusage_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -46,7 +45,7 @@ func NewResourceUsageClient(subscriptionID string, credential azcore.TokenCreden // NewListPager - Check the quota and actual usage of the CDN profiles under the given subscription. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - options - ResourceUsageClientListOptions contains the optional parameters for the ResourceUsageClient.NewListPager method. func (client *ResourceUsageClient) NewListPager(options *ResourceUsageClientListOptions) *runtime.Pager[ResourceUsageClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ResourceUsageClientListResponse]{ @@ -88,7 +87,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/resourceusage_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/resourceusage_client_example_test.go index 9141018c8a40..11f03e8211f0 100644 --- a/sdk/resourcemanager/cdn/armcdn/resourceusage_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/resourceusage_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/ResourceUsage_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/ResourceUsage_List.json func ExampleResourceUsageClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/response_types.go b/sdk/resourcemanager/cdn/armcdn/response_types.go index bfeacbe7893c..cafb7e10495f 100644 --- a/sdk/resourcemanager/cdn/armcdn/response_types.go +++ b/sdk/resourcemanager/cdn/armcdn/response_types.go @@ -3,14 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn // AFDCustomDomainsClientCreateResponse contains the response from method AFDCustomDomainsClient.BeginCreate. type AFDCustomDomainsClientCreateResponse struct { + // Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. AFDDomain } @@ -21,11 +21,13 @@ type AFDCustomDomainsClientDeleteResponse struct { // AFDCustomDomainsClientGetResponse contains the response from method AFDCustomDomainsClient.Get. type AFDCustomDomainsClientGetResponse struct { + // Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. AFDDomain } // AFDCustomDomainsClientListByProfileResponse contains the response from method AFDCustomDomainsClient.NewListByProfilePager. type AFDCustomDomainsClientListByProfileResponse struct { + // Result of the request to list domains. It contains a list of domain objects and a URL link to get the next set of results. AFDDomainListResult } @@ -36,11 +38,14 @@ type AFDCustomDomainsClientRefreshValidationTokenResponse struct { // AFDCustomDomainsClientUpdateResponse contains the response from method AFDCustomDomainsClient.BeginUpdate. type AFDCustomDomainsClientUpdateResponse struct { + // Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. AFDDomain } // AFDEndpointsClientCreateResponse contains the response from method AFDEndpointsClient.BeginCreate. type AFDEndpointsClientCreateResponse struct { + // 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. AFDEndpoint } @@ -51,16 +56,20 @@ type AFDEndpointsClientDeleteResponse struct { // AFDEndpointsClientGetResponse contains the response from method AFDEndpointsClient.Get. type AFDEndpointsClientGetResponse struct { + // 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. AFDEndpoint } // AFDEndpointsClientListByProfileResponse contains the response from method AFDEndpointsClient.NewListByProfilePager. type AFDEndpointsClientListByProfileResponse struct { + // Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of results. AFDEndpointListResult } // AFDEndpointsClientListResourceUsageResponse contains the response from method AFDEndpointsClient.NewListResourceUsagePager. type AFDEndpointsClientListResourceUsageResponse struct { + // The list usages operation response. UsagesListResult } @@ -71,16 +80,21 @@ type AFDEndpointsClientPurgeContentResponse struct { // AFDEndpointsClientUpdateResponse contains the response from method AFDEndpointsClient.BeginUpdate. type AFDEndpointsClientUpdateResponse struct { + // 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. AFDEndpoint } // AFDEndpointsClientValidateCustomDomainResponse contains the response from method AFDEndpointsClient.ValidateCustomDomain. type AFDEndpointsClientValidateCustomDomainResponse struct { + // Output of custom domain validation. ValidateCustomDomainOutput } // AFDOriginGroupsClientCreateResponse contains the response from method AFDOriginGroupsClient.BeginCreate. type AFDOriginGroupsClientCreateResponse struct { + // AFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be served from Azure + // Front Door. AFDOriginGroup } @@ -91,26 +105,35 @@ type AFDOriginGroupsClientDeleteResponse struct { // AFDOriginGroupsClientGetResponse contains the response from method AFDOriginGroupsClient.Get. type AFDOriginGroupsClientGetResponse struct { + // AFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be served from Azure + // Front Door. AFDOriginGroup } // AFDOriginGroupsClientListByProfileResponse contains the response from method AFDOriginGroupsClient.NewListByProfilePager. type AFDOriginGroupsClientListByProfileResponse struct { + // Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the next + // set of results. AFDOriginGroupListResult } // AFDOriginGroupsClientListResourceUsageResponse contains the response from method AFDOriginGroupsClient.NewListResourceUsagePager. type AFDOriginGroupsClientListResourceUsageResponse struct { + // The list usages operation response. UsagesListResult } // AFDOriginGroupsClientUpdateResponse contains the response from method AFDOriginGroupsClient.BeginUpdate. type AFDOriginGroupsClientUpdateResponse struct { + // AFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be served from Azure + // Front Door. AFDOriginGroup } // AFDOriginsClientCreateResponse contains the response from method AFDOriginsClient.BeginCreate. type AFDOriginsClientCreateResponse struct { + // 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. AFDOrigin } @@ -121,66 +144,102 @@ type AFDOriginsClientDeleteResponse struct { // AFDOriginsClientGetResponse contains the response from method AFDOriginsClient.Get. type AFDOriginsClientGetResponse struct { + // 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. AFDOrigin } // AFDOriginsClientListByOriginGroupResponse contains the response from method AFDOriginsClient.NewListByOriginGroupPager. type AFDOriginsClientListByOriginGroupResponse struct { + // Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of results. AFDOriginListResult } // AFDOriginsClientUpdateResponse contains the response from method AFDOriginsClient.BeginUpdate. type AFDOriginsClientUpdateResponse struct { + // 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. AFDOrigin } +// AFDProfilesClientCheckEndpointNameAvailabilityResponse contains the response from method AFDProfilesClient.CheckEndpointNameAvailability. +type AFDProfilesClientCheckEndpointNameAvailabilityResponse struct { + // Output of check name availability API. + CheckEndpointNameAvailabilityOutput +} + // AFDProfilesClientCheckHostNameAvailabilityResponse contains the response from method AFDProfilesClient.CheckHostNameAvailability. type AFDProfilesClientCheckHostNameAvailabilityResponse struct { + // Output of check name availability API. CheckNameAvailabilityOutput } // AFDProfilesClientListResourceUsageResponse contains the response from method AFDProfilesClient.NewListResourceUsagePager. type AFDProfilesClientListResourceUsageResponse struct { + // The list usages operation response. UsagesListResult } +// AFDProfilesClientUpgradeResponse contains the response from method AFDProfilesClient.BeginUpgrade. +type AFDProfilesClientUpgradeResponse struct { + // A profile is a logical grouping of endpoints that share the same settings. + Profile +} + +// AFDProfilesClientValidateSecretResponse contains the response from method AFDProfilesClient.ValidateSecret. +type AFDProfilesClientValidateSecretResponse struct { + // Output of the validated secret. + ValidateSecretOutput +} + // CustomDomainsClientCreateResponse contains the response from method CustomDomainsClient.BeginCreate. type CustomDomainsClientCreateResponse struct { + // Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. CustomDomain } // CustomDomainsClientDeleteResponse contains the response from method CustomDomainsClient.BeginDelete. type CustomDomainsClientDeleteResponse struct { + // Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. CustomDomain } -// CustomDomainsClientDisableCustomHTTPSResponse contains the response from method CustomDomainsClient.DisableCustomHTTPS. +// CustomDomainsClientDisableCustomHTTPSResponse contains the response from method CustomDomainsClient.BeginDisableCustomHTTPS. type CustomDomainsClientDisableCustomHTTPSResponse struct { + // Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. CustomDomain } -// CustomDomainsClientEnableCustomHTTPSResponse contains the response from method CustomDomainsClient.EnableCustomHTTPS. +// CustomDomainsClientEnableCustomHTTPSResponse contains the response from method CustomDomainsClient.BeginEnableCustomHTTPS. type CustomDomainsClientEnableCustomHTTPSResponse struct { + // Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. CustomDomain } // CustomDomainsClientGetResponse contains the response from method CustomDomainsClient.Get. type CustomDomainsClientGetResponse struct { + // Friendly domain name mapping to the endpoint hostname that the customer provides for branding purposes, e.g. www.contoso.com. CustomDomain } // CustomDomainsClientListByEndpointResponse contains the response from method CustomDomainsClient.NewListByEndpointPager. type CustomDomainsClientListByEndpointResponse struct { + // Result of the request to list custom domains. It contains a list of custom domain objects and a URL link to get the next + // set of results. CustomDomainListResult } // EdgeNodesClientListResponse contains the response from method EdgeNodesClient.NewListPager. type EdgeNodesClientListResponse struct { + // Result of the request to list CDN edgenodes. It contains a list of ip address group and a URL link to get the next set + // of results. EdgenodeResult } // EndpointsClientCreateResponse contains the response from method EndpointsClient.BeginCreate. type EndpointsClientCreateResponse struct { + // CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content + // caching and delivery behavior. The CDN endpoint uses the URL format .azureedge.net. Endpoint } @@ -191,16 +250,20 @@ type EndpointsClientDeleteResponse struct { // EndpointsClientGetResponse contains the response from method EndpointsClient.Get. type EndpointsClientGetResponse struct { + // CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content + // caching and delivery behavior. The CDN endpoint uses the URL format .azureedge.net. Endpoint } // EndpointsClientListByProfileResponse contains the response from method EndpointsClient.NewListByProfilePager. type EndpointsClientListByProfileResponse struct { + // Result of the request to list endpoints. It contains a list of endpoint objects and a URL link to get the next set of results. EndpointListResult } // EndpointsClientListResourceUsageResponse contains the response from method EndpointsClient.NewListResourceUsagePager. type EndpointsClientListResourceUsageResponse struct { + // Output of check resource usage API. ResourceUsageListResult } @@ -216,86 +279,106 @@ type EndpointsClientPurgeContentResponse struct { // EndpointsClientStartResponse contains the response from method EndpointsClient.BeginStart. type EndpointsClientStartResponse struct { + // CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content + // caching and delivery behavior. The CDN endpoint uses the URL format .azureedge.net. Endpoint } // EndpointsClientStopResponse contains the response from method EndpointsClient.BeginStop. type EndpointsClientStopResponse struct { + // CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content + // caching and delivery behavior. The CDN endpoint uses the URL format .azureedge.net. Endpoint } // EndpointsClientUpdateResponse contains the response from method EndpointsClient.BeginUpdate. type EndpointsClientUpdateResponse struct { + // CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content + // caching and delivery behavior. The CDN endpoint uses the URL format .azureedge.net. Endpoint } // EndpointsClientValidateCustomDomainResponse contains the response from method EndpointsClient.ValidateCustomDomain. type EndpointsClientValidateCustomDomainResponse struct { + // Output of custom domain validation. ValidateCustomDomainOutput } // LogAnalyticsClientGetLogAnalyticsLocationsResponse contains the response from method LogAnalyticsClient.GetLogAnalyticsLocations. type LogAnalyticsClientGetLogAnalyticsLocationsResponse struct { + // Continents Response ContinentsResponse } // LogAnalyticsClientGetLogAnalyticsMetricsResponse contains the response from method LogAnalyticsClient.GetLogAnalyticsMetrics. type LogAnalyticsClientGetLogAnalyticsMetricsResponse struct { + // Metrics Response MetricsResponse } // LogAnalyticsClientGetLogAnalyticsRankingsResponse contains the response from method LogAnalyticsClient.GetLogAnalyticsRankings. type LogAnalyticsClientGetLogAnalyticsRankingsResponse struct { + // Rankings Response RankingsResponse } // LogAnalyticsClientGetLogAnalyticsResourcesResponse contains the response from method LogAnalyticsClient.GetLogAnalyticsResources. type LogAnalyticsClientGetLogAnalyticsResourcesResponse struct { + // Resources Response ResourcesResponse } // LogAnalyticsClientGetWafLogAnalyticsMetricsResponse contains the response from method LogAnalyticsClient.GetWafLogAnalyticsMetrics. type LogAnalyticsClientGetWafLogAnalyticsMetricsResponse struct { + // Waf Metrics Response WafMetricsResponse } // LogAnalyticsClientGetWafLogAnalyticsRankingsResponse contains the response from method LogAnalyticsClient.GetWafLogAnalyticsRankings. type LogAnalyticsClientGetWafLogAnalyticsRankingsResponse struct { + // Waf Rankings Response WafRankingsResponse } // ManagedRuleSetsClientListResponse contains the response from method ManagedRuleSetsClient.NewListPager. type ManagedRuleSetsClientListResponse struct { + // List of managed rule set definitions available for use in a policy. ManagedRuleSetDefinitionList } // ManagementClientCheckEndpointNameAvailabilityResponse contains the response from method ManagementClient.CheckEndpointNameAvailability. type ManagementClientCheckEndpointNameAvailabilityResponse struct { + // Output of check name availability API. CheckEndpointNameAvailabilityOutput } // ManagementClientCheckNameAvailabilityResponse contains the response from method ManagementClient.CheckNameAvailability. type ManagementClientCheckNameAvailabilityResponse struct { + // Output of check name availability API. CheckNameAvailabilityOutput } // ManagementClientCheckNameAvailabilityWithSubscriptionResponse contains the response from method ManagementClient.CheckNameAvailabilityWithSubscription. type ManagementClientCheckNameAvailabilityWithSubscriptionResponse struct { + // Output of check name availability API. CheckNameAvailabilityOutput } // ManagementClientValidateProbeResponse contains the response from method ManagementClient.ValidateProbe. type ManagementClientValidateProbeResponse struct { + // Output of the validate probe API. ValidateProbeOutput } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. OperationsListResult } // OriginGroupsClientCreateResponse contains the response from method OriginGroupsClient.BeginCreate. type OriginGroupsClientCreateResponse struct { + // Origin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. OriginGroup } @@ -306,21 +389,27 @@ type OriginGroupsClientDeleteResponse struct { // OriginGroupsClientGetResponse contains the response from method OriginGroupsClient.Get. type OriginGroupsClientGetResponse struct { + // Origin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. OriginGroup } // OriginGroupsClientListByEndpointResponse contains the response from method OriginGroupsClient.NewListByEndpointPager. type OriginGroupsClientListByEndpointResponse struct { + // Result of the request to list origin groups. It contains a list of origin groups objects and a URL link to get the next + // set of results. OriginGroupListResult } // OriginGroupsClientUpdateResponse contains the response from method OriginGroupsClient.BeginUpdate. type OriginGroupsClientUpdateResponse struct { + // Origin group comprising of origins is used for load balancing to origins when the content cannot be served from CDN. OriginGroup } // OriginsClientCreateResponse contains the response from method OriginsClient.BeginCreate. type OriginsClientCreateResponse struct { + // CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not + // have the requested content cached, they attempt to fetch it from one or more of the configured origins. Origin } @@ -331,21 +420,27 @@ type OriginsClientDeleteResponse struct { // OriginsClientGetResponse contains the response from method OriginsClient.Get. type OriginsClientGetResponse struct { + // CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not + // have the requested content cached, they attempt to fetch it from one or more of the configured origins. Origin } // OriginsClientListByEndpointResponse contains the response from method OriginsClient.NewListByEndpointPager. type OriginsClientListByEndpointResponse struct { + // Result of the request to list origins. It contains a list of origin objects and a URL link to get the next set of results. OriginListResult } // OriginsClientUpdateResponse contains the response from method OriginsClient.BeginUpdate. type OriginsClientUpdateResponse struct { + // CDN origin is the source of the content being delivered via CDN. When the edge nodes represented by an endpoint do not + // have the requested content cached, they attempt to fetch it from one or more of the configured origins. Origin } // PoliciesClientCreateOrUpdateResponse contains the response from method PoliciesClient.BeginCreateOrUpdate. type PoliciesClientCreateOrUpdateResponse struct { + // Defines web application firewall policy for Azure CDN. WebApplicationFirewallPolicy } @@ -356,21 +451,32 @@ type PoliciesClientDeleteResponse struct { // PoliciesClientGetResponse contains the response from method PoliciesClient.Get. type PoliciesClientGetResponse struct { + // Defines web application firewall policy for Azure CDN. WebApplicationFirewallPolicy } // PoliciesClientListResponse contains the response from method PoliciesClient.NewListPager. type PoliciesClientListResponse struct { + // Defines a list of WebApplicationFirewallPolicies for Azure CDN. It contains a list of WebApplicationFirewallPolicy objects + // and a URL link to get the next set of results. WebApplicationFirewallPolicyList } // PoliciesClientUpdateResponse contains the response from method PoliciesClient.BeginUpdate. type PoliciesClientUpdateResponse struct { + // Defines web application firewall policy for Azure CDN. WebApplicationFirewallPolicy } +// ProfilesClientCanMigrateResponse contains the response from method ProfilesClient.BeginCanMigrate. +type ProfilesClientCanMigrateResponse struct { + // Result for canMigrate operation. + CanMigrateResult +} + // ProfilesClientCreateResponse contains the response from method ProfilesClient.BeginCreate. type ProfilesClientCreateResponse struct { + // A profile is a logical grouping of endpoints that share the same settings. Profile } @@ -381,46 +487,66 @@ type ProfilesClientDeleteResponse struct { // ProfilesClientGenerateSsoURIResponse contains the response from method ProfilesClient.GenerateSsoURI. type ProfilesClientGenerateSsoURIResponse struct { + // The URI required to login to the supplemental portal from the Azure portal. SsoURI } // ProfilesClientGetResponse contains the response from method ProfilesClient.Get. type ProfilesClientGetResponse struct { + // A profile is a logical grouping of endpoints that share the same settings. Profile } // ProfilesClientListByResourceGroupResponse contains the response from method ProfilesClient.NewListByResourceGroupPager. type ProfilesClientListByResourceGroupResponse struct { + // Result of the request to list profiles. It contains a list of profile objects and a URL link to get the next set of results. ProfileListResult } // ProfilesClientListResourceUsageResponse contains the response from method ProfilesClient.NewListResourceUsagePager. type ProfilesClientListResourceUsageResponse struct { + // Output of check resource usage API. ResourceUsageListResult } // ProfilesClientListResponse contains the response from method ProfilesClient.NewListPager. type ProfilesClientListResponse struct { + // Result of the request to list profiles. It contains a list of profile objects and a URL link to get the next set of results. ProfileListResult } // ProfilesClientListSupportedOptimizationTypesResponse contains the response from method ProfilesClient.ListSupportedOptimizationTypes. type ProfilesClientListSupportedOptimizationTypesResponse struct { + // The result of the GetSupportedOptimizationTypes API SupportedOptimizationTypesListResult } +// ProfilesClientMigrateResponse contains the response from method ProfilesClient.BeginMigrate. +type ProfilesClientMigrateResponse struct { + // Result for migrate operation. + MigrateResult +} + +// ProfilesClientMigrationCommitResponse contains the response from method ProfilesClient.BeginMigrationCommit. +type ProfilesClientMigrationCommitResponse struct { + // placeholder for future response values +} + // ProfilesClientUpdateResponse contains the response from method ProfilesClient.BeginUpdate. type ProfilesClientUpdateResponse struct { + // A profile is a logical grouping of endpoints that share the same settings. Profile } // ResourceUsageClientListResponse contains the response from method ResourceUsageClient.NewListPager. type ResourceUsageClientListResponse struct { + // Output of check resource usage API. ResourceUsageListResult } // RoutesClientCreateResponse contains the response from method RoutesClient.BeginCreate. type RoutesClientCreateResponse struct { + // Friendly Routes name mapping to the any Routes or secret related information. Route } @@ -431,21 +557,25 @@ type RoutesClientDeleteResponse struct { // RoutesClientGetResponse contains the response from method RoutesClient.Get. type RoutesClientGetResponse struct { + // Friendly Routes name mapping to the any Routes or secret related information. Route } // RoutesClientListByEndpointResponse contains the response from method RoutesClient.NewListByEndpointPager. type RoutesClientListByEndpointResponse struct { + // Result of the request to list routes. It contains a list of route objects and a URL link to get the next set of results. RouteListResult } // RoutesClientUpdateResponse contains the response from method RoutesClient.BeginUpdate. type RoutesClientUpdateResponse struct { + // Friendly Routes name mapping to the any Routes or secret related information. Route } // RuleSetsClientCreateResponse contains the response from method RuleSetsClient.Create. type RuleSetsClientCreateResponse struct { + // Friendly RuleSet name mapping to the any RuleSet or secret related information. RuleSet } @@ -456,21 +586,25 @@ type RuleSetsClientDeleteResponse struct { // RuleSetsClientGetResponse contains the response from method RuleSetsClient.Get. type RuleSetsClientGetResponse struct { + // Friendly RuleSet name mapping to the any RuleSet or secret related information. RuleSet } // RuleSetsClientListByProfileResponse contains the response from method RuleSetsClient.NewListByProfilePager. type RuleSetsClientListByProfileResponse struct { + // Result of the request to list rule sets. It contains a list of rule set objects and a URL link to get the next set of results. RuleSetListResult } // RuleSetsClientListResourceUsageResponse contains the response from method RuleSetsClient.NewListResourceUsagePager. type RuleSetsClientListResourceUsageResponse struct { + // The list usages operation response. UsagesListResult } // RulesClientCreateResponse contains the response from method RulesClient.BeginCreate. type RulesClientCreateResponse struct { + // Friendly Rules name mapping to the any Rules or secret related information. Rule } @@ -481,21 +615,25 @@ type RulesClientDeleteResponse struct { // RulesClientGetResponse contains the response from method RulesClient.Get. type RulesClientGetResponse struct { + // Friendly Rules name mapping to the any Rules or secret related information. Rule } // RulesClientListByRuleSetResponse contains the response from method RulesClient.NewListByRuleSetPager. type RulesClientListByRuleSetResponse struct { + // Result of the request to list rules. It contains a list of rule objects and a URL link to get the next set of results. RuleListResult } // RulesClientUpdateResponse contains the response from method RulesClient.BeginUpdate. type RulesClientUpdateResponse struct { + // Friendly Rules name mapping to the any Rules or secret related information. Rule } // SecretsClientCreateResponse contains the response from method SecretsClient.BeginCreate. type SecretsClientCreateResponse struct { + // Friendly Secret name mapping to the any Secret or secret related information. Secret } @@ -506,16 +644,19 @@ type SecretsClientDeleteResponse struct { // SecretsClientGetResponse contains the response from method SecretsClient.Get. type SecretsClientGetResponse struct { + // Friendly Secret name mapping to the any Secret or secret related information. Secret } // SecretsClientListByProfileResponse contains the response from method SecretsClient.NewListByProfilePager. type SecretsClientListByProfileResponse struct { + // Result of the request to list secrets. It contains a list of Secret objects and a URL link to get the next set of results. SecretListResult } // SecurityPoliciesClientCreateResponse contains the response from method SecurityPoliciesClient.BeginCreate. type SecurityPoliciesClientCreateResponse struct { + // SecurityPolicy association for AzureFrontDoor profile SecurityPolicy } @@ -526,20 +667,19 @@ type SecurityPoliciesClientDeleteResponse struct { // SecurityPoliciesClientGetResponse contains the response from method SecurityPoliciesClient.Get. type SecurityPoliciesClientGetResponse struct { + // SecurityPolicy association for AzureFrontDoor profile SecurityPolicy } // SecurityPoliciesClientListByProfileResponse contains the response from method SecurityPoliciesClient.NewListByProfilePager. type SecurityPoliciesClientListByProfileResponse struct { + // Result of the request to list security policies. It contains a list of security policy objects and a URL link to get the + // next set of results. SecurityPolicyListResult } // SecurityPoliciesClientPatchResponse contains the response from method SecurityPoliciesClient.BeginPatch. type SecurityPoliciesClientPatchResponse struct { + // SecurityPolicy association for AzureFrontDoor profile SecurityPolicy } - -// ValidateClientSecretResponse contains the response from method ValidateClient.Secret. -type ValidateClientSecretResponse struct { - ValidateSecretOutput -} diff --git a/sdk/resourcemanager/cdn/armcdn/routes_client.go b/sdk/resourcemanager/cdn/armcdn/routes_client.go index 90e9d622a360..c5e1253f9359 100644 --- a/sdk/resourcemanager/cdn/armcdn/routes_client.go +++ b/sdk/resourcemanager/cdn/armcdn/routes_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -48,7 +47,7 @@ func NewRoutesClient(subscriptionID string, credential azcore.TokenCredential, o // and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -62,9 +61,10 @@ func (client *RoutesClient) BeginCreate(ctx context.Context, resourceGroupName s if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RoutesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,20 +74,22 @@ func (client *RoutesClient) BeginCreate(ctx context.Context, resourceGroupName s // AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *RoutesClient) create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, route Route, options *RoutesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, endpointName, routeName, route, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -118,17 +120,20 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, route) + if err := runtime.MarshalAsJSON(req, route); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -141,9 +146,10 @@ func (client *RoutesClient) BeginDelete(ctx context.Context, resourceGroupName s if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RoutesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -153,20 +159,22 @@ func (client *RoutesClient) BeginDelete(ctx context.Context, resourceGroupName s // and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *RoutesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, options *RoutesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, endpointName, routeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -197,7 +205,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +215,7 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro // AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -215,18 +223,21 @@ func (client *RoutesClient) deleteCreateRequest(ctx context.Context, resourceGro // - routeName - Name of the routing rule. // - options - RoutesClientGetOptions contains the optional parameters for the RoutesClient.Get method. func (client *RoutesClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, options *RoutesClientGetOptions) (RoutesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, endpointName, routeName, options) if err != nil { return RoutesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RoutesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoutesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RoutesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -257,7 +268,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,7 +285,7 @@ func (client *RoutesClient) getHandleResponse(resp *http.Response) (RoutesClient // NewListByEndpointPager - Lists all of the existing origins within a profile. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -333,7 +344,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +363,7 @@ func (client *RoutesClient) listByEndpointHandleResponse(resp *http.Response) (R // profile, and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -366,9 +377,10 @@ func (client *RoutesClient) BeginUpdate(ctx context.Context, resourceGroupName s if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RoutesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -378,20 +390,22 @@ func (client *RoutesClient) BeginUpdate(ctx context.Context, resourceGroupName s // and AzureFrontDoor endpoint. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *RoutesClient) update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, routeName string, routeUpdateProperties RouteUpdateParameters, options *RoutesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, endpointName, routeName, routeUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -422,8 +436,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, routeUpdateProperties) + if err := runtime.MarshalAsJSON(req, routeUpdateProperties); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/routes_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/routes_client_example_test.go index 59f7ea613d82..b44a03fe5287 100644 --- a/sdk/resourcemanager/cdn/armcdn/routes_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/routes_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Routes_ListByEndpoint.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Routes_ListByEndpoint.json func ExampleRoutesClient_NewListByEndpointPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -84,7 +84,7 @@ func ExampleRoutesClient_NewListByEndpointPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Routes_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Routes_Get.json func ExampleRoutesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -142,7 +142,7 @@ func ExampleRoutesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Routes_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Routes_Create.json func ExampleRoutesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -238,7 +238,7 @@ func ExampleRoutesClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Routes_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Routes_Update.json func ExampleRoutesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -332,7 +332,7 @@ func ExampleRoutesClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Routes_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Routes_Delete.json func ExampleRoutesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/rules_client.go b/sdk/resourcemanager/cdn/armcdn/rules_client.go index 0b802ba170ef..c9fb434c3582 100644 --- a/sdk/resourcemanager/cdn/armcdn/rules_client.go +++ b/sdk/resourcemanager/cdn/armcdn/rules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewRulesClient(subscriptionID string, credential azcore.TokenCredential, op // BeginCreate - Creates a new delivery rule within the specified rule set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -61,9 +60,10 @@ func (client *RulesClient) BeginCreate(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RulesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RulesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RulesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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 2023-05-01 func (client *RulesClient) create(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, rule Rule, options *RulesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, ruleName, rule, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -116,16 +118,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, rule) + if err := runtime.MarshalAsJSON(req, rule); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -138,9 +143,10 @@ func (client *RulesClient) BeginDelete(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -149,20 +155,22 @@ 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 2023-05-01 func (client *RulesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, options *RulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, ruleName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -193,7 +201,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +210,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -210,18 +218,21 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou // - ruleName - Name of the delivery rule which is unique within the endpoint. // - options - RulesClientGetOptions contains the optional parameters for the RulesClient.Get method. func (client *RulesClient) Get(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, options *RulesClientGetOptions) (RulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, ruleName, options) if err != nil { return RulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -252,7 +263,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +280,7 @@ func (client *RulesClient) getHandleResponse(resp *http.Response) (RulesClientGe // NewListByRuleSetPager - Lists all of the existing delivery rules within a rule set. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -327,7 +338,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +356,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -359,9 +370,10 @@ func (client *RulesClient) BeginUpdate(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RulesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RulesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RulesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -370,20 +382,22 @@ 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 2023-05-01 func (client *RulesClient) update(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, ruleName string, ruleUpdateProperties RuleUpdateParameters, options *RulesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, ruleName, ruleUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -414,8 +428,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, ruleUpdateProperties) + if err := runtime.MarshalAsJSON(req, ruleUpdateProperties); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/rules_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/rules_client_example_test.go index 1ea0d2c730f4..eebdc01edfaf 100644 --- a/sdk/resourcemanager/cdn/armcdn/rules_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/rules_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Rules_ListByRuleSet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Rules_ListByRuleSet.json func ExampleRulesClient_NewListByRuleSetPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -80,7 +80,7 @@ func ExampleRulesClient_NewListByRuleSetPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Rules_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Rules_Get.json func ExampleRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -134,7 +134,7 @@ func ExampleRulesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Rules_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Rules_Create.json func ExampleRulesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -217,7 +217,7 @@ func ExampleRulesClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Rules_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Rules_Update.json func ExampleRulesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -289,7 +289,7 @@ func ExampleRulesClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Rules_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Rules_Delete.json func ExampleRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/rulesets_client.go b/sdk/resourcemanager/cdn/armcdn/rulesets_client.go index 331d6d73f1d6..686efbf20f16 100644 --- a/sdk/resourcemanager/cdn/armcdn/rulesets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/rulesets_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,25 +46,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. // - ruleSetName - Name of the rule set under the profile which is unique globally // - options - RuleSetsClientCreateOptions contains the optional parameters for the RuleSetsClient.Create method. func (client *RuleSetsClient) Create(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientCreateOptions) (RuleSetsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, options) if err != nil { return RuleSetsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RuleSetsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return RuleSetsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return RuleSetsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -92,7 +94,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +113,7 @@ func (client *RuleSetsClient) createHandleResponse(resp *http.Response) (RuleSet // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -123,9 +125,10 @@ func (client *RuleSetsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RuleSetsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RuleSetsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RuleSetsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -135,20 +138,22 @@ func (client *RuleSetsClient) BeginDelete(ctx context.Context, resourceGroupName // resource group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 func (client *RuleSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -175,7 +180,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,25 +190,28 @@ func (client *RuleSetsClient) deleteCreateRequest(ctx context.Context, resourceG // group and profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. // - ruleSetName - Name of the rule set under the profile which is unique globally. // - options - RuleSetsClientGetOptions contains the optional parameters for the RuleSetsClient.Get method. func (client *RuleSetsClient) Get(ctx context.Context, resourceGroupName string, profileName string, ruleSetName string, options *RuleSetsClientGetOptions) (RuleSetsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, ruleSetName, options) if err != nil { return RuleSetsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RuleSetsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RuleSetsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RuleSetsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -230,7 +238,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,7 +255,7 @@ func (client *RuleSetsClient) getHandleResponse(resp *http.Response) (RuleSetsCl // NewListByProfilePager - Lists existing AzureFrontDoor rule sets within a profile. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -301,7 +309,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,10 +324,9 @@ 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. +// NewListResourceUsagePager - Checks the quota and actual usage of endpoints under the given Azure Front Door profile.. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -378,7 +385,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/rulesets_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/rulesets_client_example_test.go index 7ad7b31c5d39..699c87db5688 100644 --- a/sdk/resourcemanager/cdn/armcdn/rulesets_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/rulesets_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/RuleSets_ListByProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/RuleSets_ListByProfile.json func ExampleRuleSetsClient_NewListByProfilePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -54,7 +54,7 @@ func ExampleRuleSetsClient_NewListByProfilePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/RuleSets_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/RuleSets_Get.json func ExampleRuleSetsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,7 +83,7 @@ func ExampleRuleSetsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/RuleSets_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/RuleSets_Create.json func ExampleRuleSetsClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -112,7 +112,7 @@ func ExampleRuleSetsClient_Create() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/RuleSets_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/RuleSets_Delete.json func ExampleRuleSetsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -133,7 +133,7 @@ func ExampleRuleSetsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/RuleSets_ListResourceUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/RuleSets_ListResourceUsage.json func ExampleRuleSetsClient_NewListResourceUsagePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/secrets_client.go b/sdk/resourcemanager/cdn/armcdn/secrets_client.go index b501741e6b8f..1a583e6a8180 100644 --- a/sdk/resourcemanager/cdn/armcdn/secrets_client.go +++ b/sdk/resourcemanager/cdn/armcdn/secrets_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewSecretsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new Secret within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -60,9 +59,10 @@ func (client *SecretsClient) BeginCreate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SecretsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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 2023-05-01 func (client *SecretsClient) create(ctx context.Context, resourceGroupName string, profileName string, secretName string, secret Secret, options *SecretsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, secretName, secret, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -111,16 +113,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, secret) + if err := runtime.MarshalAsJSON(req, secret); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -132,9 +137,10 @@ func (client *SecretsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SecretsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,20 +149,22 @@ 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 2023-05-01 func (client *SecretsClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, secretName string, options *SecretsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, secretName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -183,7 +191,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,25 +200,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. // - secretName - Name of the Secret under the profile. // - options - SecretsClientGetOptions contains the optional parameters for the SecretsClient.Get method. func (client *SecretsClient) Get(ctx context.Context, resourceGroupName string, profileName string, secretName string, options *SecretsClientGetOptions) (SecretsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, secretName, options) if err != nil { return SecretsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SecretsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecretsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecretsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -237,7 +248,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +265,7 @@ func (client *SecretsClient) getHandleResponse(resp *http.Response) (SecretsClie // NewListByProfilePager - Lists existing AzureFrontDoor secrets. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -308,7 +319,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cdn/armcdn/secrets_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/secrets_client_example_test.go index 5c92805a4971..deeb88930cdd 100644 --- a/sdk/resourcemanager/cdn/armcdn/secrets_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/secrets_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Secrets_ListByProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Secrets_ListByProfile.json func ExampleSecretsClient_NewListByProfilePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -84,7 +84,7 @@ func ExampleSecretsClient_NewListByProfilePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Secrets_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Secrets_Get.json func ExampleSecretsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleSecretsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Secrets_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Secrets_Create.json func ExampleSecretsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -187,7 +187,7 @@ func ExampleSecretsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/Secrets_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Secrets_Delete.json func ExampleSecretsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go index ee29ac5a2386..c74a8569892c 100644 --- a/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go +++ b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn @@ -47,7 +46,7 @@ func NewSecurityPoliciesClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Creates a new security policy within the specified profile. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -61,9 +60,10 @@ func (client *SecurityPoliciesClient) BeginCreate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPoliciesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPoliciesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SecurityPoliciesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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 2023-05-01 func (client *SecurityPoliciesClient) create(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicy SecurityPolicy, options *SecurityPoliciesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, profileName, securityPolicyName, securityPolicy, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -112,16 +114,19 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, securityPolicy) + if err := runtime.MarshalAsJSON(req, securityPolicy); err != nil { + return nil, err + } + return req, nil } // 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -134,9 +139,10 @@ func (client *SecurityPoliciesClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPoliciesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPoliciesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SecurityPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,20 +151,22 @@ 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 2023-05-01 func (client *SecurityPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, options *SecurityPoliciesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, profileName, securityPolicyName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -185,7 +193,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,25 +202,28 @@ 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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. // - securityPolicyName - Name of the security policy under the profile. // - options - SecurityPoliciesClientGetOptions contains the optional parameters for the SecurityPoliciesClient.Get method. func (client *SecurityPoliciesClient) Get(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, options *SecurityPoliciesClientGetOptions) (SecurityPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, profileName, securityPolicyName, options) if err != nil { return SecurityPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SecurityPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -239,7 +250,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +267,7 @@ func (client *SecurityPoliciesClient) getHandleResponse(resp *http.Response) (Se // NewListByProfilePager - Lists security policies associated with the profile // -// Generated from API version 2021-06-01 +// Generated from API version 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -310,7 +321,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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +339,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 2023-05-01 // - resourceGroupName - Name of the Resource group within the Azure subscription. // - profileName - Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource // group. @@ -342,9 +353,10 @@ func (client *SecurityPoliciesClient) BeginPatch(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPoliciesClientPatchResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecurityPoliciesClientPatchResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SecurityPoliciesClientPatchResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -353,20 +365,22 @@ 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 2023-05-01 func (client *SecurityPoliciesClient) patch(ctx context.Context, resourceGroupName string, profileName string, securityPolicyName string, securityPolicyUpdateProperties SecurityPolicyUpdateParameters, options *SecurityPoliciesClientBeginPatchOptions) (*http.Response, error) { + var err error req, err := client.patchCreateRequest(ctx, resourceGroupName, profileName, securityPolicyName, securityPolicyUpdateProperties, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // patchCreateRequest creates the Patch request. @@ -393,8 +407,11 @@ 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", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, securityPolicyUpdateProperties) + if err := runtime.MarshalAsJSON(req, securityPolicyUpdateProperties); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/cdn/armcdn/securitypolicies_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client_example_test.go index c351e05c82d6..a66a44f7dd23 100644 --- a/sdk/resourcemanager/cdn/armcdn/securitypolicies_client_example_test.go +++ b/sdk/resourcemanager/cdn/armcdn/securitypolicies_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/SecurityPolicies_ListByProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/SecurityPolicies_ListByProfile.json func ExampleSecurityPoliciesClient_NewListByProfilePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -73,7 +73,7 @@ func ExampleSecurityPoliciesClient_NewListByProfilePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/SecurityPolicies_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/SecurityPolicies_Get.json func ExampleSecurityPoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -120,7 +120,7 @@ func ExampleSecurityPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/SecurityPolicies_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/SecurityPolicies_Create.json func ExampleSecurityPoliciesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -192,7 +192,7 @@ func ExampleSecurityPoliciesClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/SecurityPolicies_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/SecurityPolicies_Patch.json func ExampleSecurityPoliciesClient_BeginPatch() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -264,7 +264,7 @@ func ExampleSecurityPoliciesClient_BeginPatch() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/SecurityPolicies_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7b551033155a63739b6d28f79b9c07569f6179b8/specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/SecurityPolicies_Delete.json func ExampleSecurityPoliciesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go b/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go index fc6025ca7930..271ab27029b9 100644 --- a/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go +++ b/sdk/resourcemanager/cdn/armcdn/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armcdn diff --git a/sdk/resourcemanager/cdn/armcdn/validate_client.go b/sdk/resourcemanager/cdn/armcdn/validate_client.go deleted file mode 100644 index 24a9b2525d15..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/validate_client.go +++ /dev/null @@ -1,93 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "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 { - internal *arm.Client - subscriptionID string -} - -// 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) { - cl, err := arm.NewClient(moduleName+".ValidateClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ValidateClient{ - subscriptionID: subscriptionID, - internal: cl, - } - 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.internal.Pipeline().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.internal.Endpoint(), 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 -} diff --git a/sdk/resourcemanager/cdn/armcdn/validate_client_example_test.go b/sdk/resourcemanager/cdn/armcdn/validate_client_example_test.go deleted file mode 100644 index ecb880c8edb8..000000000000 --- a/sdk/resourcemanager/cdn/armcdn/validate_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcdn_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cdn/armcdn" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/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() - clientFactory, err := armcdn.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewValidateClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateSecretOutput = armcdn.ValidateSecretOutput{ - // Status: to.Ptr(armcdn.StatusValid), - // } -} From d94d01eb8401d35498422fd8e7c4220660d96575 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Tue, 17 Oct 2023 16:21:03 +0800 Subject: [PATCH 2/2] add removeUnreferencedTypes flag --- sdk/resourcemanager/cdn/armcdn/assets.json | 2 +- sdk/resourcemanager/cdn/armcdn/build.go | 2 +- sdk/resourcemanager/cdn/armcdn/models.go | 176 ------- .../cdn/armcdn/models_serde.go | 485 ------------------ 4 files changed, 2 insertions(+), 663 deletions(-) diff --git a/sdk/resourcemanager/cdn/armcdn/assets.json b/sdk/resourcemanager/cdn/armcdn/assets.json index 9fd8f66b360f..c017edc5d467 100644 --- a/sdk/resourcemanager/cdn/armcdn/assets.json +++ b/sdk/resourcemanager/cdn/armcdn/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/cdn/armcdn", - "Tag": "go/resourcemanager/cdn/armcdn_230f5f561c" + "Tag": "go/resourcemanager/cdn/armcdn_047d1b05a8" } diff --git a/sdk/resourcemanager/cdn/armcdn/build.go b/sdk/resourcemanager/cdn/armcdn/build.go index 3cced146aee3..0a5c153ff97f 100644 --- a/sdk/resourcemanager/cdn/armcdn/build.go +++ b/sdk/resourcemanager/cdn/armcdn/build.go @@ -2,6 +2,6 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/cdn/armcdn +//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -removeUnreferencedTypes resourcemanager/cdn/armcdn package armcdn diff --git a/sdk/resourcemanager/cdn/armcdn/models.go b/sdk/resourcemanager/cdn/armcdn/models.go index f6df276b0c97..508f5d582157 100644 --- a/sdk/resourcemanager/cdn/armcdn/models.go +++ b/sdk/resourcemanager/cdn/armcdn/models.go @@ -390,15 +390,6 @@ type AFDOriginUpdatePropertiesParameters struct { OriginGroupName *string } -// AFDStateProperties - The tracking states for afd resources. -type AFDStateProperties struct { - // READ-ONLY - DeploymentStatus *DeploymentStatus - - // READ-ONLY; Provisioning status - ProvisioningState *AfdProvisioningState -} - // ActivatedResourceReference - Reference to another resource along with its state. type ActivatedResourceReference struct { // Resource ID. @@ -408,13 +399,6 @@ type ActivatedResourceReference struct { IsActive *bool } -// AfdErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. -// (This also follows the OData error response format.). -type AfdErrorResponse struct { - // The error object. - Error *ErrorDetail -} - // AfdPurgeParameters - Parameters required for content purge. type AfdPurgeParameters struct { // REQUIRED; The path to the content to be purged. Can describe a file path or a wild card directory. @@ -439,19 +423,6 @@ type AfdRouteCacheConfiguration struct { QueryStringCachingBehavior *AfdQueryStringCachingBehavior } -// AzureFirstPartyManagedCertificate - Azure FirstParty Managed Certificate provided by other first party resource providers -// to enable HTTPS. -type AzureFirstPartyManagedCertificate struct { - // The type of the secret resource. - Type *SecretType - - // READ-ONLY; Certificate expiration date. - ExpirationDate *string - - // READ-ONLY; Subject name in the certificate. - Subject *string -} - // AzureFirstPartyManagedCertificateParameters - Azure FirstParty Managed Certificate provided by other first party resource // providers to enable HTTPS. type AzureFirstPartyManagedCertificateParameters struct { @@ -562,18 +533,6 @@ type CanMigrateResult struct { Type *string } -// Certificate used for https -type Certificate struct { - // The type of the secret resource. - Type *SecretType - - // READ-ONLY; Certificate expiration date. - ExpirationDate *string - - // READ-ONLY; Subject name in the certificate. - Subject *string -} - // CertificateSourceParameters - Defines the parameters for using CDN managed certificate for securing custom domain. type CertificateSourceParameters struct { // REQUIRED; Type of certificate used @@ -835,37 +794,6 @@ type CustomRuleList struct { Rules []*CustomRule } -// CustomerCertificate - Customer Certificate used for https -type CustomerCertificate struct { - // Resource reference to the Azure Key Vault certificate. Expected to be in format of - // /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ - SecretSource *ResourceReference - - // Certificate version. - SecretVersion *string - - // The list of SANs. - SubjectAlternativeNames []*string - - // The type of the secret resource. - Type *SecretType - - // Whether to use the latest version for the certificate - UseLatestVersion *bool - - // READ-ONLY; Certificate issuing authority. - CertificateAuthority *string - - // READ-ONLY; Certificate expiration date. - ExpirationDate *string - - // READ-ONLY; Subject name in the certificate. - Subject *string - - // READ-ONLY; Certificate thumbprint. - Thumbprint *string -} - // CustomerCertificateParameters - Customer Certificate used for https type CustomerCertificateParameters struct { // REQUIRED; Resource reference to the Azure Key Vault certificate. Expected to be in format of @@ -1676,40 +1604,6 @@ type EndpointUpdateParameters struct { Tags map[string]*string } -// ErrorAdditionalInfo - The resource management error additional info. -type ErrorAdditionalInfo struct { - // READ-ONLY; The additional info. - Info any - - // READ-ONLY; The additional info type. - Type *string -} - -// ErrorDetail - The error detail. -type ErrorDetail struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo - - // READ-ONLY; The error code. - Code *string - - // READ-ONLY; The error details. - Details []*ErrorDetail - - // READ-ONLY; The error message. - Message *string - - // READ-ONLY; The error target. - Target *string -} - -// ErrorResponse - Error response indicates Azure Front Door Standard or Azure Front Door Premium or CDN service is not able -// to process the incoming request. The reason is provided in the error message. -type ErrorResponse struct { - // The error object. - Error *ErrorDetail -} - // GeoFilter - Rules defining user's geo access within a CDN endpoint. type GeoFilter struct { // REQUIRED; Action of the geo filter, i.e. allow or block access. @@ -1915,18 +1809,6 @@ type LogSpecification struct { Name *string } -// ManagedCertificate - Managed Certificate used for https -type ManagedCertificate struct { - // The type of the secret resource. - Type *SecretType - - // READ-ONLY; Certificate expiration date. - ExpirationDate *string - - // READ-ONLY; Subject name in the certificate. - Subject *string -} - // ManagedCertificateParameters - Managed Certificate used for https type ManagedCertificateParameters struct { // REQUIRED; The type of the secret resource. @@ -2654,22 +2536,6 @@ type ProfileUpgradeParameters struct { WafMappingList []*ProfileChangeSKUWafMapping } -// ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location -// and tags -type ProxyResource struct { - // READ-ONLY; Resource ID. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Read only system data - SystemData *SystemData - - // READ-ONLY; Resource type. - Type *string -} - // PurgeParameters - Parameters required for content purge. type PurgeParameters struct { // REQUIRED; The path to the content to be purged. Can describe a file path or a wild card directory. @@ -2859,21 +2725,6 @@ type RequestURIMatchConditionParameters struct { Transforms []*Transform } -// Resource - The core properties of ARM resources -type Resource struct { - // READ-ONLY; Resource ID. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Read only system data - SystemData *SystemData - - // READ-ONLY; Resource type. - Type *string -} - // ResourceReference - Reference to another resource. type ResourceReference struct { // Resource ID. @@ -3479,27 +3330,6 @@ type SystemData struct { LastModifiedByType *IdentityType } -// TrackedResource - The resource model definition for a ARM tracked top level resource. -type TrackedResource struct { - // REQUIRED; Resource location. - Location *string - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Resource ID. - ID *string - - // READ-ONLY; Resource name. - Name *string - - // READ-ONLY; Read only system data - SystemData *SystemData - - // READ-ONLY; Resource type. - Type *string -} - // URLFileExtensionMatchConditionParameters - Defines the parameters for UrlFileExtension match conditions type URLFileExtensionMatchConditionParameters struct { // REQUIRED; Describes operator to be matched @@ -3827,12 +3657,6 @@ type ValidateSecretOutput struct { Status *Status } -// ValidationToken - The validation token. -type ValidationToken struct { - // READ-ONLY - Token *string -} - // WafMetricsResponse - Waf Metrics Response type WafMetricsResponse struct { DateTimeBegin *time.Time diff --git a/sdk/resourcemanager/cdn/armcdn/models_serde.go b/sdk/resourcemanager/cdn/armcdn/models_serde.go index 9181a2a49b82..9f0a9a81cb30 100644 --- a/sdk/resourcemanager/cdn/armcdn/models_serde.go +++ b/sdk/resourcemanager/cdn/armcdn/models_serde.go @@ -882,37 +882,6 @@ func (a *AFDOriginUpdatePropertiesParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AFDStateProperties. -func (a AFDStateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -944,33 +913,6 @@ func (a *ActivatedResourceReference) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AfdErrorResponse. -func (a AfdErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -1037,41 +979,6 @@ func (a *AfdRouteCacheConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureFirstPartyManagedCertificate. -func (a AzureFirstPartyManagedCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -1337,41 +1244,6 @@ func (c *CanMigrateResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Certificate. -func (c Certificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -2192,65 +2064,6 @@ func (c *CustomRuleList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomerCertificate. -func (c CustomerCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -3901,107 +3714,6 @@ func (e *EndpointUpdateParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateAny(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]any) - 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]any) - 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]any) @@ -4540,41 +4252,6 @@ func (l *LogSpecification) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedCertificate. -func (m ManagedCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -6442,45 +6119,6 @@ func (p *ProfileUpgradeParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -7023,45 +6661,6 @@ func (r *RequestURIMatchConditionParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -8663,53 +8262,6 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -9523,33 +9075,6 @@ func (v *ValidateSecretOutput) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ValidationToken. -func (v ValidationToken) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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]any) @@ -9911,16 +9436,6 @@ func populate(m map[string]any, k string, v any) { } } -func populateAny(m map[string]any, k string, v any) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else { - m[k] = v - } -} - func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil