diff --git a/sdk/resourcemanager/resources/armresources/CHANGELOG.md b/sdk/resourcemanager/resources/armresources/CHANGELOG.md index 5a20e9c9b934..88a59d9cdff2 100644 --- a/sdk/resourcemanager/resources/armresources/CHANGELOG.md +++ b/sdk/resourcemanager/resources/armresources/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 2.0.0 (2023-05-19) +### Breaking Changes + +- Operation `*TagsClient.CreateOrUpdateAtScope` has been changed to LRO, use `*TagsClient.BeginCreateOrUpdateAtScope` instead. +- Operation `*TagsClient.DeleteAtScope` has been changed to LRO, use `*TagsClient.BeginDeleteAtScope` instead. +- Operation `*TagsClient.UpdateAtScope` has been changed to LRO, use `*TagsClient.BeginUpdateAtScope` instead. + +### Features Added + +- New struct `DeploymentParameter` +- New struct `KeyVaultParameterReference` +- New struct `KeyVaultReference` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/resources/armresources/autorest.md b/sdk/resourcemanager/resources/armresources/autorest.md index 2767ecb00d9e..3ea5e23fa19c 100644 --- a/sdk/resourcemanager/resources/armresources/autorest.md +++ b/sdk/resourcemanager/resources/armresources/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 2.0.0 package-resources: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resources/armresources/client.go b/sdk/resourcemanager/resources/armresources/client.go index 4d78cab13732..506d3903d231 100644 --- a/sdk/resourcemanager/resources/armresources/client.go +++ b/sdk/resourcemanager/resources/armresources/client.go @@ -47,7 +47,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // CheckExistence - Checks whether a resource exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group containing the resource to check. The name is case insensitive. // - resourceProviderNamespace - The resource provider of the resource to check. // - parentResourcePath - The parent resource identity. @@ -102,9 +102,11 @@ func (client *Client) checkExistenceCreateRequest(ctx context.Context, resourceG return req, nil } -// CheckExistenceByID - Checks by ID whether a resource exists. +// CheckExistenceByID - Checks by ID whether a resource exists. This API currently works only for a limited set of Resource +// providers. In the event that a Resource provider does not implement this API, ARM will respond with +// a 405. The alternative then is to use the GET API to check for the existence of the resource. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} // - apiVersion - The API version to use for the operation. @@ -142,7 +144,7 @@ func (client *Client) checkExistenceByIDCreateRequest(ctx context.Context, resou // BeginCreateOrUpdate - Creates a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group for the resource. The name is case insensitive. // - resourceProviderNamespace - The namespace of the resource provider. // - parentResourcePath - The parent resource identity. @@ -166,7 +168,7 @@ func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName // CreateOrUpdate - Creates a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource, options *ClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, options) if err != nil { @@ -217,7 +219,7 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG // BeginCreateOrUpdateByID - Create a resource by ID. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} // - apiVersion - The API version to use for the operation. @@ -239,7 +241,7 @@ func (client *Client) BeginCreateOrUpdateByID(ctx context.Context, resourceID st // CreateOrUpdateByID - Create a resource by ID. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *Client) createOrUpdateByID(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginCreateOrUpdateByIDOptions) (*http.Response, error) { req, err := client.createOrUpdateByIDCreateRequest(ctx, resourceID, apiVersion, parameters, options) if err != nil { @@ -273,7 +275,7 @@ func (client *Client) createOrUpdateByIDCreateRequest(ctx context.Context, resou // BeginDelete - Deletes a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group that contains the resource to delete. The name is case insensitive. // - resourceProviderNamespace - The namespace of the resource provider. // - parentResourcePath - The parent resource identity. @@ -296,7 +298,7 @@ func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, // Delete - Deletes a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, options *ClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options) if err != nil { @@ -347,7 +349,7 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName // BeginDeleteByID - Deletes a resource by ID. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} // - apiVersion - The API version to use for the operation. @@ -367,7 +369,7 @@ func (client *Client) BeginDeleteByID(ctx context.Context, resourceID string, ap // DeleteByID - Deletes a resource by ID. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *Client) deleteByID(ctx context.Context, resourceID string, apiVersion string, options *ClientBeginDeleteByIDOptions) (*http.Response, error) { req, err := client.deleteByIDCreateRequest(ctx, resourceID, apiVersion, options) if err != nil { @@ -401,7 +403,7 @@ func (client *Client) deleteByIDCreateRequest(ctx context.Context, resourceID st // Get - Gets a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group containing the resource to get. The name is case insensitive. // - resourceProviderNamespace - The namespace of the resource provider. // - parentResourcePath - The parent resource identity. @@ -468,7 +470,7 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, // GetByID - Gets a resource by ID. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} // - apiVersion - The API version to use for the operation. @@ -514,7 +516,7 @@ func (client *Client) getByIDHandleResponse(resp *http.Response) (ClientGetByIDR // NewListPager - Get all the resources in a subscription. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - options - ClientListOptions contains the optional parameters for the Client.NewListPager method. func (client *Client) NewListPager(options *ClientListOptions) *runtime.Pager[ClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListResponse]{ @@ -565,7 +567,7 @@ func (client *Client) listCreateRequest(ctx context.Context, options *ClientList if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,7 +584,7 @@ func (client *Client) listHandleResponse(resp *http.Response) (ClientListRespons // NewListByResourceGroupPager - Get all the resources for a resource group. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The resource group with the resources to get. // - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager // method. @@ -639,7 +641,7 @@ func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, reso if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -660,7 +662,7 @@ func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (Cl // on the groups until the move completes. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - sourceResourceGroupName - The name of the resource group from the source subscription containing the resources to be moved. // - parameters - Parameters for moving resources. // - options - ClientBeginMoveResourcesOptions contains the optional parameters for the Client.BeginMoveResources method. @@ -682,7 +684,7 @@ func (client *Client) BeginMoveResources(ctx context.Context, sourceResourceGrou // on the groups until the move completes. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *Client) moveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginMoveResourcesOptions) (*http.Response, error) { req, err := client.moveResourcesCreateRequest(ctx, sourceResourceGroupName, parameters, options) if err != nil { @@ -714,7 +716,7 @@ func (client *Client) moveResourcesCreateRequest(ctx context.Context, sourceReso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -723,7 +725,7 @@ func (client *Client) moveResourcesCreateRequest(ctx context.Context, sourceReso // BeginUpdate - Updates a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group for the resource. The name is case insensitive. // - resourceProviderNamespace - The namespace of the resource provider. // - parentResourcePath - The parent resource identity. @@ -747,7 +749,7 @@ func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, // Update - Updates a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *Client) update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource, options *ClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, options) if err != nil { @@ -798,7 +800,7 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName // BeginUpdateByID - Updates a resource by ID. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format, // /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} // - apiVersion - The API version to use for the operation. @@ -819,7 +821,7 @@ func (client *Client) BeginUpdateByID(ctx context.Context, resourceID string, ap // UpdateByID - Updates a resource by ID. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *Client) updateByID(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginUpdateByIDOptions) (*http.Response, error) { req, err := client.updateByIDCreateRequest(ctx, resourceID, apiVersion, parameters, options) if err != nil { @@ -857,7 +859,7 @@ func (client *Client) updateByIDCreateRequest(ctx context.Context, resourceID st // error message. Retrieve the URL in the Location header value to check the result of the long-running operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - sourceResourceGroupName - The name of the resource group from the source subscription containing the resources to be validated // for move. // - parameters - Parameters for moving resources. @@ -882,7 +884,7 @@ func (client *Client) BeginValidateMoveResources(ctx context.Context, sourceReso // error message. Retrieve the URL in the Location header value to check the result of the long-running operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *Client) validateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginValidateMoveResourcesOptions) (*http.Response, error) { req, err := client.validateMoveResourcesCreateRequest(ctx, sourceResourceGroupName, parameters, options) if err != nil { @@ -914,7 +916,7 @@ func (client *Client) validateMoveResourcesCreateRequest(ctx context.Context, so return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/resources/armresources/constants.go b/sdk/resourcemanager/resources/armresources/constants.go index 2e355a761fe2..043dae972113 100644 --- a/sdk/resourcemanager/resources/armresources/constants.go +++ b/sdk/resourcemanager/resources/armresources/constants.go @@ -11,7 +11,7 @@ package armresources const ( moduleName = "armresources" - moduleVersion = "v1.1.1" + moduleVersion = "v2.0.0" ) // AliasPathAttributes - The attributes of the token that the alias path is referring to. diff --git a/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go b/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go index d990b7609509..2f3b745f0e90 100644 --- a/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go +++ b/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go @@ -48,7 +48,7 @@ func NewDeploymentOperationsClient(subscriptionID string, credential azcore.Toke // Get - Gets a deployments operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - deploymentName - The name of the deployment. // - operationID - The ID of the operation to get. @@ -93,7 +93,7 @@ func (client *DeploymentOperationsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *DeploymentOperationsClient) getHandleResponse(resp *http.Response) // GetAtManagementGroupScope - Gets a deployments operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - operationID - The ID of the operation to get. @@ -152,7 +152,7 @@ func (client *DeploymentOperationsClient) getAtManagementGroupScopeCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +170,7 @@ func (client *DeploymentOperationsClient) getAtManagementGroupScopeHandleRespons // GetAtScope - Gets a deployments operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - operationID - The ID of the operation to get. @@ -208,7 +208,7 @@ func (client *DeploymentOperationsClient) getAtScopeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +226,7 @@ func (client *DeploymentOperationsClient) getAtScopeHandleResponse(resp *http.Re // GetAtSubscriptionScope - Gets a deployments operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - operationID - The ID of the operation to get. // - options - DeploymentOperationsClientGetAtSubscriptionScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtSubscriptionScope @@ -266,7 +266,7 @@ func (client *DeploymentOperationsClient) getAtSubscriptionScopeCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *DeploymentOperationsClient) getAtSubscriptionScopeHandleResponse(r // GetAtTenantScope - Gets a deployments operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - operationID - The ID of the operation to get. // - options - DeploymentOperationsClientGetAtTenantScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtTenantScope @@ -320,7 +320,7 @@ func (client *DeploymentOperationsClient) getAtTenantScopeCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +337,7 @@ func (client *DeploymentOperationsClient) getAtTenantScopeHandleResponse(resp *h // NewListPager - Gets all deployments operations for a deployment. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - deploymentName - The name of the deployment. // - options - DeploymentOperationsClientListOptions contains the optional parameters for the DeploymentOperationsClient.NewListPager @@ -393,7 +393,7 @@ func (client *DeploymentOperationsClient) listCreateRequest(ctx context.Context, if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -410,7 +410,7 @@ func (client *DeploymentOperationsClient) listHandleResponse(resp *http.Response // NewListAtManagementGroupScopePager - Gets all deployments operations for a deployment. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentOperationsClientListAtManagementGroupScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtManagementGroupScopePager @@ -462,7 +462,7 @@ func (client *DeploymentOperationsClient) listAtManagementGroupScopeCreateReques if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -479,7 +479,7 @@ func (client *DeploymentOperationsClient) listAtManagementGroupScopeHandleRespon // NewListAtScopePager - Gets all deployments operations for a deployment. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentOperationsClientListAtScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtScopePager @@ -528,7 +528,7 @@ func (client *DeploymentOperationsClient) listAtScopeCreateRequest(ctx context.C if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -545,7 +545,7 @@ func (client *DeploymentOperationsClient) listAtScopeHandleResponse(resp *http.R // NewListAtSubscriptionScopePager - Gets all deployments operations for a deployment. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentOperationsClientListAtSubscriptionScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtSubscriptionScopePager // method. @@ -596,7 +596,7 @@ func (client *DeploymentOperationsClient) listAtSubscriptionScopeCreateRequest(c if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -613,7 +613,7 @@ func (client *DeploymentOperationsClient) listAtSubscriptionScopeHandleResponse( // NewListAtTenantScopePager - Gets all deployments operations for a deployment. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentOperationsClientListAtTenantScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtTenantScopePager // method. @@ -660,7 +660,7 @@ func (client *DeploymentOperationsClient) listAtTenantScopeCreateRequest(ctx con if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resources/armresources/deployments_client.go b/sdk/resourcemanager/resources/armresources/deployments_client.go index 11d005c641ef..efe4a7d0aec1 100644 --- a/sdk/resourcemanager/resources/armresources/deployments_client.go +++ b/sdk/resourcemanager/resources/armresources/deployments_client.go @@ -48,7 +48,7 @@ func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredenti // CalculateTemplateHash - Calculate the hash of the given template. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - templateParam - The template provided to calculate hash. // - options - DeploymentsClientCalculateTemplateHashOptions contains the optional parameters for the DeploymentsClient.CalculateTemplateHash // method. @@ -75,7 +75,7 @@ func (client *DeploymentsClient) calculateTemplateHashCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, templateParam) @@ -95,7 +95,7 @@ func (client *DeploymentsClient) calculateTemplateHashHandleResponse(resp *http. // currently running template deployment and leaves the resource group partially deployed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCancelOptions contains the optional parameters for the DeploymentsClient.Cancel method. @@ -134,7 +134,7 @@ func (client *DeploymentsClient) cancelCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -145,7 +145,7 @@ func (client *DeploymentsClient) cancelCreateRequest(ctx context.Context, resour // currently running template deployment and leaves the resources partially deployed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCancelAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtManagementGroupScope @@ -181,7 +181,7 @@ func (client *DeploymentsClient) cancelAtManagementGroupScopeCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +192,7 @@ func (client *DeploymentsClient) cancelAtManagementGroupScopeCreateRequest(ctx c // currently running template deployment and leaves the resources partially deployed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCancelAtScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtScope @@ -225,7 +225,7 @@ func (client *DeploymentsClient) cancelAtScopeCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +236,7 @@ func (client *DeploymentsClient) cancelAtScopeCreateRequest(ctx context.Context, // currently running template deployment and leaves the resources partially deployed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientCancelAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtSubscriptionScope // method. @@ -271,7 +271,7 @@ func (client *DeploymentsClient) cancelAtSubscriptionScopeCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *DeploymentsClient) cancelAtSubscriptionScopeCreateRequest(ctx cont // currently running template deployment and leaves the resources partially deployed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientCancelAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtTenantScope // method. @@ -313,7 +313,7 @@ func (client *DeploymentsClient) cancelAtTenantScopeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +321,7 @@ func (client *DeploymentsClient) cancelAtTenantScopeCreateRequest(ctx context.Co // CheckExistence - Checks whether the deployment exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group with the deployment to check. The name is case insensitive. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCheckExistenceOptions contains the optional parameters for the DeploymentsClient.CheckExistence @@ -361,7 +361,7 @@ func (client *DeploymentsClient) checkExistenceCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -369,7 +369,7 @@ func (client *DeploymentsClient) checkExistenceCreateRequest(ctx context.Context // CheckExistenceAtManagementGroupScope - Checks whether the deployment exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCheckExistenceAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtManagementGroupScope @@ -405,7 +405,7 @@ func (client *DeploymentsClient) checkExistenceAtManagementGroupScopeCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -413,7 +413,7 @@ func (client *DeploymentsClient) checkExistenceAtManagementGroupScopeCreateReque // CheckExistenceAtScope - Checks whether the deployment exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCheckExistenceAtScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtScope @@ -446,7 +446,7 @@ func (client *DeploymentsClient) checkExistenceAtScopeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,7 +454,7 @@ func (client *DeploymentsClient) checkExistenceAtScopeCreateRequest(ctx context. // CheckExistenceAtSubscriptionScope - Checks whether the deployment exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientCheckExistenceAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtSubscriptionScope // method. @@ -489,7 +489,7 @@ func (client *DeploymentsClient) checkExistenceAtSubscriptionScopeCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -497,7 +497,7 @@ func (client *DeploymentsClient) checkExistenceAtSubscriptionScopeCreateRequest( // CheckExistenceAtTenantScope - Checks whether the deployment exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientCheckExistenceAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtTenantScope // method. @@ -528,7 +528,7 @@ func (client *DeploymentsClient) checkExistenceAtTenantScopeCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -537,7 +537,7 @@ func (client *DeploymentsClient) checkExistenceAtTenantScopeCreateRequest(ctx co // BeginCreateOrUpdate - You can provide the template and parameters directly in the request or link to JSON files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group to deploy the resources to. The name is case insensitive. The resource // group must already exist. // - deploymentName - The name of the deployment. @@ -559,7 +559,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - You can provide the template and parameters directly in the request or link to JSON files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, deploymentName, parameters, options) if err != nil { @@ -595,7 +595,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -605,7 +605,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context // to JSON files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - parameters - Additional parameters supplied to the operation. @@ -627,7 +627,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdateAtManagementGroupScope(ctx c // files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) createOrUpdateAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtManagementGroupScopeOptions) (*http.Response, error) { req, err := client.createOrUpdateAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, parameters, options) if err != nil { @@ -659,7 +659,7 @@ func (client *DeploymentsClient) createOrUpdateAtManagementGroupScopeCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -668,7 +668,7 @@ func (client *DeploymentsClient) createOrUpdateAtManagementGroupScopeCreateReque // BeginCreateOrUpdateAtScope - You can provide the template and parameters directly in the request or link to JSON files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - parameters - Additional parameters supplied to the operation. @@ -689,7 +689,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdateAtScope(ctx context.Context, // CreateOrUpdateAtScope - You can provide the template and parameters directly in the request or link to JSON files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) createOrUpdateAtScope(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtScopeOptions) (*http.Response, error) { req, err := client.createOrUpdateAtScopeCreateRequest(ctx, scope, deploymentName, parameters, options) if err != nil { @@ -718,7 +718,7 @@ func (client *DeploymentsClient) createOrUpdateAtScopeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -728,7 +728,7 @@ func (client *DeploymentsClient) createOrUpdateAtScopeCreateRequest(ctx context. // JSON files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - parameters - Additional parameters supplied to the operation. // - options - DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtSubscriptionScope @@ -749,7 +749,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdateAtSubscriptionScope(ctx cont // files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) createOrUpdateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions) (*http.Response, error) { req, err := client.createOrUpdateAtSubscriptionScopeCreateRequest(ctx, deploymentName, parameters, options) if err != nil { @@ -781,7 +781,7 @@ func (client *DeploymentsClient) createOrUpdateAtSubscriptionScopeCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -791,7 +791,7 @@ func (client *DeploymentsClient) createOrUpdateAtSubscriptionScopeCreateRequest( // files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - parameters - Additional parameters supplied to the operation. // - options - DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtTenantScope @@ -811,7 +811,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdateAtTenantScope(ctx context.Co // CreateOrUpdateAtTenantScope - You can provide the template and parameters directly in the request or link to JSON files. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) createOrUpdateAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions) (*http.Response, error) { req, err := client.createOrUpdateAtTenantScopeCreateRequest(ctx, deploymentName, parameters, options) if err != nil { @@ -839,7 +839,7 @@ func (client *DeploymentsClient) createOrUpdateAtTenantScopeCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -855,7 +855,7 @@ func (client *DeploymentsClient) createOrUpdateAtTenantScopeCreateRequest(ctx co // code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group with the deployment to delete. The name is case insensitive. // - deploymentName - The name of the deployment. // - options - DeploymentsClientBeginDeleteOptions contains the optional parameters for the DeploymentsClient.BeginDelete method. @@ -881,7 +881,7 @@ func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupN // code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, deploymentName, options) if err != nil { @@ -917,7 +917,7 @@ func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -932,7 +932,7 @@ func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resour // Location header returns an error-level status code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientBeginDeleteAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtManagementGroupScope @@ -958,7 +958,7 @@ func (client *DeploymentsClient) BeginDeleteAtManagementGroupScope(ctx context.C // Location header returns an error-level status code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) deleteAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientBeginDeleteAtManagementGroupScopeOptions) (*http.Response, error) { req, err := client.deleteAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, options) if err != nil { @@ -990,7 +990,7 @@ func (client *DeploymentsClient) deleteAtManagementGroupScopeCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1005,7 +1005,7 @@ func (client *DeploymentsClient) deleteAtManagementGroupScopeCreateRequest(ctx c // Location header returns an error-level status code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientBeginDeleteAtScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtScope @@ -1031,7 +1031,7 @@ func (client *DeploymentsClient) BeginDeleteAtScope(ctx context.Context, scope s // Location header returns an error-level status code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) deleteAtScope(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientBeginDeleteAtScopeOptions) (*http.Response, error) { req, err := client.deleteAtScopeCreateRequest(ctx, scope, deploymentName, options) if err != nil { @@ -1060,7 +1060,7 @@ func (client *DeploymentsClient) deleteAtScopeCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1075,7 +1075,7 @@ func (client *DeploymentsClient) deleteAtScopeCreateRequest(ctx context.Context, // Location header returns an error-level status code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientBeginDeleteAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtSubscriptionScope // method. @@ -1100,7 +1100,7 @@ func (client *DeploymentsClient) BeginDeleteAtSubscriptionScope(ctx context.Cont // Location header returns an error-level status code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) deleteAtSubscriptionScope(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtSubscriptionScopeOptions) (*http.Response, error) { req, err := client.deleteAtSubscriptionScopeCreateRequest(ctx, deploymentName, options) if err != nil { @@ -1132,7 +1132,7 @@ func (client *DeploymentsClient) deleteAtSubscriptionScopeCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1147,7 +1147,7 @@ func (client *DeploymentsClient) deleteAtSubscriptionScopeCreateRequest(ctx cont // Location header returns an error-level status code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientBeginDeleteAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtTenantScope // method. @@ -1172,7 +1172,7 @@ func (client *DeploymentsClient) BeginDeleteAtTenantScope(ctx context.Context, d // Location header returns an error-level status code. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) deleteAtTenantScope(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtTenantScopeOptions) (*http.Response, error) { req, err := client.deleteAtTenantScopeCreateRequest(ctx, deploymentName, options) if err != nil { @@ -1200,7 +1200,7 @@ func (client *DeploymentsClient) deleteAtTenantScopeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1209,7 +1209,7 @@ func (client *DeploymentsClient) deleteAtTenantScopeCreateRequest(ctx context.Co // ExportTemplate - Exports the template used for specified deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - deploymentName - The name of the deployment. // - options - DeploymentsClientExportTemplateOptions contains the optional parameters for the DeploymentsClient.ExportTemplate @@ -1249,7 +1249,7 @@ func (client *DeploymentsClient) exportTemplateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1267,7 +1267,7 @@ func (client *DeploymentsClient) exportTemplateHandleResponse(resp *http.Respons // ExportTemplateAtManagementGroupScope - Exports the template used for specified deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientExportTemplateAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtManagementGroupScope @@ -1303,7 +1303,7 @@ func (client *DeploymentsClient) exportTemplateAtManagementGroupScopeCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1321,7 +1321,7 @@ func (client *DeploymentsClient) exportTemplateAtManagementGroupScopeHandleRespo // ExportTemplateAtScope - Exports the template used for specified deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientExportTemplateAtScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtScope @@ -1354,7 +1354,7 @@ func (client *DeploymentsClient) exportTemplateAtScopeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1372,7 +1372,7 @@ func (client *DeploymentsClient) exportTemplateAtScopeHandleResponse(resp *http. // ExportTemplateAtSubscriptionScope - Exports the template used for specified deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientExportTemplateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtSubscriptionScope // method. @@ -1407,7 +1407,7 @@ func (client *DeploymentsClient) exportTemplateAtSubscriptionScopeCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1425,7 +1425,7 @@ func (client *DeploymentsClient) exportTemplateAtSubscriptionScopeHandleResponse // ExportTemplateAtTenantScope - Exports the template used for specified deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientExportTemplateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtTenantScope // method. @@ -1456,7 +1456,7 @@ func (client *DeploymentsClient) exportTemplateAtTenantScopeCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1474,7 +1474,7 @@ func (client *DeploymentsClient) exportTemplateAtTenantScopeHandleResponse(resp // Get - Gets a deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - deploymentName - The name of the deployment. // - options - DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method. @@ -1513,7 +1513,7 @@ func (client *DeploymentsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1531,7 +1531,7 @@ func (client *DeploymentsClient) getHandleResponse(resp *http.Response) (Deploym // GetAtManagementGroupScope - Gets a deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientGetAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.GetAtManagementGroupScope @@ -1567,7 +1567,7 @@ func (client *DeploymentsClient) getAtManagementGroupScopeCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1585,7 +1585,7 @@ func (client *DeploymentsClient) getAtManagementGroupScopeHandleResponse(resp *h // GetAtScope - Gets a deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientGetAtScopeOptions contains the optional parameters for the DeploymentsClient.GetAtScope method. @@ -1617,7 +1617,7 @@ func (client *DeploymentsClient) getAtScopeCreateRequest(ctx context.Context, sc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1635,7 +1635,7 @@ func (client *DeploymentsClient) getAtScopeHandleResponse(resp *http.Response) ( // GetAtSubscriptionScope - Gets a deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientGetAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.GetAtSubscriptionScope // method. @@ -1670,7 +1670,7 @@ func (client *DeploymentsClient) getAtSubscriptionScopeCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1688,7 +1688,7 @@ func (client *DeploymentsClient) getAtSubscriptionScopeHandleResponse(resp *http // GetAtTenantScope - Gets a deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientGetAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.GetAtTenantScope // method. @@ -1719,7 +1719,7 @@ func (client *DeploymentsClient) getAtTenantScopeCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1736,7 +1736,7 @@ func (client *DeploymentsClient) getAtTenantScopeHandleResponse(resp *http.Respo // NewListAtManagementGroupScopePager - Get all the deployments for a management group. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - options - DeploymentsClientListAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtManagementGroupScopePager // method. @@ -1786,7 +1786,7 @@ func (client *DeploymentsClient) listAtManagementGroupScopeCreateRequest(ctx con if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1803,7 +1803,7 @@ func (client *DeploymentsClient) listAtManagementGroupScopeHandleResponse(resp * // NewListAtScopePager - Get all the deployments at the given scope. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - options - DeploymentsClientListAtScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtScopePager // method. @@ -1850,7 +1850,7 @@ func (client *DeploymentsClient) listAtScopeCreateRequest(ctx context.Context, s if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1867,7 +1867,7 @@ func (client *DeploymentsClient) listAtScopeHandleResponse(resp *http.Response) // NewListAtSubscriptionScopePager - Get all the deployments for a subscription. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - options - DeploymentsClientListAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtSubscriptionScopePager // method. func (client *DeploymentsClient) NewListAtSubscriptionScopePager(options *DeploymentsClientListAtSubscriptionScopeOptions) *runtime.Pager[DeploymentsClientListAtSubscriptionScopeResponse] { @@ -1916,7 +1916,7 @@ func (client *DeploymentsClient) listAtSubscriptionScopeCreateRequest(ctx contex if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1933,7 +1933,7 @@ func (client *DeploymentsClient) listAtSubscriptionScopeHandleResponse(resp *htt // NewListAtTenantScopePager - Get all the deployments at the tenant scope. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - options - DeploymentsClientListAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtTenantScopePager // method. func (client *DeploymentsClient) NewListAtTenantScopePager(options *DeploymentsClientListAtTenantScopeOptions) *runtime.Pager[DeploymentsClientListAtTenantScopeResponse] { @@ -1978,7 +1978,7 @@ func (client *DeploymentsClient) listAtTenantScopeCreateRequest(ctx context.Cont if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1995,7 +1995,7 @@ func (client *DeploymentsClient) listAtTenantScopeHandleResponse(resp *http.Resp // NewListByResourceGroupPager - Get all the deployments for a resource group. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group with the deployments to get. The name is case insensitive. // - options - DeploymentsClientListByResourceGroupOptions contains the optional parameters for the DeploymentsClient.NewListByResourceGroupPager // method. @@ -2049,7 +2049,7 @@ func (client *DeploymentsClient) listByResourceGroupCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2068,7 +2068,7 @@ func (client *DeploymentsClient) listByResourceGroupHandleResponse(resp *http.Re // Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group the template will be deployed to. The name is case insensitive. // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. @@ -2089,7 +2089,7 @@ func (client *DeploymentsClient) BeginValidate(ctx context.Context, resourceGrou // Validate - Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) validate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateOptions) (*http.Response, error) { req, err := client.validateCreateRequest(ctx, resourceGroupName, deploymentName, parameters, options) if err != nil { @@ -2125,7 +2125,7 @@ func (client *DeploymentsClient) validateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -2135,7 +2135,7 @@ func (client *DeploymentsClient) validateCreateRequest(ctx context.Context, reso // by Azure Resource Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. @@ -2157,7 +2157,7 @@ func (client *DeploymentsClient) BeginValidateAtManagementGroupScope(ctx context // by Azure Resource Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) validateAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtManagementGroupScopeOptions) (*http.Response, error) { req, err := client.validateAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, parameters, options) if err != nil { @@ -2189,7 +2189,7 @@ func (client *DeploymentsClient) validateAtManagementGroupScopeCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -2199,7 +2199,7 @@ func (client *DeploymentsClient) validateAtManagementGroupScopeCreateRequest(ctx // Resource Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. @@ -2221,7 +2221,7 @@ func (client *DeploymentsClient) BeginValidateAtScope(ctx context.Context, scope // Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) validateAtScope(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtScopeOptions) (*http.Response, error) { req, err := client.validateAtScopeCreateRequest(ctx, scope, deploymentName, parameters, options) if err != nil { @@ -2250,7 +2250,7 @@ func (client *DeploymentsClient) validateAtScopeCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -2260,7 +2260,7 @@ func (client *DeploymentsClient) validateAtScopeCreateRequest(ctx context.Contex // by Azure Resource Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. // - options - DeploymentsClientBeginValidateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtSubscriptionScope @@ -2281,7 +2281,7 @@ func (client *DeploymentsClient) BeginValidateAtSubscriptionScope(ctx context.Co // Azure Resource Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) validateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtSubscriptionScopeOptions) (*http.Response, error) { req, err := client.validateAtSubscriptionScopeCreateRequest(ctx, deploymentName, parameters, options) if err != nil { @@ -2313,7 +2313,7 @@ func (client *DeploymentsClient) validateAtSubscriptionScopeCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -2323,7 +2323,7 @@ func (client *DeploymentsClient) validateAtSubscriptionScopeCreateRequest(ctx co // Azure Resource Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. // - options - DeploymentsClientBeginValidateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtTenantScope @@ -2344,7 +2344,7 @@ func (client *DeploymentsClient) BeginValidateAtTenantScope(ctx context.Context, // Resource Manager.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) validateAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtTenantScopeOptions) (*http.Response, error) { req, err := client.validateAtTenantScopeCreateRequest(ctx, deploymentName, parameters, options) if err != nil { @@ -2372,7 +2372,7 @@ func (client *DeploymentsClient) validateAtTenantScopeCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -2381,7 +2381,7 @@ func (client *DeploymentsClient) validateAtTenantScopeCreateRequest(ctx context. // BeginWhatIf - Returns changes that will be made by the deployment if executed at the scope of the resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group the template will be deployed to. The name is case insensitive. // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. @@ -2403,7 +2403,7 @@ func (client *DeploymentsClient) BeginWhatIf(ctx context.Context, resourceGroupN // WhatIf - Returns changes that will be made by the deployment if executed at the scope of the resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) whatIf(ctx context.Context, resourceGroupName string, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfOptions) (*http.Response, error) { req, err := client.whatIfCreateRequest(ctx, resourceGroupName, deploymentName, parameters, options) if err != nil { @@ -2439,7 +2439,7 @@ func (client *DeploymentsClient) whatIfCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -2449,7 +2449,7 @@ func (client *DeploymentsClient) whatIfCreateRequest(ctx context.Context, resour // management group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. @@ -2473,7 +2473,7 @@ func (client *DeploymentsClient) BeginWhatIfAtManagementGroupScope(ctx context.C // group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) whatIfAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtManagementGroupScopeOptions) (*http.Response, error) { req, err := client.whatIfAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, parameters, options) if err != nil { @@ -2505,7 +2505,7 @@ func (client *DeploymentsClient) whatIfAtManagementGroupScopeCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -2514,7 +2514,7 @@ func (client *DeploymentsClient) whatIfAtManagementGroupScopeCreateRequest(ctx c // BeginWhatIfAtSubscriptionScope - Returns changes that will be made by the deployment if executed at the scope of the subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - parameters - Parameters to What If. // - options - DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtSubscriptionScope @@ -2536,7 +2536,7 @@ func (client *DeploymentsClient) BeginWhatIfAtSubscriptionScope(ctx context.Cont // WhatIfAtSubscriptionScope - Returns changes that will be made by the deployment if executed at the scope of the subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) whatIfAtSubscriptionScope(ctx context.Context, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions) (*http.Response, error) { req, err := client.whatIfAtSubscriptionScopeCreateRequest(ctx, deploymentName, parameters, options) if err != nil { @@ -2568,7 +2568,7 @@ func (client *DeploymentsClient) whatIfAtSubscriptionScopeCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -2577,7 +2577,7 @@ func (client *DeploymentsClient) whatIfAtSubscriptionScopeCreateRequest(ctx cont // BeginWhatIfAtTenantScope - Returns changes that will be made by the deployment if executed at the scope of the tenant group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. // - options - DeploymentsClientBeginWhatIfAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtTenantScope @@ -2599,7 +2599,7 @@ func (client *DeploymentsClient) BeginWhatIfAtTenantScope(ctx context.Context, d // WhatIfAtTenantScope - Returns changes that will be made by the deployment if executed at the scope of the tenant group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *DeploymentsClient) whatIfAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtTenantScopeOptions) (*http.Response, error) { req, err := client.whatIfAtTenantScopeCreateRequest(ctx, deploymentName, parameters, options) if err != nil { @@ -2627,7 +2627,7 @@ func (client *DeploymentsClient) whatIfAtTenantScopeCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/resources/armresources/deployments_client_example_test.go b/sdk/resourcemanager/resources/armresources/deployments_client_example_test.go deleted file mode 100644 index 43d004201a10..000000000000 --- a/sdk/resourcemanager/resources/armresources/deployments_client_example_test.go +++ /dev/null @@ -1,1044 +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 armresources_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/resources/armresources" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtScope.json -func ExampleDeploymentsClient_BeginCreateOrUpdateAtScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdateAtScope(ctx, "providers/Microsoft.Management/managementGroups/my-management-group-id", "my-deployment", armresources.Deployment{ - Location: to.Ptr("eastus"), - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{ - URI: to.Ptr("https://example.com/exampleTemplate.json"), - }, - }, - Tags: map[string]*string{ - "tagKey1": to.Ptr("tag-value-1"), - "tagKey2": to.Ptr("tag-value-2"), - }, - }, 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.DeploymentExtended = armresources.DeploymentExtended{ - // Name: to.Ptr("my-deployment"), - // Type: to.Ptr("Microsoft.Resources/deployments"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/my-management-group-id/providers/Microsoft.Resources/deployments/my-deployment"), - // Location: to.Ptr("eastus"), - // Properties: &armresources.DeploymentPropertiesExtended{ - // CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Dependencies: []*armresources.Dependency{ - // { - // DependsOn: []*armresources.BasicDependency{ - // { - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/my-management-group-id/providers/Microsoft.Authorization/policyDefinitions/policy-definition-name"), - // ResourceName: to.Ptr("policy-definition-name"), - // ResourceType: to.Ptr("Microsoft.Authorization/policyDefinitions"), - // }}, - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/my-management-group-id/providers/Microsoft.Authorization/policyAssignments/location-lock"), - // ResourceName: to.Ptr("location-lock"), - // ResourceType: to.Ptr("Microsoft.Authorization/policyAssignments"), - // }}, - // Duration: to.Ptr("PT1.2970875S"), - // Mode: to.Ptr(armresources.DeploymentModeIncremental), - // Parameters: map[string]any{ - // }, - // Providers: []*armresources.Provider{ - // { - // Namespace: to.Ptr("Microsoft.Authorization"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // nil}, - // ResourceType: to.Ptr("policyDefinitions"), - // }, - // { - // Locations: []*string{ - // nil}, - // ResourceType: to.Ptr("policyAssignments"), - // }}, - // }, - // { - // Namespace: to.Ptr("Microsoft.Resources"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // to.Ptr("eastus")}, - // ResourceType: to.Ptr("deployments"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armresources.ProvisioningStateSucceeded), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-24T22:52:38.7895563Z"); return t}()), - // }, - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("tag-value-1"), - // "tagKey2": to.Ptr("tag-value-2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtTenant.json -func ExampleDeploymentsClient_BeginCreateOrUpdateAtTenantScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdateAtTenantScope(ctx, "tenant-dep01", armresources.ScopedDeployment{ - Location: to.Ptr("eastus"), - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{ - URI: to.Ptr("https://example.com/exampleTemplate.json"), - }, - }, - Tags: map[string]*string{ - "tagKey1": to.Ptr("tag-value-1"), - "tagKey2": to.Ptr("tag-value-2"), - }, - }, 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.DeploymentExtended = armresources.DeploymentExtended{ - // Name: to.Ptr("tenant-dep01"), - // Type: to.Ptr("Microsoft.Resources/deployments"), - // ID: to.Ptr("/providers/Microsoft.Resources/deployments/tenant-dep01"), - // Location: to.Ptr("eastus"), - // Properties: &armresources.DeploymentPropertiesExtended{ - // CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Dependencies: []*armresources.Dependency{ - // { - // DependsOn: []*armresources.BasicDependency{ - // { - // ID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/policy-definition-name"), - // ResourceName: to.Ptr("policy-definition-name"), - // ResourceType: to.Ptr("Microsoft.Authorization/policyDefinitions"), - // }}, - // ID: to.Ptr("/providers/Microsoft.Authorization/policyAssignments/location-lock"), - // ResourceName: to.Ptr("location-lock"), - // ResourceType: to.Ptr("Microsoft.Authorization/policyAssignments"), - // }}, - // Duration: to.Ptr("PT1.2970875S"), - // Mode: to.Ptr(armresources.DeploymentModeIncremental), - // Parameters: map[string]any{ - // }, - // Providers: []*armresources.Provider{ - // { - // Namespace: to.Ptr("Microsoft.Authorization"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // nil}, - // ResourceType: to.Ptr("policyDefinitions"), - // }, - // { - // Locations: []*string{ - // nil}, - // ResourceType: to.Ptr("policyAssignments"), - // }}, - // }, - // { - // Namespace: to.Ptr("Microsoft.Resources"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // to.Ptr("eastus")}, - // ResourceType: to.Ptr("deployments"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armresources.ProvisioningStateSucceeded), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-24T22:52:38.7895563Z"); return t}()), - // }, - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("tag-value-1"), - // "tagKey2": to.Ptr("tag-value-2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnTenant.json -func ExampleDeploymentsClient_BeginWhatIfAtTenantScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginWhatIfAtTenantScope(ctx, "exampleDeploymentName", armresources.ScopedDeploymentWhatIf{ - Location: to.Ptr("eastus"), - Properties: &armresources.DeploymentWhatIfProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{}, - }, - }, 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.WhatIfOperationResult = armresources.WhatIfOperationResult{ - // Properties: &armresources.WhatIfOperationProperties{ - // Changes: []*armresources.WhatIfChange{ - // { - // After: map[string]any{ - // "name": "myManagementGroup", - // "type": "Microsoft.Management/managementGroups", - // "apiVersion": "2019-11-01", - // "id": "/providers/Microsoft.Management/managementGroups/myManagementGroup", - // }, - // ChangeType: to.Ptr(armresources.ChangeTypeCreate), - // ResourceID: to.Ptr("/providers/Microsoft.Management/managementGroups/myManagementGroup"), - // }}, - // }, - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentAtManagementGroup.json -func ExampleDeploymentsClient_BeginCreateOrUpdateAtManagementGroupScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdateAtManagementGroupScope(ctx, "my-management-group-id", "my-deployment", armresources.ScopedDeployment{ - Location: to.Ptr("eastus"), - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{ - URI: to.Ptr("https://example.com/exampleTemplate.json"), - }, - }, - }, 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.DeploymentExtended = armresources.DeploymentExtended{ - // Name: to.Ptr("my-deployment"), - // Type: to.Ptr("Microsoft.Resources/deployments"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/my-management-group-id/providers/Microsoft.Resources/deployments/my-deployment"), - // Location: to.Ptr("eastus"), - // Properties: &armresources.DeploymentPropertiesExtended{ - // CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Dependencies: []*armresources.Dependency{ - // { - // DependsOn: []*armresources.BasicDependency{ - // { - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/my-management-group-id/providers/Microsoft.Authorization/policyDefinitions/policy-definition-name"), - // ResourceName: to.Ptr("policy-definition-name"), - // ResourceType: to.Ptr("Microsoft.Authorization/policyDefinitions"), - // }}, - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/my-management-group-id/providers/Microsoft.Authorization/policyAssignments/location-lock"), - // ResourceName: to.Ptr("location-lock"), - // ResourceType: to.Ptr("Microsoft.Authorization/policyAssignments"), - // }}, - // Duration: to.Ptr("PT1.2970875S"), - // Mode: to.Ptr(armresources.DeploymentModeIncremental), - // Parameters: map[string]any{ - // }, - // Providers: []*armresources.Provider{ - // { - // Namespace: to.Ptr("Microsoft.Authorization"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // nil}, - // ResourceType: to.Ptr("policyDefinitions"), - // }, - // { - // Locations: []*string{ - // nil}, - // ResourceType: to.Ptr("policyAssignments"), - // }}, - // }, - // { - // Namespace: to.Ptr("Microsoft.Resources"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // to.Ptr("eastus")}, - // ResourceType: to.Ptr("deployments"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armresources.ProvisioningStateSucceeded), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-24T22:52:38.7895563Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnManagementGroup.json -func ExampleDeploymentsClient_BeginWhatIfAtManagementGroupScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginWhatIfAtManagementGroupScope(ctx, "myManagementGruop", "exampleDeploymentName", armresources.ScopedDeploymentWhatIf{ - Location: to.Ptr("eastus"), - Properties: &armresources.DeploymentWhatIfProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{}, - }, - }, 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.WhatIfOperationResult = armresources.WhatIfOperationResult{ - // Properties: &armresources.WhatIfOperationProperties{ - // Changes: []*armresources.WhatIfChange{ - // { - // After: map[string]any{ - // "before":map[string]any{ - // "name": "myPolicyAssignment", - // "type": "Microsoft.Authorization/policyAssignments", - // "apiVersion": "2019-06-01", - // "id": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment", - // "location": "westus2", - // "properties":map[string]any{ - // "enforcementMode": "DoNotEnforce", - // "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyDefinition", - // "scope": "/subscriptions/00000000-0000-0000-0000-000000000001", - // }, - // }, - // "changeType": "Modify", - // "delta":[]any{ - // map[string]any{ - // "path": "properties.enforcementMode", - // "after": "DoNotEnforce", - // "before": "Default", - // "propertyChangeType": "Modify", - // }, - // }, - // "resourceId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment", - // }, - // Before: map[string]any{ - // "name": "myPolicyAssignment", - // "type": "Microsoft.Authorization/policyAssignments", - // "apiVersion": "2019-06-01", - // "id": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment", - // "location": "westus2", - // "properties":map[string]any{ - // "enforcementMode": "Default", - // "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyDefinition", - // "scope": "/subscriptions/00000000-0000-0000-0000-000000000001", - // }, - // }, - // ChangeType: to.Ptr(armresources.ChangeTypeModify), - // ResourceID: to.Ptr("/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment"), - // }, - // { - // After: map[string]any{ - // "name": "myPolicyAssignment2", - // "type": "Microsoft.Authorization/policyAssignments", - // "apiVersion": "2019-06-01", - // "id": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment2", - // "location": "westus2", - // "properties":map[string]any{ - // "enforcementMode": "Default", - // "policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyDefinition", - // "scope": "/subscriptions/00000000-0000-0000-0000-000000000002", - // }, - // }, - // ChangeType: to.Ptr(armresources.ChangeTypeCreate), - // ResourceID: to.Ptr("/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/myPolicyAssignment2"), - // }}, - // }, - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json -func ExampleDeploymentsClient_BeginCreateOrUpdateAtSubscriptionScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdateAtSubscriptionScope(ctx, "my-deployment", armresources.Deployment{ - Location: to.Ptr("eastus"), - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"), - }, - }, - }, 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.DeploymentExtended = armresources.DeploymentExtended{ - // Name: to.Ptr("my-deployment"), - // Type: to.Ptr("Microsoft.Resources/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/providers/Microsoft.Resources/deployments/my-deployment"), - // Location: to.Ptr("eastus"), - // Properties: &armresources.DeploymentPropertiesExtended{ - // CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Dependencies: []*armresources.Dependency{ - // }, - // Duration: to.Ptr("PT1.2637681S"), - // Mode: to.Ptr(armresources.DeploymentModeIncremental), - // OutputResources: []*armresources.ResourceReference{ - // }, - // Parameters: map[string]any{ - // }, - // Providers: []*armresources.Provider{ - // }, - // ProvisioningState: to.Ptr(armresources.ProvisioningStateSucceeded), - // TemplateHash: to.Ptr("0000000000000000000"), - // TemplateLink: &armresources.TemplateLink{ - // ContentVersion: to.Ptr("1.0.0.0"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"), - // }, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-05T01:51:58.6288067Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnSubscription.json -func ExampleDeploymentsClient_BeginWhatIfAtSubscriptionScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginWhatIfAtSubscriptionScope(ctx, "my-deployment", armresources.DeploymentWhatIf{ - Location: to.Ptr("westus"), - Properties: &armresources.DeploymentWhatIfProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{}, - }, - }, 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.WhatIfOperationResult = armresources.WhatIfOperationResult{ - // Properties: &armresources.WhatIfOperationProperties{ - // Changes: []*armresources.WhatIfChange{ - // { - // After: map[string]any{ - // "name": "myExistingIdentity", - // "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - // "apiVersion": "2018-11-30", - // "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myExistingIdentity", - // "location": "westus2", - // "tags":map[string]any{ - // "myNewTag": "my tag value", - // }, - // }, - // Before: map[string]any{ - // "name": "myExistingIdentity", - // "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - // "apiVersion": "2018-11-30", - // "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myExistingIdentity", - // "location": "westus2", - // }, - // ChangeType: to.Ptr(armresources.ChangeTypeModify), - // Delta: []*armresources.WhatIfPropertyChange{ - // { - // Path: to.Ptr("tags.myNewTag"), - // After: "my tag value", - // PropertyChangeType: to.Ptr(armresources.PropertyChangeTypeCreate), - // }}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myExistingIdentity"), - // }, - // { - // After: map[string]any{ - // "name": "myNewIdentity", - // "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - // "apiVersion": "2018-11-30", - // "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myNewIdentity", - // "location": "eastus", - // "tags":map[string]any{ - // "myOtherNewTag": "another new tag value", - // }, - // }, - // ChangeType: to.Ptr(armresources.ChangeTypeCreate), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myNewIdentity"), - // }, - // { - // After: map[string]any{ - // "name": "my-resource-group2", - // "type": "Microsoft.Resources/resourceGroups", - // "apiVersion": "2019-03-01", - // "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group2", - // "location": "{location3}", - // }, - // ChangeType: to.Ptr(armresources.ChangeTypeCreate), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group2"), - // }}, - // }, - // Status: to.Ptr("succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json -func ExampleDeploymentsClient_BeginCreateOrUpdate_createADeploymentThatWillDeployATemplateWithAUriAndQueryString() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, "my-resource-group", "my-deployment", armresources.Deployment{ - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{ - QueryString: to.Ptr("sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d"), - URI: to.Ptr("https://example.com/exampleTemplate.json"), - }, - }, - }, 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.DeploymentExtended = armresources.DeploymentExtended{ - // Name: to.Ptr("my-deployment"), - // Type: to.Ptr("Microsoft.Resources/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment"), - // Properties: &armresources.DeploymentPropertiesExtended{ - // CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Dependencies: []*armresources.Dependency{ - // }, - // Duration: to.Ptr("PT22.8356799S"), - // Mode: to.Ptr(armresources.DeploymentModeIncremental), - // OutputResources: []*armresources.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/my-storage-account"), - // }}, - // Parameters: map[string]any{ - // }, - // Providers: []*armresources.Provider{ - // { - // Namespace: to.Ptr("Microsoft.Storage"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // to.Ptr("eastus")}, - // ResourceType: to.Ptr("storageAccounts"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armresources.ProvisioningStateSucceeded), - // TemplateHash: to.Ptr("0000000000000000000"), - // TemplateLink: &armresources.TemplateLink{ - // ContentVersion: to.Ptr("1.0.0.0"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"), - // }, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-05T01:20:01.723776Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json -func ExampleDeploymentsClient_BeginCreateOrUpdate_createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, "my-resource-group", "my-deployment", armresources.Deployment{ - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"), - }, - }, - }, 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.DeploymentExtended = armresources.DeploymentExtended{ - // Name: to.Ptr("my-deployment"), - // Type: to.Ptr("Microsoft.Resources/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment"), - // Properties: &armresources.DeploymentPropertiesExtended{ - // CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Dependencies: []*armresources.Dependency{ - // }, - // Duration: to.Ptr("PT22.8356799S"), - // Mode: to.Ptr(armresources.DeploymentModeIncremental), - // OutputResources: []*armresources.ResourceReference{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Storage/storageAccounts/my-storage-account"), - // }}, - // Parameters: map[string]any{ - // }, - // Providers: []*armresources.Provider{ - // { - // Namespace: to.Ptr("Microsoft.Storage"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // to.Ptr("eastus")}, - // ResourceType: to.Ptr("storageAccounts"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armresources.ProvisioningStateSucceeded), - // TemplateHash: to.Ptr("0000000000000000000"), - // TemplateLink: &armresources.TemplateLink{ - // ContentVersion: to.Ptr("1.0.0.0"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1"), - // }, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-05T01:20:01.723776Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json -func ExampleDeploymentsClient_BeginCreateOrUpdate_createADeploymentThatWillRedeployAnotherDeploymentOnFailure() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, "my-resource-group", "my-deployment", armresources.Deployment{ - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeComplete), - OnErrorDeployment: &armresources.OnErrorDeployment{ - Type: to.Ptr(armresources.OnErrorDeploymentTypeSpecificDeployment), - DeploymentName: to.Ptr("name-of-deployment-to-use"), - }, - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{ - URI: to.Ptr("https://example.com/exampleTemplate.json"), - }, - }, - }, 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.DeploymentExtended = armresources.DeploymentExtended{ - // Name: to.Ptr("my-deployment"), - // Type: to.Ptr("Microsoft.Resources/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment"), - // Properties: &armresources.DeploymentPropertiesExtended{ - // CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Dependencies: []*armresources.Dependency{ - // { - // DependsOn: []*armresources.BasicDependency{ - // { - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1/Subnet1"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"), - // }, - // { - // DependsOn: []*armresources.BasicDependency{ - // { - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }, - // { - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1/Subnet1"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"), - // }}, - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1/Subnet2"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"), - // }}, - // Duration: to.Ptr("PT0.8204881S"), - // Mode: to.Ptr(armresources.DeploymentModeComplete), - // OnErrorDeployment: &armresources.OnErrorDeploymentExtended{ - // Type: to.Ptr(armresources.OnErrorDeploymentTypeSpecificDeployment), - // DeploymentName: to.Ptr("name-of-deployment-to-use"), - // }, - // Parameters: map[string]any{ - // }, - // Providers: []*armresources.Provider{ - // { - // Namespace: to.Ptr("Microsoft.Network"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // to.Ptr("centralus")}, - // ResourceType: to.Ptr("virtualNetworks"), - // }, - // { - // Locations: []*string{ - // to.Ptr("centralus")}, - // ResourceType: to.Ptr("virtualNetworks/subnets"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armresources.ProvisioningStateSucceeded), - // TemplateLink: &armresources.TemplateLink{ - // ContentVersion: to.Ptr("1.0.0.0"), - // URI: to.Ptr("https://example.com/exampleTemplate.json"), - // }, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json -func ExampleDeploymentsClient_BeginCreateOrUpdate_createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, "my-resource-group", "my-deployment", armresources.Deployment{ - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeComplete), - OnErrorDeployment: &armresources.OnErrorDeployment{ - Type: to.Ptr(armresources.OnErrorDeploymentTypeLastSuccessful), - }, - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{ - URI: to.Ptr("https://example.com/exampleTemplate.json"), - }, - }, - }, 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.DeploymentExtended = armresources.DeploymentExtended{ - // Name: to.Ptr("my-deployment"), - // Type: to.Ptr("Microsoft.Resources/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/Microsoft.Resources/deployments/my-deployment"), - // Properties: &armresources.DeploymentPropertiesExtended{ - // CorrelationID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Dependencies: []*armresources.Dependency{ - // { - // DependsOn: []*armresources.BasicDependency{ - // { - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }}, - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1/Subnet1"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"), - // }, - // { - // DependsOn: []*armresources.BasicDependency{ - // { - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks"), - // }, - // { - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1/Subnet1"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"), - // }}, - // ID: to.Ptr("{resourceid}"), - // ResourceName: to.Ptr("VNet1/Subnet2"), - // ResourceType: to.Ptr("Microsoft.Network/virtualNetworks/subnets"), - // }}, - // Duration: to.Ptr("PT0.8204881S"), - // Mode: to.Ptr(armresources.DeploymentModeComplete), - // OnErrorDeployment: &armresources.OnErrorDeploymentExtended{ - // Type: to.Ptr(armresources.OnErrorDeploymentTypeLastSuccessful), - // DeploymentName: to.Ptr("{nameOfLastSuccesfulDeployment}"), - // }, - // Parameters: map[string]any{ - // }, - // Providers: []*armresources.Provider{ - // { - // Namespace: to.Ptr("Microsoft.Network"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Locations: []*string{ - // to.Ptr("centralus")}, - // ResourceType: to.Ptr("virtualNetworks"), - // }, - // { - // Locations: []*string{ - // to.Ptr("centralus")}, - // ResourceType: to.Ptr("virtualNetworks/subnets"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armresources.ProvisioningStateSucceeded), - // TemplateLink: &armresources.TemplateLink{ - // ContentVersion: to.Ptr("1.0.0.0"), - // URI: to.Ptr("https://example.com/exampleTemplate.json"), - // }, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T00:00:00.0000000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PostDeploymentWhatIfOnResourceGroup.json -func ExampleDeploymentsClient_BeginWhatIf() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginWhatIf(ctx, "my-resource-group", "my-deployment", armresources.DeploymentWhatIf{ - Properties: &armresources.DeploymentWhatIfProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]any{}, - TemplateLink: &armresources.TemplateLink{}, - }, - }, 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.WhatIfOperationResult = armresources.WhatIfOperationResult{ - // Properties: &armresources.WhatIfOperationProperties{ - // Changes: []*armresources.WhatIfChange{ - // { - // After: map[string]any{ - // "name": "myExistingIdentity", - // "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - // "apiVersion": "2018-11-30", - // "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myExistingIdentity", - // "location": "westus2", - // "tags":map[string]any{ - // "myNewTag": "my tag value", - // }, - // }, - // Before: map[string]any{ - // "name": "myExistingIdentity", - // "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - // "apiVersion": "2018-11-30", - // "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myExistingIdentity", - // "location": "westus2", - // }, - // ChangeType: to.Ptr(armresources.ChangeTypeModify), - // Delta: []*armresources.WhatIfPropertyChange{ - // { - // Path: to.Ptr("tags.myNewTag"), - // After: "my tag value", - // PropertyChangeType: to.Ptr(armresources.PropertyChangeTypeCreate), - // }}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myExistingIdentity"), - // }, - // { - // After: map[string]any{ - // "name": "myNewIdentity", - // "type": "Microsoft.ManagedIdentity/userAssignedIdentities", - // "apiVersion": "2018-11-30", - // "id": "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myNewIdentity", - // "location": "eastus", - // "tags":map[string]any{ - // "myOtherNewTag": "another new tag value", - // }, - // }, - // ChangeType: to.Ptr(armresources.ChangeTypeCreate), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myNewIdentity"), - // }}, - // }, - // Status: to.Ptr("succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CalculateTemplateHash.json -func ExampleDeploymentsClient_CalculateTemplateHash() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().CalculateTemplateHash(ctx, map[string]any{ - "$schema": "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", - "contentVersion": "1.0.0.0", - "outputs": map[string]any{ - "string": map[string]any{ - "type": "string", - "value": "myvalue", - }, - }, - "parameters": map[string]any{ - "string": map[string]any{ - "type": "string", - }, - }, - "resources": []any{}, - "variables": map[string]any{ - "array": []any{ - float64(1), - float64(2), - float64(3), - float64(4), - }, - "bool": true, - "int": float64(42), - "object": map[string]any{ - "object": map[string]any{ - "location": "West US", - "vmSize": "Large", - }, - }, - "string": "string", - }, - }, 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.TemplateHashResult = armresources.TemplateHashResult{ - // MinifiedTemplate: to.Ptr("{\"$SCHEMA\":\"HTTP://SCHEMAS.MANAGEMENT.AZURE.COM/DEPLOYMENTTEMPLATE?API-VERSION=2014-04-01-PREVIEW\",\"CONTENTVERSION\":\"1.0.0.0\",\"PARAMETERS\":{\"STRING\":{\"TYPE\":\"STRING\"}},\"VARIABLES\":{\"STRING\":\"STRING\",\"INT\":42,\"BOOL\":TRUE,\"ARRAY\":[1,2,3,4],\"OBJECT\":{\"OBJECT\":{\"VMSIZE\":\"LARGE\",\"LOCATION\":\"WEST US\"}}},\"RESOURCES\":[],\"OUTPUTS\":{\"STRING\":{\"TYPE\":\"STRING\",\"VALUE\":\"MYVALUE\"}}}"), - // TemplateHash: to.Ptr("695440707931307747"), - // } -} diff --git a/sdk/resourcemanager/resources/armresources/go.mod b/sdk/resourcemanager/resources/armresources/go.mod index 49b07d1790cc..9f4bdf3b7156 100644 --- a/sdk/resourcemanager/resources/armresources/go.mod +++ b/sdk/resourcemanager/resources/armresources/go.mod @@ -1,16 +1,16 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/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/azidentity v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/resources/armresources/models.go b/sdk/resourcemanager/resources/armresources/models.go index 4c1ed376b59a..4c93e9e228e9 100644 --- a/sdk/resourcemanager/resources/armresources/models.go +++ b/sdk/resourcemanager/resources/armresources/models.go @@ -205,7 +205,7 @@ type ClientListOptions struct { // plan and plan/publisher and plan/name, and identity and // identity/principalId. Filter *string - // The number of results to return. If null is passed, returns all resources. + // The number of recommendations per page if a paged version of this API is being used. Top *int32 } @@ -408,6 +408,15 @@ type DeploymentOperationsListResult struct { NextLink *string } +// DeploymentParameter - Deployment parameter for the template. +type DeploymentParameter struct { + // Azure Key Vault parameter reference. + Reference *KeyVaultParameterReference + + // Input value to the parameter . + Value any +} + // DeploymentProperties - Deployment properties. type DeploymentProperties struct { // REQUIRED; The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, @@ -1043,6 +1052,24 @@ type IdentityUserAssignedIdentitiesValue struct { PrincipalID *string } +// KeyVaultParameterReference - Azure Key Vault parameter reference. +type KeyVaultParameterReference struct { + // REQUIRED; Azure Key Vault reference. + KeyVault *KeyVaultReference + + // REQUIRED; Azure Key Vault secret name. + SecretName *string + + // Azure Key Vault secret version. + SecretVersion *string +} + +// KeyVaultReference - Azure Key Vault reference. +type KeyVaultReference struct { + // REQUIRED; Azure Key Vault resource id. + ID *string +} + // MoveInfo - Parameters of move resources. type MoveInfo struct { // The IDs of the resources. @@ -1622,9 +1649,23 @@ type Tags struct { Tags map[string]*string } -// TagsClientCreateOrUpdateAtScopeOptions contains the optional parameters for the TagsClient.CreateOrUpdateAtScope method. -type TagsClientCreateOrUpdateAtScopeOptions struct { - // placeholder for future optional parameters +// TagsClientBeginCreateOrUpdateAtScopeOptions contains the optional parameters for the TagsClient.BeginCreateOrUpdateAtScope +// method. +type TagsClientBeginCreateOrUpdateAtScopeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TagsClientBeginDeleteAtScopeOptions contains the optional parameters for the TagsClient.BeginDeleteAtScope method. +type TagsClientBeginDeleteAtScopeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TagsClientBeginUpdateAtScopeOptions contains the optional parameters for the TagsClient.BeginUpdateAtScope method. +type TagsClientBeginUpdateAtScopeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // TagsClientCreateOrUpdateOptions contains the optional parameters for the TagsClient.CreateOrUpdate method. @@ -1637,11 +1678,6 @@ type TagsClientCreateOrUpdateValueOptions struct { // placeholder for future optional parameters } -// TagsClientDeleteAtScopeOptions contains the optional parameters for the TagsClient.DeleteAtScope method. -type TagsClientDeleteAtScopeOptions struct { - // placeholder for future optional parameters -} - // TagsClientDeleteOptions contains the optional parameters for the TagsClient.Delete method. type TagsClientDeleteOptions struct { // placeholder for future optional parameters @@ -1662,11 +1698,6 @@ type TagsClientListOptions struct { // placeholder for future optional parameters } -// TagsClientUpdateAtScopeOptions contains the optional parameters for the TagsClient.UpdateAtScope method. -type TagsClientUpdateAtScopeOptions struct { - // placeholder for future optional parameters -} - // TagsListResult - List of subscription tags. type TagsListResult struct { // An array of tags. diff --git a/sdk/resourcemanager/resources/armresources/models_serde.go b/sdk/resourcemanager/resources/armresources/models_serde.go index df592fc850b9..c8647a9bbbb2 100644 --- a/sdk/resourcemanager/resources/armresources/models_serde.go +++ b/sdk/resourcemanager/resources/armresources/models_serde.go @@ -596,6 +596,37 @@ func (d *DeploymentOperationsListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DeploymentParameter. +func (d DeploymentParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "reference", d.Reference) + populateAny(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentParameter. +func (d *DeploymentParameter) UnmarshalJSON(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 "reference": + err = unpopulate(val, "Reference", &d.Reference) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + 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 DeploymentProperties. func (d DeploymentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1339,6 +1370,68 @@ func (i *IdentityUserAssignedIdentitiesValue) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type KeyVaultParameterReference. +func (k KeyVaultParameterReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyVault", k.KeyVault) + populate(objectMap, "secretName", k.SecretName) + populate(objectMap, "secretVersion", k.SecretVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultParameterReference. +func (k *KeyVaultParameterReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyVault": + err = unpopulate(val, "KeyVault", &k.KeyVault) + delete(rawMsg, key) + case "secretName": + err = unpopulate(val, "SecretName", &k.SecretName) + delete(rawMsg, key) + case "secretVersion": + err = unpopulate(val, "SecretVersion", &k.SecretVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultReference. +func (k KeyVaultReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", k.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultReference. +func (k *KeyVaultReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &k.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MoveInfo. func (m MoveInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/resources/armresources/operations_client.go b/sdk/resourcemanager/resources/armresources/operations_client.go index bd4359ecee0a..1e013d931f0f 100644 --- a/sdk/resourcemanager/resources/armresources/operations_client.go +++ b/sdk/resourcemanager/resources/armresources/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Microsoft.Resources REST API operations. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go b/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go index c4b54fa84461..5f9d48312f76 100644 --- a/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go +++ b/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go @@ -47,7 +47,7 @@ func NewProviderResourceTypesClient(subscriptionID string, credential azcore.Tok // List - List the resource types for a specified resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceProviderNamespace - The namespace of the resource provider. // - options - ProviderResourceTypesClientListOptions contains the optional parameters for the ProviderResourceTypesClient.List // method. @@ -85,7 +85,7 @@ func (client *ProviderResourceTypesClient) listCreateRequest(ctx context.Context if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resources/armresources/providerresourcetypes_client_example_test.go b/sdk/resourcemanager/resources/armresources/providerresourcetypes_client_example_test.go deleted file mode 100644 index 1dcaf8920e8e..000000000000 --- a/sdk/resourcemanager/resources/armresources/providerresourcetypes_client_example_test.go +++ /dev/null @@ -1,67 +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 armresources_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderResourceTypes.json -func ExampleProviderResourceTypesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderResourceTypesClient().List(ctx, "Microsoft.TestRP", &armresources.ProviderResourceTypesClientListOptions{Expand: 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.ProviderResourceTypeListResult = armresources.ProviderResourceTypeListResult{ - // Value: []*armresources.ProviderResourceType{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-01-01"), - // to.Ptr("2015-05-01")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // LocationMappings: []*armresources.ProviderExtendedLocation{ - // { - // Type: to.Ptr("EdgeZone"), - // ExtendedLocations: []*string{ - // to.Ptr("LosAngeles"), - // to.Ptr("LosAngeles2")}, - // Location: to.Ptr("West US"), - // }}, - // Locations: []*string{ - // to.Ptr("West US")}, - // ResourceType: to.Ptr("TestResourceType"), - // }, - // { - // APIVersions: []*string{ - // to.Ptr("2018-01-01"), - // to.Ptr("2015-05-01")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // Locations: []*string{ - // to.Ptr("West US")}, - // ResourceType: to.Ptr("TestResourceTypeSibling"), - // }}, - // } -} diff --git a/sdk/resourcemanager/resources/armresources/providers_client.go b/sdk/resourcemanager/resources/armresources/providers_client.go index cefb0e0393e7..d31f6054dcba 100644 --- a/sdk/resourcemanager/resources/armresources/providers_client.go +++ b/sdk/resourcemanager/resources/armresources/providers_client.go @@ -47,7 +47,7 @@ func NewProvidersClient(subscriptionID string, credential azcore.TokenCredential // Get - Gets the specified resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceProviderNamespace - The namespace of the resource provider. // - options - ProvidersClientGetOptions contains the optional parameters for the ProvidersClient.Get method. func (client *ProvidersClient) Get(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientGetOptions) (ProvidersClientGetResponse, error) { @@ -84,7 +84,7 @@ func (client *ProvidersClient) getCreateRequest(ctx context.Context, resourcePro if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -102,7 +102,7 @@ func (client *ProvidersClient) getHandleResponse(resp *http.Response) (Providers // GetAtTenantScope - Gets the specified resource provider at the tenant level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceProviderNamespace - The namespace of the resource provider. // - options - ProvidersClientGetAtTenantScopeOptions contains the optional parameters for the ProvidersClient.GetAtTenantScope // method. @@ -136,7 +136,7 @@ func (client *ProvidersClient) getAtTenantScopeCreateRequest(ctx context.Context if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -153,7 +153,7 @@ func (client *ProvidersClient) getAtTenantScopeHandleResponse(resp *http.Respons // NewListPager - Gets all resource providers for a subscription. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - options - ProvidersClientListOptions contains the optional parameters for the ProvidersClient.NewListPager method. func (client *ProvidersClient) NewListPager(options *ProvidersClientListOptions) *runtime.Pager[ProvidersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProvidersClientListResponse]{ @@ -198,7 +198,7 @@ func (client *ProvidersClient) listCreateRequest(ctx context.Context, options *P if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,7 @@ func (client *ProvidersClient) listHandleResponse(resp *http.Response) (Provider // NewListAtTenantScopePager - Gets all resource providers for the tenant. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - options - ProvidersClientListAtTenantScopeOptions contains the optional parameters for the ProvidersClient.NewListAtTenantScopePager // method. func (client *ProvidersClient) NewListAtTenantScopePager(options *ProvidersClientListAtTenantScopeOptions) *runtime.Pager[ProvidersClientListAtTenantScopeResponse] { @@ -257,7 +257,7 @@ func (client *ProvidersClient) listAtTenantScopeCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,7 +275,7 @@ func (client *ProvidersClient) listAtTenantScopeHandleResponse(resp *http.Respon // ProviderPermissions - Get the provider permissions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceProviderNamespace - The namespace of the resource provider. // - options - ProvidersClientProviderPermissionsOptions contains the optional parameters for the ProvidersClient.ProviderPermissions // method. @@ -310,7 +310,7 @@ func (client *ProvidersClient) providerPermissionsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *ProvidersClient) providerPermissionsHandleResponse(resp *http.Resp // Register - Registers a subscription with a resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceProviderNamespace - The namespace of the resource provider to register. // - options - ProvidersClientRegisterOptions contains the optional parameters for the ProvidersClient.Register method. func (client *ProvidersClient) Register(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientRegisterOptions) (ProvidersClientRegisterResponse, error) { @@ -362,7 +362,7 @@ func (client *ProvidersClient) registerCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Properties != nil { @@ -380,10 +380,12 @@ func (client *ProvidersClient) registerHandleResponse(resp *http.Response) (Prov return result, nil } -// RegisterAtManagementGroupScope - Registers a management group with a resource provider. +// RegisterAtManagementGroupScope - Registers a management group with a resource provider. Use this operation to register +// a resource provider with resource types that can be deployed at the management group scope. It does not +// recursively register subscriptions within the management group. Instead, you must register subscriptions individually. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceProviderNamespace - The namespace of the resource provider to register. // - groupID - The management group ID. // - options - ProvidersClientRegisterAtManagementGroupScopeOptions contains the optional parameters for the ProvidersClient.RegisterAtManagementGroupScope @@ -419,7 +421,7 @@ func (client *ProvidersClient) registerAtManagementGroupScopeCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -428,7 +430,7 @@ func (client *ProvidersClient) registerAtManagementGroupScopeCreateRequest(ctx c // Unregister - Unregisters a subscription from a resource provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceProviderNamespace - The namespace of the resource provider to unregister. // - options - ProvidersClientUnregisterOptions contains the optional parameters for the ProvidersClient.Unregister method. func (client *ProvidersClient) Unregister(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientUnregisterOptions) (ProvidersClientUnregisterResponse, error) { @@ -462,7 +464,7 @@ func (client *ProvidersClient) unregisterCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resources/armresources/providers_client_example_test.go b/sdk/resourcemanager/resources/armresources/providers_client_example_test.go deleted file mode 100644 index da8fa377cdc9..000000000000 --- a/sdk/resourcemanager/resources/armresources/providers_client_example_test.go +++ /dev/null @@ -1,532 +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 armresources_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/resources/armresources" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviderPermissions.json -func ExampleProvidersClient_ProviderPermissions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProvidersClient().ProviderPermissions(ctx, "Microsoft.TestRP", 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.ProviderPermissionListResult = armresources.ProviderPermissionListResult{ - // Value: []*armresources.ProviderPermission{ - // { - // ApplicationID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // ProviderAuthorizationConsentState: to.Ptr(armresources.ProviderAuthorizationConsentStateConsented), - // RoleDefinition: &armresources.RoleDefinition{ - // Name: to.Ptr("Contoso service role"), - // ID: to.Ptr("00000000000000000000000000000000"), - // IsServiceRole: to.Ptr(true), - // Permissions: []*armresources.Permission{ - // { - // Actions: []*string{ - // to.Ptr("Microsoft.Contoso/*")}, - // DataActions: []*string{ - // }, - // NotActions: []*string{ - // }, - // NotDataActions: []*string{ - // }, - // }}, - // Scopes: []*string{ - // to.Ptr("/")}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProviders.json -func ExampleProvidersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProvidersClient().NewListPager(&armresources.ProvidersClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProviderListResult = armresources.ProviderListResult{ - // Value: []*armresources.Provider{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.TestRP1"), - // Namespace: to.Ptr("Microsoft.TestRP1"), - // RegistrationPolicy: to.Ptr("RegistrationRequired"), - // RegistrationState: to.Ptr("Registering"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-01-01"), - // to.Ptr("2015-05-01")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // LocationMappings: []*armresources.ProviderExtendedLocation{ - // { - // Type: to.Ptr("EdgeZone"), - // ExtendedLocations: []*string{ - // to.Ptr("LosAngeles"), - // to.Ptr("LosAngeles2")}, - // Location: to.Ptr("West US"), - // }}, - // Locations: []*string{ - // to.Ptr("West US")}, - // ResourceType: to.Ptr("TestResourceType"), - // }, - // { - // APIVersions: []*string{ - // to.Ptr("2018-01-01"), - // to.Ptr("2015-05-01")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // Locations: []*string{ - // to.Ptr("West US")}, - // ResourceType: to.Ptr("TestResourceTypeSibling"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources"), - // Namespace: to.Ptr("Microsoft.Resources"), - // RegistrationPolicy: to.Ptr("RegistrationFree"), - // RegistrationState: to.Ptr("Registered"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Aliases: []*armresources.Alias{ - // }, - // APIVersions: []*string{ - // to.Ptr("2016-09-01"), - // to.Ptr("2014-04-01-preview")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // Locations: []*string{ - // to.Ptr("eastus"), - // to.Ptr("eastus2"), - // to.Ptr("westus")}, - // ResourceType: to.Ptr("subscriptions"), - // }, - // { - // Aliases: []*armresources.Alias{ - // }, - // APIVersions: []*string{ - // to.Ptr("2016-09-01"), - // to.Ptr("2014-04-01-preview")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // Locations: []*string{ - // to.Ptr("centralus"), - // to.Ptr("eastasia"), - // to.Ptr("southeastasia")}, - // ResourceType: to.Ptr("resourceGroups"), - // }, - // { - // Aliases: []*armresources.Alias{ - // }, - // APIVersions: []*string{ - // to.Ptr("2016-09-01"), - // to.Ptr("2014-04-01-preview")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // Locations: []*string{ - // to.Ptr("eastus"), - // to.Ptr("eastus2"), - // to.Ptr("westus")}, - // ResourceType: to.Ptr("subscriptions/resourceGroups"), - // }, - // { - // Aliases: []*armresources.Alias{ - // }, - // APIVersions: []*string{ - // to.Ptr("2014-04-01-preview")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // Locations: []*string{ - // to.Ptr("centralus"), - // to.Ptr("eastasia")}, - // ResourceType: to.Ptr("bulkDelete"), - // }, - // { - // Aliases: []*armresources.Alias{ - // }, - // APIVersions: []*string{ - // to.Ptr("2017-08-01"), - // to.Ptr("2017-06-01")}, - // Capabilities: to.Ptr("SupportsTags"), - // Locations: []*string{ - // }, - // ResourceType: to.Ptr("deployments"), - // }, - // { - // Aliases: []*armresources.Alias{ - // }, - // APIVersions: []*string{ - // }, - // Capabilities: to.Ptr("SupportsExtension"), - // Locations: []*string{ - // to.Ptr("DevFabric")}, - // ResourceType: to.Ptr("tags"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.TestRP2"), - // Namespace: to.Ptr("Microsoft.TestRP2"), - // RegistrationPolicy: to.Ptr("RegistrationRequired"), - // RegistrationState: to.Ptr("NotRegistered"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-01-01"), - // to.Ptr("2015-05-01")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // LocationMappings: []*armresources.ProviderExtendedLocation{ - // { - // Type: to.Ptr("EdgeZone"), - // ExtendedLocations: []*string{ - // to.Ptr("LosAngeles"), - // to.Ptr("LosAngeles2")}, - // Location: to.Ptr("West US"), - // }}, - // Locations: []*string{ - // to.Ptr("West US")}, - // ResourceType: to.Ptr("TestResourceType"), - // }, - // { - // APIVersions: []*string{ - // to.Ptr("2018-01-01"), - // to.Ptr("2015-05-01")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // Locations: []*string{ - // to.Ptr("West US")}, - // ResourceType: to.Ptr("TestResourceTypeSibling"), - // }}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetProvider.json -func ExampleProvidersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProvidersClient().Get(ctx, "Microsoft.TestRP1", &armresources.ProvidersClientGetOptions{Expand: 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.Provider = armresources.Provider{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.TestRP1"), - // Namespace: to.Ptr("Microsoft.TestRP1"), - // RegistrationPolicy: to.Ptr("RegistrationRequired"), - // RegistrationState: to.Ptr("Registering"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // APIVersions: []*string{ - // to.Ptr("2018-01-01"), - // to.Ptr("2015-05-01")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // LocationMappings: []*armresources.ProviderExtendedLocation{ - // { - // Type: to.Ptr("EdgeZone"), - // ExtendedLocations: []*string{ - // to.Ptr("LosAngeles"), - // to.Ptr("LosAngeles2")}, - // Location: to.Ptr("West US"), - // }}, - // Locations: []*string{ - // to.Ptr("West US")}, - // ResourceType: to.Ptr("TestResourceType"), - // }, - // { - // APIVersions: []*string{ - // to.Ptr("2018-01-01"), - // to.Ptr("2015-05-01")}, - // Capabilities: to.Ptr("CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"), - // Locations: []*string{ - // to.Ptr("West US")}, - // ResourceType: to.Ptr("TestResourceTypeSibling"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetNamedProviderAtTenant.json -func ExampleProvidersClient_GetAtTenantScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProvidersClient().GetAtTenantScope(ctx, "Microsoft.Storage", &armresources.ProvidersClientGetAtTenantScopeOptions{Expand: to.Ptr("resourceTypes/aliases")}) - 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.Provider = armresources.Provider{ - // Namespace: to.Ptr("Microsoft.Storage"), - // ResourceTypes: []*armresources.ProviderResourceType{ - // { - // Aliases: []*armresources.Alias{ - // { - // Name: to.Ptr("Microsoft.Storage/storageAccounts/accountType"), - // DefaultPath: to.Ptr("sku.name"), - // Paths: []*armresources.AliasPath{ - // { - // Path: to.Ptr("properties.accountType"), - // APIVersions: []*string{ - // to.Ptr("2015-06-15"), - // to.Ptr("2015-05-01-preview")}, - // }, - // { - // Path: to.Ptr("sku.name"), - // APIVersions: []*string{ - // to.Ptr("2018-11-01"), - // to.Ptr("2018-11-09"), - // to.Ptr("2018-07-01"), - // to.Ptr("2018-03-01-Preview"), - // to.Ptr("2018-02-01"), - // to.Ptr("2017-10-01"), - // to.Ptr("2017-06-01"), - // to.Ptr("2016-12-01"), - // to.Ptr("2016-05-01"), - // to.Ptr("2016-01-01")}, - // }}, - // }, - // { - // Name: to.Ptr("Microsoft.Storage/storageAccounts/sku.name"), - // DefaultPath: to.Ptr("sku.name"), - // Paths: []*armresources.AliasPath{ - // { - // Path: to.Ptr("properties.accountType"), - // APIVersions: []*string{ - // to.Ptr("2015-06-15"), - // to.Ptr("2015-05-01-preview")}, - // }, - // { - // Path: to.Ptr("sku.name"), - // APIVersions: []*string{ - // to.Ptr("2018-11-01"), - // to.Ptr("2018-11-09"), - // to.Ptr("2018-07-01"), - // to.Ptr("2018-03-01-Preview"), - // to.Ptr("2018-02-01"), - // to.Ptr("2017-10-01"), - // to.Ptr("2017-06-01"), - // to.Ptr("2016-12-01"), - // to.Ptr("2016-05-01"), - // to.Ptr("2016-01-01")}, - // }}, - // }, - // { - // Name: to.Ptr("Microsoft.Storage/storageAccounts/accessTier"), - // DefaultPath: to.Ptr("properties.accessTier"), - // Paths: []*armresources.AliasPath{ - // { - // Path: to.Ptr("properties.accessTier"), - // APIVersions: []*string{ - // to.Ptr("2018-11-01"), - // to.Ptr("2018-11-09"), - // to.Ptr("2018-07-01"), - // to.Ptr("2018-03-01-Preview"), - // to.Ptr("2018-02-01"), - // to.Ptr("2017-10-01"), - // to.Ptr("2017-06-01"), - // to.Ptr("2016-12-01"), - // to.Ptr("2016-05-01"), - // to.Ptr("2016-01-01"), - // to.Ptr("2015-06-15"), - // to.Ptr("2015-05-01-preview")}, - // }}, - // }, - // { - // Name: to.Ptr("Microsoft.Storage/storageAccounts/enableBlobEncryption"), - // DefaultPath: to.Ptr("properties.encryption.services.blob.enabled"), - // Paths: []*armresources.AliasPath{ - // { - // Path: to.Ptr("properties.encryption.services.blob.enabled"), - // APIVersions: []*string{ - // to.Ptr("2018-11-01"), - // to.Ptr("2018-11-09"), - // to.Ptr("2018-07-01"), - // to.Ptr("2018-03-01-Preview"), - // to.Ptr("2018-02-01"), - // to.Ptr("2017-10-01"), - // to.Ptr("2017-06-01"), - // to.Ptr("2016-12-01"), - // to.Ptr("2016-05-01"), - // to.Ptr("2016-01-01"), - // to.Ptr("2015-06-15"), - // to.Ptr("2015-05-01-preview")}, - // }}, - // }, - // { - // Name: to.Ptr("Microsoft.Storage/storageAccounts/enableFileEncryption"), - // DefaultPath: to.Ptr("properties.encryption.services.file.enabled"), - // Paths: []*armresources.AliasPath{ - // { - // Path: to.Ptr("properties.encryption.services.file.enabled"), - // APIVersions: []*string{ - // to.Ptr("2018-11-01"), - // to.Ptr("2018-11-09"), - // to.Ptr("2018-07-01"), - // to.Ptr("2018-03-01-Preview"), - // to.Ptr("2018-02-01"), - // to.Ptr("2017-10-01"), - // to.Ptr("2017-06-01"), - // to.Ptr("2016-12-01"), - // to.Ptr("2016-05-01"), - // to.Ptr("2016-01-01"), - // to.Ptr("2015-06-15"), - // to.Ptr("2015-05-01-preview")}, - // }}, - // }, - // { - // Name: to.Ptr("Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly"), - // DefaultMetadata: &armresources.AliasPathMetadata{ - // Type: to.Ptr(armresources.AliasPathTokenTypeBoolean), - // Attributes: to.Ptr(armresources.AliasPathAttributesModifiable), - // }, - // DefaultPath: to.Ptr("properties.supportsHttpsTrafficOnly"), - // Paths: []*armresources.AliasPath{ - // { - // Path: to.Ptr("properties.supportsHttpsTrafficOnly"), - // APIVersions: []*string{ - // to.Ptr("2018-11-09"), - // to.Ptr("2018-03-01-Preview"), - // to.Ptr("2016-05-01"), - // to.Ptr("2016-01-01"), - // to.Ptr("2015-06-15"), - // to.Ptr("2015-05-01-preview")}, - // Metadata: &armresources.AliasPathMetadata{ - // Type: to.Ptr(armresources.AliasPathTokenTypeNotSpecified), - // Attributes: to.Ptr(armresources.AliasPathAttributesNone), - // }, - // }}, - // }}, - // APIProfiles: []*armresources.APIProfile{ - // { - // APIVersion: to.Ptr("2017-10-01"), - // ProfileVersion: to.Ptr("2019-03-01-hybrid"), - // }, - // { - // APIVersion: to.Ptr("2016-01-01"), - // ProfileVersion: to.Ptr("2017-03-09-profile"), - // }, - // { - // APIVersion: to.Ptr("2016-01-01"), - // ProfileVersion: to.Ptr("2018-03-01-hybrid"), - // }, - // { - // APIVersion: to.Ptr("2017-10-01"), - // ProfileVersion: to.Ptr("2018-06-01-profile"), - // }}, - // APIVersions: []*string{ - // to.Ptr("2019-06-01"), - // to.Ptr("2019-04-01"), - // to.Ptr("2018-11-01"), - // to.Ptr("2018-07-01"), - // to.Ptr("2018-03-01-preview"), - // to.Ptr("2018-02-01"), - // to.Ptr("2017-10-01"), - // to.Ptr("2017-06-01"), - // to.Ptr("2016-12-01"), - // to.Ptr("2016-05-01"), - // to.Ptr("2016-01-01"), - // to.Ptr("2015-06-15"), - // to.Ptr("2015-05-01-preview")}, - // Capabilities: to.Ptr("SupportsTags, SupportsLocation"), - // DefaultAPIVersion: to.Ptr("2019-06-01"), - // Locations: []*string{ - // to.Ptr("East US"), - // to.Ptr("East US 2"), - // to.Ptr("East US 2 (Stage)"), - // to.Ptr("West US"), - // to.Ptr("West Europe"), - // to.Ptr("East Asia"), - // to.Ptr("Southeast Asia"), - // to.Ptr("Japan East"), - // to.Ptr("Japan West"), - // to.Ptr("North Central US"), - // to.Ptr("South Central US"), - // to.Ptr("Central US"), - // to.Ptr("North Europe"), - // to.Ptr("Brazil South"), - // to.Ptr("Australia East"), - // to.Ptr("Australia Southeast"), - // to.Ptr("South India"), - // to.Ptr("Central India"), - // to.Ptr("West India"), - // to.Ptr("Canada East"), - // to.Ptr("Canada Central"), - // to.Ptr("West US 2"), - // to.Ptr("West Central US"), - // to.Ptr("UK South"), - // to.Ptr("UK West"), - // to.Ptr("Korea Central"), - // to.Ptr("Korea South"), - // to.Ptr("East US 2 EUAP"), - // to.Ptr("Central US EUAP"), - // to.Ptr("France Central"), - // to.Ptr("France South"), - // to.Ptr("Australia Central"), - // to.Ptr("Australia Central 2"), - // to.Ptr("South Africa West"), - // to.Ptr("South Africa North"), - // to.Ptr("UAE Central"), - // to.Ptr("UAE North"), - // to.Ptr("Switzerland North"), - // to.Ptr("Switzerland West"), - // to.Ptr("Germany West Central"), - // to.Ptr("Germany North"), - // to.Ptr("Norway East"), - // to.Ptr("Norway West"), - // to.Ptr("South Central US STG"), - // to.Ptr("Brazil Southeast")}, - // ResourceType: to.Ptr("storageAccounts"), - // }}, - // } -} diff --git a/sdk/resourcemanager/resources/armresources/resourcegroups_client.go b/sdk/resourcemanager/resources/armresources/resourcegroups_client.go index cf48c26f5191..6718cfee0a97 100644 --- a/sdk/resourcemanager/resources/armresources/resourcegroups_client.go +++ b/sdk/resourcemanager/resources/armresources/resourcegroups_client.go @@ -47,7 +47,7 @@ func NewResourceGroupsClient(subscriptionID string, credential azcore.TokenCrede // CheckExistence - Checks whether a resource group exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group to check. The name is case insensitive. // - options - ResourceGroupsClientCheckExistenceOptions contains the optional parameters for the ResourceGroupsClient.CheckExistence // method. @@ -82,7 +82,7 @@ func (client *ResourceGroupsClient) checkExistenceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -91,7 +91,7 @@ func (client *ResourceGroupsClient) checkExistenceCreateRequest(ctx context.Cont // CreateOrUpdate - Creates or updates a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses, // hyphen, period (except at end), and Unicode characters that match the allowed characters. // - parameters - Parameters supplied to the create or update a resource group. @@ -128,7 +128,7 @@ func (client *ResourceGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -147,7 +147,7 @@ func (client *ResourceGroupsClient) createOrUpdateHandleResponse(resp *http.Resp // all of its template deployments and currently stored operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group to delete. The name is case insensitive. // - options - ResourceGroupsClientBeginDeleteOptions contains the optional parameters for the ResourceGroupsClient.BeginDelete // method. @@ -167,7 +167,7 @@ func (client *ResourceGroupsClient) BeginDelete(ctx context.Context, resourceGro // of its template deployments and currently stored operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *ResourceGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, options) if err != nil { @@ -202,7 +202,7 @@ func (client *ResourceGroupsClient) deleteCreateRequest(ctx context.Context, res if options != nil && options.ForceDeletionTypes != nil { reqQP.Set("forceDeletionTypes", *options.ForceDeletionTypes) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *ResourceGroupsClient) deleteCreateRequest(ctx context.Context, res // BeginExportTemplate - Captures the specified resource group as a template. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - parameters - Parameters for exporting the template. // - options - ResourceGroupsClientBeginExportTemplateOptions contains the optional parameters for the ResourceGroupsClient.BeginExportTemplate @@ -233,7 +233,7 @@ func (client *ResourceGroupsClient) BeginExportTemplate(ctx context.Context, res // ExportTemplate - Captures the specified resource group as a template. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 func (client *ResourceGroupsClient) exportTemplate(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest, options *ResourceGroupsClientBeginExportTemplateOptions) (*http.Response, error) { req, err := client.exportTemplateCreateRequest(ctx, resourceGroupName, parameters, options) if err != nil { @@ -265,7 +265,7 @@ func (client *ResourceGroupsClient) exportTemplateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -274,7 +274,7 @@ func (client *ResourceGroupsClient) exportTemplateCreateRequest(ctx context.Cont // Get - Gets a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group to get. The name is case insensitive. // - options - ResourceGroupsClientGetOptions contains the optional parameters for the ResourceGroupsClient.Get method. func (client *ResourceGroupsClient) Get(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientGetOptions) (ResourceGroupsClientGetResponse, error) { @@ -308,7 +308,7 @@ func (client *ResourceGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *ResourceGroupsClient) getHandleResponse(resp *http.Response) (Reso // NewListPager - Gets all the resource groups for a subscription. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - options - ResourceGroupsClientListOptions contains the optional parameters for the ResourceGroupsClient.NewListPager method. func (client *ResourceGroupsClient) NewListPager(options *ResourceGroupsClientListOptions) *runtime.Pager[ResourceGroupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ResourceGroupsClientListResponse]{ @@ -373,7 +373,7 @@ func (client *ResourceGroupsClient) listCreateRequest(ctx context.Context, optio if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +393,7 @@ func (client *ResourceGroupsClient) listHandleResponse(resp *http.Response) (Res // value is retained. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - resourceGroupName - The name of the resource group to update. The name is case insensitive. // - parameters - Parameters supplied to update a resource group. // - options - ResourceGroupsClientUpdateOptions contains the optional parameters for the ResourceGroupsClient.Update method. @@ -428,7 +428,7 @@ func (client *ResourceGroupsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/resources/armresources/resourcegroups_client_example_test.go b/sdk/resourcemanager/resources/armresources/resourcegroups_client_example_test.go deleted file mode 100644 index e745e503371d..000000000000 --- a/sdk/resourcemanager/resources/armresources/resourcegroups_client_example_test.go +++ /dev/null @@ -1,220 +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 armresources_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/resources/armresources" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/CreateResourceGroup.json -func ExampleResourceGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceGroupsClient().CreateOrUpdate(ctx, "my-resource-group", armresources.ResourceGroup{ - Location: to.Ptr("eastus"), - }, 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.ResourceGroup = armresources.ResourceGroup{ - // Name: to.Ptr("my-resource-group"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group"), - // Location: to.Ptr("eastus"), - // Properties: &armresources.ResourceGroupProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json -func ExampleResourceGroupsClient_BeginDelete_forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourceGroupsClient().BeginDelete(ctx, "my-resource-group", &armresources.ResourceGroupsClientBeginDeleteOptions{ForceDeletionTypes: to.Ptr("Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets")}) - 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/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsInResourceGroup.json -func ExampleResourceGroupsClient_BeginDelete_forceDeleteAllTheVirtualMachinesInAResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourceGroupsClient().BeginDelete(ctx, "my-resource-group", &armresources.ResourceGroupsClientBeginDeleteOptions{ForceDeletionTypes: to.Ptr("Microsoft.Compute/virtualMachines")}) - 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/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json -func ExampleResourceGroupsClient_BeginExportTemplate_exportAResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourceGroupsClient().BeginExportTemplate(ctx, "my-resource-group", armresources.ExportTemplateRequest{ - Options: to.Ptr("IncludeParameterDefaultValue,IncludeComments"), - Resources: []*string{ - to.Ptr("*")}, - }, 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.ResourceGroupExportResult = armresources.ResourceGroupExportResult{ - // Error: &armresources.ErrorResponse{ - // Code: to.Ptr("ExportTemplateCompletedWithErrors"), - // Message: to.Ptr("Export template operation completed with errors. Some resources were not exported. Please see details for more information."), - // Details: []*armresources.ErrorResponse{ - // }, - // }, - // Template: map[string]any{ - // "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - // "contentVersion": "1.0.0.0", - // "parameters":map[string]any{ - // "myResourceType_myFirstResource_name":map[string]any{ - // "type": "String", - // "defaultValue": "myFirstResource", - // }, - // "myResourceType_myFirstResource_secret":map[string]any{ - // "type": "SecureString", - // "defaultValue": nil, - // }, - // "myResourceType_mySecondResource_name":map[string]any{ - // "type": "String", - // "defaultValue": "mySecondResource", - // }, - // }, - // "resources":[]any{ - // map[string]any{ - // "name": "[parameters('myResourceType_myFirstResource_name')]", - // "type": "My.RP/myResourceType", - // "apiVersion": "2019-01-01", - // "location": "West US", - // "properties":map[string]any{ - // "secret": "[parameters('myResourceType_myFirstResource_secret')]", - // }, - // }, - // map[string]any{ - // "name": "[parameters('myResourceType_mySecondResource_name')]", - // "type": "My.RP/myResourceType", - // "apiVersion": "2019-01-01", - // "location": "West US", - // "properties":map[string]any{ - // "customProperty": "hello!", - // }, - // }, - // }, - // "variables":map[string]any{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroupWithFiltering.json -func ExampleResourceGroupsClient_BeginExportTemplate_exportAResourceGroupWithFiltering() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourceGroupsClient().BeginExportTemplate(ctx, "my-resource-group", armresources.ExportTemplateRequest{ - Options: to.Ptr("SkipResourceNameParameterization"), - Resources: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource")}, - }, 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.ResourceGroupExportResult = armresources.ResourceGroupExportResult{ - // Template: map[string]any{ - // "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", - // "contentVersion": "1.0.0.0", - // "parameters":map[string]any{ - // "myResourceType_myFirstResource_secret":map[string]any{ - // "type": "SecureString", - // "defaultValue": nil, - // }, - // }, - // "resources":[]any{ - // map[string]any{ - // "name": "myFirstResource", - // "type": "My.RP/myResourceType", - // "apiVersion": "2019-01-01", - // "location": "West US", - // "properties":map[string]any{ - // "secret": "[parameters('myResourceType_myFirstResource_secret')]", - // }, - // }, - // }, - // "variables":map[string]any{ - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/resources/armresources/response_types.go b/sdk/resourcemanager/resources/armresources/response_types.go index f1a7793b52c0..150f59632d11 100644 --- a/sdk/resourcemanager/resources/armresources/response_types.go +++ b/sdk/resourcemanager/resources/armresources/response_types.go @@ -447,7 +447,7 @@ type ResourceGroupsClientUpdateResponse struct { ResourceGroup } -// TagsClientCreateOrUpdateAtScopeResponse contains the response from method TagsClient.CreateOrUpdateAtScope. +// TagsClientCreateOrUpdateAtScopeResponse contains the response from method TagsClient.BeginCreateOrUpdateAtScope. type TagsClientCreateOrUpdateAtScopeResponse struct { TagsResource } @@ -462,7 +462,7 @@ type TagsClientCreateOrUpdateValueResponse struct { TagValue } -// TagsClientDeleteAtScopeResponse contains the response from method TagsClient.DeleteAtScope. +// TagsClientDeleteAtScopeResponse contains the response from method TagsClient.BeginDeleteAtScope. type TagsClientDeleteAtScopeResponse struct { // placeholder for future response values } @@ -487,7 +487,7 @@ type TagsClientListResponse struct { TagsListResult } -// TagsClientUpdateAtScopeResponse contains the response from method TagsClient.UpdateAtScope. +// TagsClientUpdateAtScopeResponse contains the response from method TagsClient.BeginUpdateAtScope. type TagsClientUpdateAtScopeResponse struct { TagsResource } diff --git a/sdk/resourcemanager/resources/armresources/tags_client.go b/sdk/resourcemanager/resources/armresources/tags_client.go index b508c6a2ef80..ea4eadb680ce 100644 --- a/sdk/resourcemanager/resources/armresources/tags_client.go +++ b/sdk/resourcemanager/resources/armresources/tags_client.go @@ -49,7 +49,7 @@ func NewTagsClient(subscriptionID string, credential azcore.TokenCredential, opt // following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - tagName - The name of the tag to create. // - options - TagsClientCreateOrUpdateOptions contains the optional parameters for the TagsClient.CreateOrUpdate method. func (client *TagsClient) CreateOrUpdate(ctx context.Context, tagName string, options *TagsClientCreateOrUpdateOptions) (TagsClientCreateOrUpdateResponse, error) { @@ -83,7 +83,7 @@ func (client *TagsClient) createOrUpdateCreateRequest(ctx context.Context, tagNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -98,31 +98,48 @@ func (client *TagsClient) createOrUpdateHandleResponse(resp *http.Response) (Tag return result, nil } -// CreateOrUpdateAtScope - This operation allows adding or replacing the entire set of tags on the specified resource or subscription. -// The specified entity can have a maximum of 50 tags. +// BeginCreateOrUpdateAtScope - This operation allows adding or replacing the entire set of tags on the specified resource +// or subscription. The specified entity can have a maximum of 50 tags. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. -// - options - TagsClientCreateOrUpdateAtScopeOptions contains the optional parameters for the TagsClient.CreateOrUpdateAtScope +// - options - TagsClientBeginCreateOrUpdateAtScopeOptions contains the optional parameters for the TagsClient.BeginCreateOrUpdateAtScope // method. -func (client *TagsClient) CreateOrUpdateAtScope(ctx context.Context, scope string, parameters TagsResource, options *TagsClientCreateOrUpdateAtScopeOptions) (TagsClientCreateOrUpdateAtScopeResponse, error) { +func (client *TagsClient) BeginCreateOrUpdateAtScope(ctx context.Context, scope string, parameters TagsResource, options *TagsClientBeginCreateOrUpdateAtScopeOptions) (*runtime.Poller[TagsClientCreateOrUpdateAtScopeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdateAtScope(ctx, scope, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[TagsClientCreateOrUpdateAtScopeResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[TagsClientCreateOrUpdateAtScopeResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdateAtScope - This operation allows adding or replacing the entire set of tags on the specified resource or subscription. +// The specified entity can have a maximum of 50 tags. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *TagsClient) createOrUpdateAtScope(ctx context.Context, scope string, parameters TagsResource, options *TagsClientBeginCreateOrUpdateAtScopeOptions) (*http.Response, error) { req, err := client.createOrUpdateAtScopeCreateRequest(ctx, scope, parameters, options) if err != nil { - return TagsClientCreateOrUpdateAtScopeResponse{}, err + return nil, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return TagsClientCreateOrUpdateAtScopeResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagsClientCreateOrUpdateAtScopeResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return client.createOrUpdateAtScopeHandleResponse(resp) + return resp, nil } // createOrUpdateAtScopeCreateRequest creates the CreateOrUpdateAtScope request. -func (client *TagsClient) createOrUpdateAtScopeCreateRequest(ctx context.Context, scope string, parameters TagsResource, options *TagsClientCreateOrUpdateAtScopeOptions) (*policy.Request, error) { +func (client *TagsClient) createOrUpdateAtScopeCreateRequest(ctx context.Context, scope string, parameters TagsResource, options *TagsClientBeginCreateOrUpdateAtScopeOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Resources/tags/default" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -130,26 +147,17 @@ func (client *TagsClient) createOrUpdateAtScopeCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// createOrUpdateAtScopeHandleResponse handles the CreateOrUpdateAtScope response. -func (client *TagsClient) createOrUpdateAtScopeHandleResponse(resp *http.Response) (TagsClientCreateOrUpdateAtScopeResponse, error) { - result := TagsClientCreateOrUpdateAtScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TagsResource); err != nil { - return TagsClientCreateOrUpdateAtScopeResponse{}, err - } - return result, nil -} - // CreateOrUpdateValue - This operation allows adding a value to the list of predefined values for an existing predefined // tag name. A tag value can have a maximum of 256 characters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - tagName - The name of the tag. // - tagValue - The value of the tag to create. // - options - TagsClientCreateOrUpdateValueOptions contains the optional parameters for the TagsClient.CreateOrUpdateValue @@ -189,7 +197,7 @@ func (client *TagsClient) createOrUpdateValueCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +217,7 @@ func (client *TagsClient) createOrUpdateValueHandleResponse(resp *http.Response) // for the given name must have already been deleted. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - tagName - The name of the tag. // - options - TagsClientDeleteOptions contains the optional parameters for the TagsClient.Delete method. func (client *TagsClient) Delete(ctx context.Context, tagName string, options *TagsClientDeleteOptions) (TagsClientDeleteResponse, error) { @@ -243,35 +251,51 @@ func (client *TagsClient) deleteCreateRequest(ctx context.Context, tagName strin return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// DeleteAtScope - Deletes the entire set of tags on a resource or subscription. +// BeginDeleteAtScope - Deletes the entire set of tags on a resource or subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. -// - options - TagsClientDeleteAtScopeOptions contains the optional parameters for the TagsClient.DeleteAtScope method. -func (client *TagsClient) DeleteAtScope(ctx context.Context, scope string, options *TagsClientDeleteAtScopeOptions) (TagsClientDeleteAtScopeResponse, error) { +// - options - TagsClientBeginDeleteAtScopeOptions contains the optional parameters for the TagsClient.BeginDeleteAtScope method. +func (client *TagsClient) BeginDeleteAtScope(ctx context.Context, scope string, options *TagsClientBeginDeleteAtScopeOptions) (*runtime.Poller[TagsClientDeleteAtScopeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteAtScope(ctx, scope, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[TagsClientDeleteAtScopeResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[TagsClientDeleteAtScopeResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DeleteAtScope - Deletes the entire set of tags on a resource or subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *TagsClient) deleteAtScope(ctx context.Context, scope string, options *TagsClientBeginDeleteAtScopeOptions) (*http.Response, error) { req, err := client.deleteAtScopeCreateRequest(ctx, scope, options) if err != nil { - return TagsClientDeleteAtScopeResponse{}, err + return nil, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return TagsClientDeleteAtScopeResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagsClientDeleteAtScopeResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return TagsClientDeleteAtScopeResponse{}, nil + return resp, nil } // deleteAtScopeCreateRequest creates the DeleteAtScope request. -func (client *TagsClient) deleteAtScopeCreateRequest(ctx context.Context, scope string, options *TagsClientDeleteAtScopeOptions) (*policy.Request, error) { +func (client *TagsClient) deleteAtScopeCreateRequest(ctx context.Context, scope string, options *TagsClientBeginDeleteAtScopeOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Resources/tags/default" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -279,7 +303,7 @@ func (client *TagsClient) deleteAtScopeCreateRequest(ctx context.Context, scope return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -290,7 +314,7 @@ func (client *TagsClient) deleteAtScopeCreateRequest(ctx context.Context, scope // resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - tagName - The name of the tag. // - tagValue - The value of the tag to delete. // - options - TagsClientDeleteValueOptions contains the optional parameters for the TagsClient.DeleteValue method. @@ -329,7 +353,7 @@ func (client *TagsClient) deleteValueCreateRequest(ctx context.Context, tagName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,7 +362,7 @@ func (client *TagsClient) deleteValueCreateRequest(ctx context.Context, tagName // GetAtScope - Gets the entire set of tags on a resource or subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - scope - The resource scope. // - options - TagsClientGetAtScopeOptions contains the optional parameters for the TagsClient.GetAtScope method. func (client *TagsClient) GetAtScope(ctx context.Context, scope string, options *TagsClientGetAtScopeOptions) (TagsClientGetAtScopeResponse, error) { @@ -365,7 +389,7 @@ func (client *TagsClient) getAtScopeCreateRequest(ctx context.Context, scope str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,7 +408,7 @@ func (client *TagsClient) getAtScopeHandleResponse(resp *http.Response) (TagsCli // tags, and returns a summary of usage for each tag name and value under the given subscription. // In case of a large number of tags, this operation may return a previously cached result. // -// Generated from API version 2021-04-01 +// Generated from API version 2022-09-01 // - options - TagsClientListOptions contains the optional parameters for the TagsClient.NewListPager method. func (client *TagsClient) NewListPager(options *TagsClientListOptions) *runtime.Pager[TagsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TagsClientListResponse]{ @@ -426,7 +450,7 @@ func (client *TagsClient) listCreateRequest(ctx context.Context, options *TagsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -441,6 +465,28 @@ func (client *TagsClient) listHandleResponse(resp *http.Response) (TagsClientLis return result, nil } +// BeginUpdateAtScope - This operation allows replacing, merging or selectively deleting tags on the specified resource or +// subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The +// 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new +// names and updating the values of tags with existing names. The 'delete' option +// allows selectively deleting tags based on given names or name/value pairs. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - scope - The resource scope. +// - options - TagsClientBeginUpdateAtScopeOptions contains the optional parameters for the TagsClient.BeginUpdateAtScope method. +func (client *TagsClient) BeginUpdateAtScope(ctx context.Context, scope string, parameters TagsPatchResource, options *TagsClientBeginUpdateAtScopeOptions) (*runtime.Poller[TagsClientUpdateAtScopeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateAtScope(ctx, scope, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[TagsClientUpdateAtScopeResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[TagsClientUpdateAtScopeResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + // UpdateAtScope - This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. // The specified entity can have a maximum of 50 tags at the end of the operation. The // 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new @@ -448,26 +494,24 @@ func (client *TagsClient) listHandleResponse(resp *http.Response) (TagsClientLis // allows selectively deleting tags based on given names or name/value pairs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-04-01 -// - scope - The resource scope. -// - options - TagsClientUpdateAtScopeOptions contains the optional parameters for the TagsClient.UpdateAtScope method. -func (client *TagsClient) UpdateAtScope(ctx context.Context, scope string, parameters TagsPatchResource, options *TagsClientUpdateAtScopeOptions) (TagsClientUpdateAtScopeResponse, error) { +// Generated from API version 2022-09-01 +func (client *TagsClient) updateAtScope(ctx context.Context, scope string, parameters TagsPatchResource, options *TagsClientBeginUpdateAtScopeOptions) (*http.Response, error) { req, err := client.updateAtScopeCreateRequest(ctx, scope, parameters, options) if err != nil { - return TagsClientUpdateAtScopeResponse{}, err + return nil, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return TagsClientUpdateAtScopeResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagsClientUpdateAtScopeResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return client.updateAtScopeHandleResponse(resp) + return resp, nil } // updateAtScopeCreateRequest creates the UpdateAtScope request. -func (client *TagsClient) updateAtScopeCreateRequest(ctx context.Context, scope string, parameters TagsPatchResource, options *TagsClientUpdateAtScopeOptions) (*policy.Request, error) { +func (client *TagsClient) updateAtScopeCreateRequest(ctx context.Context, scope string, parameters TagsPatchResource, options *TagsClientBeginUpdateAtScopeOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Resources/tags/default" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -475,17 +519,8 @@ func (client *TagsClient) updateAtScopeCreateRequest(ctx context.Context, scope return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } - -// updateAtScopeHandleResponse handles the UpdateAtScope response. -func (client *TagsClient) updateAtScopeHandleResponse(resp *http.Response) (TagsClientUpdateAtScopeResponse, error) { - result := TagsClientUpdateAtScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TagsResource); err != nil { - return TagsClientUpdateAtScopeResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/resources/armresources/tags_client_example_test.go b/sdk/resourcemanager/resources/armresources/tags_client_example_test.go deleted file mode 100644 index a48a04768c1e..000000000000 --- a/sdk/resourcemanager/resources/armresources/tags_client_example_test.go +++ /dev/null @@ -1,145 +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 armresources_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/resources/armresources" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json -func ExampleTagsClient_CreateOrUpdateAtScope_updateTagsOnAResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagsClient().CreateOrUpdateAtScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", armresources.TagsResource{ - Properties: &armresources.Tags{ - Tags: map[string]*string{ - "tagKey1": to.Ptr("tag-value-1"), - "tagKey2": to.Ptr("tag-value-2"), - }, - }, - }, 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.TagsResource = armresources.TagsResource{ - // Properties: &armresources.Tags{ - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("tag-value-1"), - // "tagKey2": to.Ptr("tag-value-2"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsSubscription.json -func ExampleTagsClient_CreateOrUpdateAtScope_updateTagsOnASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagsClient().CreateOrUpdateAtScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", armresources.TagsResource{ - Properties: &armresources.Tags{ - Tags: map[string]*string{ - "tagKey1": to.Ptr("tag-value-1"), - "tagKey2": to.Ptr("tag-value-2"), - }, - }, - }, 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.TagsResource = armresources.TagsResource{ - // Properties: &armresources.Tags{ - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("tag-value-1"), - // "tagKey2": to.Ptr("tag-value-2"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json -func ExampleTagsClient_GetAtScope_getTagsOnAResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagsClient().GetAtScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", 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.TagsResource = armresources.TagsResource{ - // Properties: &armresources.Tags{ - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("tag-value-1"), - // "tagKey2": to.Ptr("tag-value-2"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsSubscription.json -func ExampleTagsClient_GetAtScope_getTagsOnASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armresources.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagsClient().GetAtScope(ctx, "subscriptions/00000000-0000-0000-0000-000000000000", 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.TagsResource = armresources.TagsResource{ - // Properties: &armresources.Tags{ - // Tags: map[string]*string{ - // "tagKey1": to.Ptr("tag-value-1"), - // "tagKey2": to.Ptr("tag-value-2"), - // }, - // }, - // } -}