diff --git a/sdk/resourcemanager/resources/armresources/CHANGELOG.md b/sdk/resourcemanager/resources/armresources/CHANGELOG.md index 1068015e51a0..199642210858 100644 --- a/sdk/resourcemanager/resources/armresources/CHANGELOG.md +++ b/sdk/resourcemanager/resources/armresources/CHANGELOG.md @@ -1,16 +1,20 @@ # Release History -## 1.2.0-beta.2 (2023-07-19) +## 2.0.0 (2023-08-23) +### Breaking Changes -### Bug Fixes - -- Fixed a potential panic in faked paged and long-running operations. - -## 1.2.0-beta.1 (2023-06-12) +- Type of `DeploymentProperties.Parameters` has been changed from `any` to `map[string]*DeploymentParameter` +- Type of `DeploymentWhatIfProperties.Parameters` has been changed from `any` to `map[string]*DeploymentParameter` +- 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 -- Support for test fakes and OpenTelemetry trace spans. +- 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 fb7136eede81..7fa48e5a090b 100644 --- a/sdk/resourcemanager/resources/armresources/autorest.md +++ b/sdk/resourcemanager/resources/armresources/autorest.md @@ -5,11 +5,11 @@ ``` 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: github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources -module-version: 1.2.0-beta.2 +module-version: 2.0.0 package-resources: true azcore-version: 1.8.0-beta.1 generate-fakes: true diff --git a/sdk/resourcemanager/resources/armresources/client.go b/sdk/resourcemanager/resources/armresources/client.go index 8b984cbd51f8..4ad6137c5643 100644 --- a/sdk/resourcemanager/resources/armresources/client.go +++ b/sdk/resourcemanager/resources/armresources/client.go @@ -46,7 +46,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 2023-07-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. @@ -107,9 +107,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 2023-07-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. @@ -153,7 +155,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 2023-07-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. @@ -178,7 +180,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 2023-07-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) { var err error const operationName = "Client.BeginCreateOrUpdate" @@ -238,7 +240,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 2023-07-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. @@ -261,7 +263,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 2023-07-01 func (client *Client) createOrUpdateByID(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginCreateOrUpdateByIDOptions) (*http.Response, error) { var err error const operationName = "Client.BeginCreateOrUpdateByID" @@ -304,7 +306,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 2023-07-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. @@ -328,7 +330,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 2023-07-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) { var err error const operationName = "Client.BeginDelete" @@ -385,7 +387,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 2023-07-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. @@ -406,7 +408,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 2023-07-01 func (client *Client) deleteByID(ctx context.Context, resourceID string, apiVersion string, options *ClientBeginDeleteByIDOptions) (*http.Response, error) { var err error const operationName = "Client.BeginDeleteByID" @@ -446,7 +448,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 2023-07-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. @@ -520,7 +522,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 2023-07-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. @@ -573,7 +575,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 2023-07-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]{ @@ -626,7 +628,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -643,7 +645,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 2023-07-01 // - resourceGroupName - The resource group with the resources to get. // - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager // method. @@ -702,7 +704,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -723,7 +725,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 2023-07-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. @@ -746,7 +748,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 2023-07-01 func (client *Client) moveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginMoveResourcesOptions) (*http.Response, error) { var err error const operationName = "Client.BeginMoveResources" @@ -784,7 +786,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -796,7 +798,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 2023-07-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. @@ -821,7 +823,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 2023-07-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) { var err error const operationName = "Client.BeginUpdate" @@ -881,7 +883,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 2023-07-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. @@ -903,7 +905,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 2023-07-01 func (client *Client) updateByID(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginUpdateByIDOptions) (*http.Response, error) { var err error const operationName = "Client.BeginUpdateByID" @@ -950,7 +952,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 2023-07-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. @@ -976,7 +978,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 2023-07-01 func (client *Client) validateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginValidateMoveResourcesOptions) (*http.Response, error) { var err error const operationName = "Client.BeginValidateMoveResources" @@ -1014,7 +1016,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/resources/armresources/constants.go b/sdk/resourcemanager/resources/armresources/constants.go index 53daed607c82..c1671e7b362a 100644 --- a/sdk/resourcemanager/resources/armresources/constants.go +++ b/sdk/resourcemanager/resources/armresources/constants.go @@ -10,7 +10,7 @@ package armresources const ( moduleName = "armresources" - moduleVersion = "v1.2.0-beta.2" + 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 76fe51416b30..3a52c31928bb 100644 --- a/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go +++ b/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go @@ -47,7 +47,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 2023-07-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. @@ -99,7 +99,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - operationID - The ID of the operation to get. @@ -165,7 +165,7 @@ func (client *DeploymentOperationsClient) getAtManagementGroupScopeCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +183,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 2023-07-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - operationID - The ID of the operation to get. @@ -228,7 +228,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +246,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 2023-07-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 @@ -293,7 +293,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -311,7 +311,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 2023-07-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 @@ -354,7 +354,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +371,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 2023-07-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 @@ -429,7 +429,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,7 +446,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentOperationsClientListAtManagementGroupScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtManagementGroupScopePager @@ -500,7 +500,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -517,7 +517,7 @@ func (client *DeploymentOperationsClient) listAtManagementGroupScopeHandleRespon // NewListAtScopePager - Gets all deployments operations for a deployment. // -// Generated from API version 2021-04-01 +// Generated from API version 2023-07-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentOperationsClientListAtScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtScopePager @@ -568,7 +568,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -585,7 +585,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 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentOperationsClientListAtSubscriptionScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtSubscriptionScopePager // method. @@ -638,7 +638,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -655,7 +655,7 @@ func (client *DeploymentOperationsClient) listAtSubscriptionScopeHandleResponse( // NewListAtTenantScopePager - Gets all deployments operations for a deployment. // -// Generated from API version 2021-04-01 +// Generated from API version 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentOperationsClientListAtTenantScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtTenantScopePager // method. @@ -704,7 +704,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", "2023-07-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 7350d1edefb2..f707550d8b11 100644 --- a/sdk/resourcemanager/resources/armresources/deployments_client.go +++ b/sdk/resourcemanager/resources/armresources/deployments_client.go @@ -47,7 +47,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 2023-07-01 // - templateParam - The template provided to calculate hash. // - options - DeploymentsClientCalculateTemplateHashOptions contains the optional parameters for the DeploymentsClient.CalculateTemplateHash // method. @@ -81,7 +81,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, templateParam); err != nil { @@ -104,7 +104,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 2023-07-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. @@ -149,7 +149,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -160,7 +160,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCancelAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtManagementGroupScope @@ -202,7 +202,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,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 2023-07-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCancelAtScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtScope @@ -252,7 +252,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,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 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientCancelAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtSubscriptionScope // method. @@ -304,7 +304,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -315,7 +315,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 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientCancelAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtTenantScope // method. @@ -352,7 +352,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,7 +360,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 2023-07-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 @@ -406,7 +406,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -414,7 +414,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCheckExistenceAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtManagementGroupScope @@ -456,7 +456,7 @@ func (client *DeploymentsClient) checkExistenceAtManagementGroupScopeCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,7 +464,7 @@ func (client *DeploymentsClient) checkExistenceAtManagementGroupScopeCreateReque // CheckExistenceAtScope - Checks whether the deployment exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2023-07-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientCheckExistenceAtScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtScope @@ -503,7 +503,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -511,7 +511,7 @@ func (client *DeploymentsClient) checkExistenceAtScopeCreateRequest(ctx context. // CheckExistenceAtSubscriptionScope - Checks whether the deployment exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientCheckExistenceAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtSubscriptionScope // method. @@ -552,7 +552,7 @@ func (client *DeploymentsClient) checkExistenceAtSubscriptionScopeCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -560,7 +560,7 @@ func (client *DeploymentsClient) checkExistenceAtSubscriptionScopeCreateRequest( // CheckExistenceAtTenantScope - Checks whether the deployment exists. // -// Generated from API version 2021-04-01 +// Generated from API version 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientCheckExistenceAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtTenantScope // method. @@ -597,7 +597,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -606,7 +606,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 2023-07-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. @@ -629,7 +629,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 2023-07-01 func (client *DeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginCreateOrUpdate" @@ -671,7 +671,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -684,7 +684,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - parameters - Additional parameters supplied to the operation. @@ -707,7 +707,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 2023-07-01 func (client *DeploymentsClient) createOrUpdateAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtManagementGroupScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginCreateOrUpdateAtManagementGroupScope" @@ -745,7 +745,7 @@ func (client *DeploymentsClient) createOrUpdateAtManagementGroupScopeCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -757,7 +757,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 2023-07-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - parameters - Additional parameters supplied to the operation. @@ -779,7 +779,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 2023-07-01 func (client *DeploymentsClient) createOrUpdateAtScope(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginCreateOrUpdateAtScope" @@ -814,7 +814,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -827,7 +827,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 2023-07-01 // - deploymentName - The name of the deployment. // - parameters - Additional parameters supplied to the operation. // - options - DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtSubscriptionScope @@ -849,7 +849,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 2023-07-01 func (client *DeploymentsClient) createOrUpdateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginCreateOrUpdateAtSubscriptionScope" @@ -887,7 +887,7 @@ func (client *DeploymentsClient) createOrUpdateAtSubscriptionScopeCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -900,7 +900,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 2023-07-01 // - deploymentName - The name of the deployment. // - parameters - Additional parameters supplied to the operation. // - options - DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtTenantScope @@ -921,7 +921,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 2023-07-01 func (client *DeploymentsClient) createOrUpdateAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginCreateOrUpdateAtTenantScope" @@ -955,7 +955,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -974,7 +974,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 2023-07-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. @@ -1001,7 +1001,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 2023-07-01 func (client *DeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginDelete" @@ -1043,7 +1043,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1058,7 +1058,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientBeginDeleteAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtManagementGroupScope @@ -1085,7 +1085,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 2023-07-01 func (client *DeploymentsClient) deleteAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientBeginDeleteAtManagementGroupScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginDeleteAtManagementGroupScope" @@ -1123,7 +1123,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1138,7 +1138,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 2023-07-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientBeginDeleteAtScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtScope @@ -1165,7 +1165,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 2023-07-01 func (client *DeploymentsClient) deleteAtScope(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientBeginDeleteAtScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginDeleteAtScope" @@ -1200,7 +1200,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1215,7 +1215,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 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientBeginDeleteAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtSubscriptionScope // method. @@ -1241,7 +1241,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 2023-07-01 func (client *DeploymentsClient) deleteAtSubscriptionScope(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtSubscriptionScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginDeleteAtSubscriptionScope" @@ -1279,7 +1279,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1294,7 +1294,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 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientBeginDeleteAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtTenantScope // method. @@ -1320,7 +1320,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 2023-07-01 func (client *DeploymentsClient) deleteAtTenantScope(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtTenantScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginDeleteAtTenantScope" @@ -1354,7 +1354,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1363,7 +1363,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 2023-07-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 @@ -1410,7 +1410,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1428,7 +1428,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientExportTemplateAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtManagementGroupScope @@ -1471,7 +1471,7 @@ func (client *DeploymentsClient) exportTemplateAtManagementGroupScopeCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1489,7 +1489,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 2023-07-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientExportTemplateAtScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtScope @@ -1529,7 +1529,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1547,7 +1547,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 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientExportTemplateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtSubscriptionScope // method. @@ -1589,7 +1589,7 @@ func (client *DeploymentsClient) exportTemplateAtSubscriptionScopeCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-04-01") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1607,7 +1607,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 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientExportTemplateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtTenantScope // method. @@ -1645,7 +1645,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1663,7 +1663,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 2023-07-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. @@ -1709,7 +1709,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1727,7 +1727,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - options - DeploymentsClientGetAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.GetAtManagementGroupScope @@ -1770,7 +1770,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1788,7 +1788,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 2023-07-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - options - DeploymentsClientGetAtScopeOptions contains the optional parameters for the DeploymentsClient.GetAtScope method. @@ -1827,7 +1827,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1845,7 +1845,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 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientGetAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.GetAtSubscriptionScope // method. @@ -1887,7 +1887,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1905,7 +1905,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 2023-07-01 // - deploymentName - The name of the deployment. // - options - DeploymentsClientGetAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.GetAtTenantScope // method. @@ -1943,7 +1943,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1960,7 +1960,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 2023-07-01 // - groupID - The management group ID. // - options - DeploymentsClientListAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtManagementGroupScopePager // method. @@ -2012,7 +2012,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2029,7 +2029,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 2023-07-01 // - scope - The resource scope. // - options - DeploymentsClientListAtScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtScopePager // method. @@ -2078,7 +2078,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2095,7 +2095,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 2023-07-01 // - options - DeploymentsClientListAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtSubscriptionScopePager // method. func (client *DeploymentsClient) NewListAtSubscriptionScopePager(options *DeploymentsClientListAtSubscriptionScopeOptions) *runtime.Pager[DeploymentsClientListAtSubscriptionScopeResponse] { @@ -2146,7 +2146,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2163,7 +2163,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 2023-07-01 // - options - DeploymentsClientListAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtTenantScopePager // method. func (client *DeploymentsClient) NewListAtTenantScopePager(options *DeploymentsClientListAtTenantScopeOptions) *runtime.Pager[DeploymentsClientListAtTenantScopeResponse] { @@ -2210,7 +2210,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2227,7 +2227,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 2023-07-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. @@ -2283,7 +2283,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2302,7 +2302,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 2023-07-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. @@ -2324,7 +2324,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 2023-07-01 func (client *DeploymentsClient) validate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginValidate" @@ -2366,7 +2366,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2379,7 +2379,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. @@ -2402,7 +2402,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 2023-07-01 func (client *DeploymentsClient) validateAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtManagementGroupScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginValidateAtManagementGroupScope" @@ -2440,7 +2440,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2453,7 +2453,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 2023-07-01 // - scope - The resource scope. // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. @@ -2476,7 +2476,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 2023-07-01 func (client *DeploymentsClient) validateAtScope(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginValidateAtScope" @@ -2511,7 +2511,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2524,7 +2524,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 2023-07-01 // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. // - options - DeploymentsClientBeginValidateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtSubscriptionScope @@ -2546,7 +2546,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 2023-07-01 func (client *DeploymentsClient) validateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtSubscriptionScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginValidateAtSubscriptionScope" @@ -2584,7 +2584,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2597,7 +2597,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 2023-07-01 // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. // - options - DeploymentsClientBeginValidateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtTenantScope @@ -2619,7 +2619,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 2023-07-01 func (client *DeploymentsClient) validateAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtTenantScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginValidateAtTenantScope" @@ -2653,7 +2653,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2665,7 +2665,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 2023-07-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. @@ -2688,7 +2688,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 2023-07-01 func (client *DeploymentsClient) whatIf(ctx context.Context, resourceGroupName string, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginWhatIf" @@ -2730,7 +2730,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2743,7 +2743,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 2023-07-01 // - groupID - The management group ID. // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. @@ -2768,7 +2768,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 2023-07-01 func (client *DeploymentsClient) whatIfAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtManagementGroupScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginWhatIfAtManagementGroupScope" @@ -2806,7 +2806,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2818,7 +2818,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 2023-07-01 // - deploymentName - The name of the deployment. // - parameters - Parameters to What If. // - options - DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtSubscriptionScope @@ -2841,7 +2841,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 2023-07-01 func (client *DeploymentsClient) whatIfAtSubscriptionScope(ctx context.Context, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginWhatIfAtSubscriptionScope" @@ -2879,7 +2879,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -2891,7 +2891,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 2023-07-01 // - deploymentName - The name of the deployment. // - parameters - Parameters to validate. // - options - DeploymentsClientBeginWhatIfAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtTenantScope @@ -2914,7 +2914,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 2023-07-01 func (client *DeploymentsClient) whatIfAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtTenantScopeOptions) (*http.Response, error) { var err error const operationName = "DeploymentsClient.BeginWhatIfAtTenantScope" @@ -2948,7 +2948,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { 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/fake/deploymentoperations_server.go b/sdk/resourcemanager/resources/armresources/fake/deploymentoperations_server.go index dda04d97e2b4..6656d881a71f 100644 --- a/sdk/resourcemanager/resources/armresources/fake/deploymentoperations_server.go +++ b/sdk/resourcemanager/resources/armresources/fake/deploymentoperations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/resources/armresources/fake/deployments_server.go b/sdk/resourcemanager/resources/armresources/fake/deployments_server.go index d8d119a96d80..778ee60cd36f 100644 --- a/sdk/resourcemanager/resources/armresources/fake/deployments_server.go +++ b/sdk/resourcemanager/resources/armresources/fake/deployments_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/resources/armresources/fake/operations_server.go b/sdk/resourcemanager/resources/armresources/fake/operations_server.go index 9efc0cbd4a7e..5dc57b498004 100644 --- a/sdk/resourcemanager/resources/armresources/fake/operations_server.go +++ b/sdk/resourcemanager/resources/armresources/fake/operations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v2" "net/http" ) diff --git a/sdk/resourcemanager/resources/armresources/fake/providerresourcetypes_server.go b/sdk/resourcemanager/resources/armresources/fake/providerresourcetypes_server.go index 907b98cea2cf..fe2232e0e897 100644 --- a/sdk/resourcemanager/resources/armresources/fake/providerresourcetypes_server.go +++ b/sdk/resourcemanager/resources/armresources/fake/providerresourcetypes_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/resources/armresources/fake/providers_server.go b/sdk/resourcemanager/resources/armresources/fake/providers_server.go index 6ed17df0562a..d949e8dd2d20 100644 --- a/sdk/resourcemanager/resources/armresources/fake/providers_server.go +++ b/sdk/resourcemanager/resources/armresources/fake/providers_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v2" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/resources/armresources/fake/resourcegroups_server.go b/sdk/resourcemanager/resources/armresources/fake/resourcegroups_server.go index e16c5e5a7565..93d53c5464e2 100644 --- a/sdk/resourcemanager/resources/armresources/fake/resourcegroups_server.go +++ b/sdk/resourcemanager/resources/armresources/fake/resourcegroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/resources/armresources/fake/tags_server.go b/sdk/resourcemanager/resources/armresources/fake/tags_server.go index 94d66494208a..9cf14f6ca15a 100644 --- a/sdk/resourcemanager/resources/armresources/fake/tags_server.go +++ b/sdk/resourcemanager/resources/armresources/fake/tags_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/v2" "net/http" "net/url" "regexp" @@ -28,9 +28,9 @@ type TagsServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated CreateOrUpdate func(ctx context.Context, tagName string, options *armresources.TagsClientCreateOrUpdateOptions) (resp azfake.Responder[armresources.TagsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - // CreateOrUpdateAtScope is the fake for method TagsClient.CreateOrUpdateAtScope - // HTTP status codes to indicate success: http.StatusOK - CreateOrUpdateAtScope func(ctx context.Context, scope string, parameters armresources.TagsResource, options *armresources.TagsClientCreateOrUpdateAtScopeOptions) (resp azfake.Responder[armresources.TagsClientCreateOrUpdateAtScopeResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdateAtScope is the fake for method TagsClient.BeginCreateOrUpdateAtScope + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginCreateOrUpdateAtScope func(ctx context.Context, scope string, parameters armresources.TagsResource, options *armresources.TagsClientBeginCreateOrUpdateAtScopeOptions) (resp azfake.PollerResponder[armresources.TagsClientCreateOrUpdateAtScopeResponse], errResp azfake.ErrorResponder) // CreateOrUpdateValue is the fake for method TagsClient.CreateOrUpdateValue // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated @@ -40,9 +40,9 @@ type TagsServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent Delete func(ctx context.Context, tagName string, options *armresources.TagsClientDeleteOptions) (resp azfake.Responder[armresources.TagsClientDeleteResponse], errResp azfake.ErrorResponder) - // DeleteAtScope is the fake for method TagsClient.DeleteAtScope - // HTTP status codes to indicate success: http.StatusOK - DeleteAtScope func(ctx context.Context, scope string, options *armresources.TagsClientDeleteAtScopeOptions) (resp azfake.Responder[armresources.TagsClientDeleteAtScopeResponse], errResp azfake.ErrorResponder) + // BeginDeleteAtScope is the fake for method TagsClient.BeginDeleteAtScope + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginDeleteAtScope func(ctx context.Context, scope string, options *armresources.TagsClientBeginDeleteAtScopeOptions) (resp azfake.PollerResponder[armresources.TagsClientDeleteAtScopeResponse], errResp azfake.ErrorResponder) // DeleteValue is the fake for method TagsClient.DeleteValue // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent @@ -56,9 +56,9 @@ type TagsServer struct { // HTTP status codes to indicate success: http.StatusOK NewListPager func(options *armresources.TagsClientListOptions) (resp azfake.PagerResponder[armresources.TagsClientListResponse]) - // UpdateAtScope is the fake for method TagsClient.UpdateAtScope - // HTTP status codes to indicate success: http.StatusOK - UpdateAtScope func(ctx context.Context, scope string, parameters armresources.TagsPatchResource, options *armresources.TagsClientUpdateAtScopeOptions) (resp azfake.Responder[armresources.TagsClientUpdateAtScopeResponse], errResp azfake.ErrorResponder) + // BeginUpdateAtScope is the fake for method TagsClient.BeginUpdateAtScope + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdateAtScope func(ctx context.Context, scope string, parameters armresources.TagsPatchResource, options *armresources.TagsClientBeginUpdateAtScopeOptions) (resp azfake.PollerResponder[armresources.TagsClientUpdateAtScopeResponse], errResp azfake.ErrorResponder) } // NewTagsServerTransport creates a new instance of TagsServerTransport with the provided implementation. @@ -66,16 +66,22 @@ type TagsServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewTagsServerTransport(srv *TagsServer) *TagsServerTransport { return &TagsServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armresources.TagsClientListResponse]](), + srv: srv, + beginCreateOrUpdateAtScope: newTracker[azfake.PollerResponder[armresources.TagsClientCreateOrUpdateAtScopeResponse]](), + beginDeleteAtScope: newTracker[azfake.PollerResponder[armresources.TagsClientDeleteAtScopeResponse]](), + newListPager: newTracker[azfake.PagerResponder[armresources.TagsClientListResponse]](), + beginUpdateAtScope: newTracker[azfake.PollerResponder[armresources.TagsClientUpdateAtScopeResponse]](), } } // TagsServerTransport connects instances of armresources.TagsClient to instances of TagsServer. // Don't use this type directly, use NewTagsServerTransport instead. type TagsServerTransport struct { - srv *TagsServer - newListPager *tracker[azfake.PagerResponder[armresources.TagsClientListResponse]] + srv *TagsServer + beginCreateOrUpdateAtScope *tracker[azfake.PollerResponder[armresources.TagsClientCreateOrUpdateAtScopeResponse]] + beginDeleteAtScope *tracker[azfake.PollerResponder[armresources.TagsClientDeleteAtScopeResponse]] + newListPager *tracker[azfake.PagerResponder[armresources.TagsClientListResponse]] + beginUpdateAtScope *tracker[azfake.PollerResponder[armresources.TagsClientUpdateAtScopeResponse]] } // Do implements the policy.Transporter interface for TagsServerTransport. @@ -92,22 +98,22 @@ func (t *TagsServerTransport) Do(req *http.Request) (*http.Response, error) { switch method { case "TagsClient.CreateOrUpdate": resp, err = t.dispatchCreateOrUpdate(req) - case "TagsClient.CreateOrUpdateAtScope": - resp, err = t.dispatchCreateOrUpdateAtScope(req) + case "TagsClient.BeginCreateOrUpdateAtScope": + resp, err = t.dispatchBeginCreateOrUpdateAtScope(req) case "TagsClient.CreateOrUpdateValue": resp, err = t.dispatchCreateOrUpdateValue(req) case "TagsClient.Delete": resp, err = t.dispatchDelete(req) - case "TagsClient.DeleteAtScope": - resp, err = t.dispatchDeleteAtScope(req) + case "TagsClient.BeginDeleteAtScope": + resp, err = t.dispatchBeginDeleteAtScope(req) case "TagsClient.DeleteValue": resp, err = t.dispatchDeleteValue(req) case "TagsClient.GetAtScope": resp, err = t.dispatchGetAtScope(req) case "TagsClient.NewListPager": resp, err = t.dispatchNewListPager(req) - case "TagsClient.UpdateAtScope": - resp, err = t.dispatchUpdateAtScope(req) + case "TagsClient.BeginUpdateAtScope": + resp, err = t.dispatchBeginUpdateAtScope(req) default: err = fmt.Errorf("unhandled API %s", method) } @@ -148,36 +154,47 @@ func (t *TagsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.R return resp, nil } -func (t *TagsServerTransport) dispatchCreateOrUpdateAtScope(req *http.Request) (*http.Response, error) { - if t.srv.CreateOrUpdateAtScope == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdateAtScope not implemented")} +func (t *TagsServerTransport) dispatchBeginCreateOrUpdateAtScope(req *http.Request) (*http.Response, error) { + if t.srv.BeginCreateOrUpdateAtScope == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdateAtScope not implemented")} } - const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Resources/tags/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armresources.TagsResource](req) - if err != nil { - return nil, err + beginCreateOrUpdateAtScope := t.beginCreateOrUpdateAtScope.get(req) + if beginCreateOrUpdateAtScope == nil { + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Resources/tags/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armresources.TagsResource](req) + if err != nil { + return nil, err + } + scopeUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.BeginCreateOrUpdateAtScope(req.Context(), scopeUnescaped, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdateAtScope = &respr + t.beginCreateOrUpdateAtScope.add(req, beginCreateOrUpdateAtScope) } - scopeUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + + resp, err := server.PollerResponderNext(beginCreateOrUpdateAtScope, req) if err != nil { return nil, err } - respr, errRespr := t.srv.CreateOrUpdateAtScope(req.Context(), scopeUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + t.beginCreateOrUpdateAtScope.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).TagsResource, req) - if err != nil { - return nil, err + if !server.PollerResponderMore(beginCreateOrUpdateAtScope) { + t.beginCreateOrUpdateAtScope.remove(req) } + return resp, nil } @@ -243,32 +260,43 @@ func (t *TagsServerTransport) dispatchDelete(req *http.Request) (*http.Response, return resp, nil } -func (t *TagsServerTransport) dispatchDeleteAtScope(req *http.Request) (*http.Response, error) { - if t.srv.DeleteAtScope == nil { - return nil, &nonRetriableError{errors.New("fake for method DeleteAtScope not implemented")} +func (t *TagsServerTransport) dispatchBeginDeleteAtScope(req *http.Request) (*http.Response, error) { + if t.srv.BeginDeleteAtScope == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDeleteAtScope not implemented")} } - const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Resources/tags/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + beginDeleteAtScope := t.beginDeleteAtScope.get(req) + if beginDeleteAtScope == nil { + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Resources/tags/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + scopeUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.BeginDeleteAtScope(req.Context(), scopeUnescaped, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDeleteAtScope = &respr + t.beginDeleteAtScope.add(req, beginDeleteAtScope) } - scopeUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + + resp, err := server.PollerResponderNext(beginDeleteAtScope, req) if err != nil { return nil, err } - respr, errRespr := t.srv.DeleteAtScope(req.Context(), scopeUnescaped, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + t.beginDeleteAtScope.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err + if !server.PollerResponderMore(beginDeleteAtScope) { + t.beginDeleteAtScope.remove(req) } + return resp, nil } @@ -367,35 +395,46 @@ func (t *TagsServerTransport) dispatchNewListPager(req *http.Request) (*http.Res return resp, nil } -func (t *TagsServerTransport) dispatchUpdateAtScope(req *http.Request) (*http.Response, error) { - if t.srv.UpdateAtScope == nil { - return nil, &nonRetriableError{errors.New("fake for method UpdateAtScope not implemented")} +func (t *TagsServerTransport) dispatchBeginUpdateAtScope(req *http.Request) (*http.Response, error) { + if t.srv.BeginUpdateAtScope == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdateAtScope not implemented")} } - const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Resources/tags/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armresources.TagsPatchResource](req) - if err != nil { - return nil, err + beginUpdateAtScope := t.beginUpdateAtScope.get(req) + if beginUpdateAtScope == nil { + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Resources/tags/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armresources.TagsPatchResource](req) + if err != nil { + return nil, err + } + scopeUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.BeginUpdateAtScope(req.Context(), scopeUnescaped, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdateAtScope = &respr + t.beginUpdateAtScope.add(req, beginUpdateAtScope) } - scopeUnescaped, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + + resp, err := server.PollerResponderNext(beginUpdateAtScope, req) if err != nil { return nil, err } - respr, errRespr := t.srv.UpdateAtScope(req.Context(), scopeUnescaped, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + t.beginUpdateAtScope.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).TagsResource, req) - if err != nil { - return nil, err + if !server.PollerResponderMore(beginUpdateAtScope) { + t.beginUpdateAtScope.remove(req) } + return resp, nil } diff --git a/sdk/resourcemanager/resources/armresources/go.mod b/sdk/resourcemanager/resources/armresources/go.mod index 75604d97fa90..88c2e719a512 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.8.0-beta.1 - 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.3.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 ce98f859a61d..5c563935f00c 100644 --- a/sdk/resourcemanager/resources/armresources/models.go +++ b/sdk/resourcemanager/resources/armresources/models.go @@ -221,6 +221,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, @@ -244,7 +253,7 @@ type DeploymentProperties struct { // the parameter values directly in the request rather than link to an existing // parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or // a well formed JSON string. - Parameters any + Parameters map[string]*DeploymentParameter // The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink // property or the parameters property, but not both. @@ -354,7 +363,7 @@ type DeploymentWhatIfProperties struct { // the parameter values directly in the request rather than link to an existing // parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or // a well formed JSON string. - Parameters any + Parameters map[string]*DeploymentParameter // The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink // property or the parameters property, but not both. @@ -563,6 +572,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. diff --git a/sdk/resourcemanager/resources/armresources/models_serde.go b/sdk/resourcemanager/resources/armresources/models_serde.go index fe07f1f2d807..cb9e3ac1e36e 100644 --- a/sdk/resourcemanager/resources/armresources/models_serde.go +++ b/sdk/resourcemanager/resources/armresources/models_serde.go @@ -595,6 +595,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) @@ -602,7 +633,7 @@ func (d DeploymentProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "expressionEvaluationOptions", d.ExpressionEvaluationOptions) populate(objectMap, "mode", d.Mode) populate(objectMap, "onErrorDeployment", d.OnErrorDeployment) - populateAny(objectMap, "parameters", d.Parameters) + populate(objectMap, "parameters", d.Parameters) populate(objectMap, "parametersLink", d.ParametersLink) populateAny(objectMap, "template", d.Template) populate(objectMap, "templateLink", d.TemplateLink) @@ -810,7 +841,7 @@ func (d DeploymentWhatIfProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "expressionEvaluationOptions", d.ExpressionEvaluationOptions) populate(objectMap, "mode", d.Mode) populate(objectMap, "onErrorDeployment", d.OnErrorDeployment) - populateAny(objectMap, "parameters", d.Parameters) + populate(objectMap, "parameters", d.Parameters) populate(objectMap, "parametersLink", d.ParametersLink) populateAny(objectMap, "template", d.Template) populate(objectMap, "templateLink", d.TemplateLink) @@ -1338,6 +1369,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 326aadab0f0f..54ea5beb5f75 100644 --- a/sdk/resourcemanager/resources/armresources/operations_client.go +++ b/sdk/resourcemanager/resources/armresources/operations_client.go @@ -39,7 +39,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 2023-07-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]{ @@ -79,7 +79,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/resources/armresources/options.go b/sdk/resourcemanager/resources/armresources/options.go index dfdb23b0cc8f..a7335a3e4f75 100644 --- a/sdk/resourcemanager/resources/armresources/options.go +++ b/sdk/resourcemanager/resources/armresources/options.go @@ -130,7 +130,7 @@ type ClientListOptions struct { // 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 } @@ -608,9 +608,23 @@ type ResourceGroupsClientUpdateOptions struct { // placeholder for future optional parameters } -// 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. @@ -623,11 +637,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 @@ -647,8 +656,3 @@ type TagsClientGetAtScopeOptions struct { 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 -} diff --git a/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go b/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go index 7f160860a0af..ba68ec135735 100644 --- a/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go +++ b/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go @@ -46,7 +46,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 2023-07-01 // - resourceProviderNamespace - The namespace of the resource provider. // - options - ProviderResourceTypesClientListOptions contains the optional parameters for the ProviderResourceTypesClient.List // method. @@ -91,7 +91,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", "2023-07-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 21c52166aea5..601fc1b4bf4d 100644 --- a/sdk/resourcemanager/resources/armresources/providers_client.go +++ b/sdk/resourcemanager/resources/armresources/providers_client.go @@ -46,7 +46,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 2023-07-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) { @@ -90,7 +90,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +108,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 2023-07-01 // - resourceProviderNamespace - The namespace of the resource provider. // - options - ProvidersClientGetAtTenantScopeOptions contains the optional parameters for the ProvidersClient.GetAtTenantScope // method. @@ -149,7 +149,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -166,7 +166,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 2023-07-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]{ @@ -213,7 +213,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -230,7 +230,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 2023-07-01 // - options - ProvidersClientListAtTenantScopeOptions contains the optional parameters for the ProvidersClient.NewListAtTenantScopePager // method. func (client *ProvidersClient) NewListAtTenantScopePager(options *ProvidersClientListAtTenantScopeOptions) *runtime.Pager[ProvidersClientListAtTenantScopeResponse] { @@ -274,7 +274,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +292,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 2023-07-01 // - resourceProviderNamespace - The namespace of the resource provider. // - options - ProvidersClientProviderPermissionsOptions contains the optional parameters for the ProvidersClient.ProviderPermissions // method. @@ -334,7 +334,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +352,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 2023-07-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) { @@ -393,7 +393,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Properties != nil { @@ -414,10 +414,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 2023-07-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 @@ -459,7 +461,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -468,7 +470,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 2023-07-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) { @@ -509,7 +511,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", "2023-07-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 123bf47a104f..09e04bf1ff3c 100644 --- a/sdk/resourcemanager/resources/armresources/resourcegroups_client.go +++ b/sdk/resourcemanager/resources/armresources/resourcegroups_client.go @@ -46,7 +46,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 2023-07-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. @@ -87,7 +87,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -96,7 +96,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 2023-07-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. @@ -140,7 +140,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -162,7 +162,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 2023-07-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. @@ -183,7 +183,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 2023-07-01 func (client *ResourceGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ResourceGroupsClient.BeginDelete" @@ -224,7 +224,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,7 +233,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 2023-07-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 @@ -256,7 +256,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 2023-07-01 func (client *ResourceGroupsClient) exportTemplate(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest, options *ResourceGroupsClientBeginExportTemplateOptions) (*http.Response, error) { var err error const operationName = "ResourceGroupsClient.BeginExportTemplate" @@ -294,7 +294,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -306,7 +306,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 2023-07-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) { @@ -347,7 +347,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +364,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 2023-07-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]{ @@ -414,7 +414,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,7 +434,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 2023-07-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. @@ -476,7 +476,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { 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 fb04138cd76c..76df28e353b2 100644 --- a/sdk/resourcemanager/resources/armresources/response_types.go +++ b/sdk/resourcemanager/resources/armresources/response_types.go @@ -509,7 +509,7 @@ type ResourceGroupsClientUpdateResponse struct { ResourceGroup } -// TagsClientCreateOrUpdateAtScopeResponse contains the response from method TagsClient.CreateOrUpdateAtScope. +// TagsClientCreateOrUpdateAtScopeResponse contains the response from method TagsClient.BeginCreateOrUpdateAtScope. type TagsClientCreateOrUpdateAtScopeResponse struct { // Wrapper resource for tags API requests and responses. TagsResource @@ -527,7 +527,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 } @@ -554,7 +554,7 @@ type TagsClientListResponse struct { TagsListResult } -// TagsClientUpdateAtScopeResponse contains the response from method TagsClient.UpdateAtScope. +// TagsClientUpdateAtScopeResponse contains the response from method TagsClient.BeginUpdateAtScope. type TagsClientUpdateAtScopeResponse struct { // Wrapper resource for tags API requests and responses. TagsResource diff --git a/sdk/resourcemanager/resources/armresources/tags_client.go b/sdk/resourcemanager/resources/armresources/tags_client.go index caa54194a255..a6fc72506deb 100644 --- a/sdk/resourcemanager/resources/armresources/tags_client.go +++ b/sdk/resourcemanager/resources/armresources/tags_client.go @@ -48,7 +48,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 2023-07-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) { @@ -89,7 +89,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -104,38 +104,55 @@ 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 2023-07-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 + } + poller, err := runtime.NewPoller[TagsClientCreateOrUpdateAtScopeResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } 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 2023-07-01 +func (client *TagsClient) createOrUpdateAtScope(ctx context.Context, scope string, parameters TagsResource, options *TagsClientBeginCreateOrUpdateAtScopeOptions) (*http.Response, error) { var err error - const operationName = "TagsClient.CreateOrUpdateAtScope" + const operationName = "TagsClient.BeginCreateOrUpdateAtScope" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() req, err := client.createOrUpdateAtScopeCreateRequest(ctx, scope, parameters, options) if err != nil { - return TagsClientCreateOrUpdateAtScopeResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return TagsClientCreateOrUpdateAtScopeResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) - return TagsClientCreateOrUpdateAtScopeResponse{}, err + return nil, err } - resp, err := client.createOrUpdateAtScopeHandleResponse(httpResp) - return resp, err + return httpResp, 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)) @@ -143,7 +160,7 @@ 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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -152,20 +169,11 @@ func (client *TagsClient) createOrUpdateAtScopeCreateRequest(ctx context.Context return req, nil } -// 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 2023-07-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 @@ -212,7 +220,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +240,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 2023-07-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) { @@ -272,41 +280,58 @@ 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", "2023-07-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 2023-07-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 + } + poller, err := runtime.NewPoller[TagsClientDeleteAtScopeResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } 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 2023-07-01 +func (client *TagsClient) deleteAtScope(ctx context.Context, scope string, options *TagsClientBeginDeleteAtScopeOptions) (*http.Response, error) { var err error - const operationName = "TagsClient.DeleteAtScope" + const operationName = "TagsClient.BeginDeleteAtScope" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() req, err := client.deleteAtScopeCreateRequest(ctx, scope, options) if err != nil { - return TagsClientDeleteAtScopeResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return TagsClientDeleteAtScopeResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) - return TagsClientDeleteAtScopeResponse{}, err + return nil, err } - return TagsClientDeleteAtScopeResponse{}, nil + return httpResp, 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)) @@ -314,7 +339,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +350,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 2023-07-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. @@ -370,7 +395,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -379,7 +404,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 2023-07-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) { @@ -413,7 +438,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -432,7 +457,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 2023-07-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]{ @@ -476,7 +501,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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -491,6 +516,29 @@ 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 2023-07-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 + } + poller, err := runtime.NewPoller[TagsClientUpdateAtScopeResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } 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 @@ -498,33 +546,30 @@ 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 2023-07-01 +func (client *TagsClient) updateAtScope(ctx context.Context, scope string, parameters TagsPatchResource, options *TagsClientBeginUpdateAtScopeOptions) (*http.Response, error) { var err error - const operationName = "TagsClient.UpdateAtScope" + const operationName = "TagsClient.BeginUpdateAtScope" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() req, err := client.updateAtScopeCreateRequest(ctx, scope, parameters, options) if err != nil { - return TagsClientUpdateAtScopeResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return TagsClientUpdateAtScopeResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) - return TagsClientUpdateAtScopeResponse{}, err + return nil, err } - resp, err := client.updateAtScopeHandleResponse(httpResp) - return resp, err + return httpResp, 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)) @@ -532,7 +577,7 @@ 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", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -540,12 +585,3 @@ func (client *TagsClient) updateAtScopeCreateRequest(ctx context.Context, scope } return req, nil } - -// 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"), - // }, - // }, - // } -}