From afcb35a2d2b4fc0cd2a18173e10142f760dbff75 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 22 Apr 2022 19:31:24 +0000 Subject: [PATCH] CodeGen from PR 18788 in Azure/azure-rest-api-specs Merge 0ab32bfd501f969be8c080f841def7efef133de7 into e5c85958c2b8db8a06a470052e73935c58c744ae --- .../resources/armresources/CHANGELOG.md | 4 + .../resources/armresources/autorest.md | 6 +- .../resources/armresources/go.mod | 4 +- .../resources/armresources/go.sum | 4 +- ...nerated_example_deployments_client_test.go | 392 ------------------ ...ample_providerresourcetypes_client_test.go | 38 -- ...generated_example_providers_client_test.go | 106 ----- ...ated_example_resourcegroups_client_test.go | 99 ----- .../ze_generated_example_tags_client_test.go | 68 --- .../armresources/zz_generated_constants.go | 2 +- 10 files changed, 12 insertions(+), 711 deletions(-) delete mode 100644 sdk/resourcemanager/resources/armresources/ze_generated_example_deployments_client_test.go delete mode 100644 sdk/resourcemanager/resources/armresources/ze_generated_example_providerresourcetypes_client_test.go delete mode 100644 sdk/resourcemanager/resources/armresources/ze_generated_example_providers_client_test.go delete mode 100644 sdk/resourcemanager/resources/armresources/ze_generated_example_resourcegroups_client_test.go delete mode 100644 sdk/resourcemanager/resources/armresources/ze_generated_example_tags_client_test.go diff --git a/sdk/resourcemanager/resources/armresources/CHANGELOG.md b/sdk/resourcemanager/resources/armresources/CHANGELOG.md index 4c181035b654..5b54b7919749 100644 --- a/sdk/resourcemanager/resources/armresources/CHANGELOG.md +++ b/sdk/resourcemanager/resources/armresources/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 0.5.1 (2022-04-22) +### Other Changes + + ## 0.5.0 (2022-04-18) ### Breaking Changes diff --git a/sdk/resourcemanager/resources/armresources/autorest.md b/sdk/resourcemanager/resources/armresources/autorest.md index acb486961a91..4d620847998e 100644 --- a/sdk/resourcemanager/resources/armresources/autorest.md +++ b/sdk/resourcemanager/resources/armresources/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/resources/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f92aaf88f4c9d1ffb9a014eba196d887a9288c3a/specification/resources/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.5.0 +module-version: 0.5.1 package-resources: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resources/armresources/go.mod b/sdk/resourcemanager/resources/armresources/go.mod index c2e9fbaee3f0..fefbaf9eeb40 100644 --- a/sdk/resourcemanager/resources/armresources/go.mod +++ b/sdk/resourcemanager/resources/armresources/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v0.3.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v0.5.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v0.6.0 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/resources/armresources/go.sum b/sdk/resourcemanager/resources/armresources/go.sum index e64f0a771d84..9dcbee8a014d 100644 --- a/sdk/resourcemanager/resources/armresources/go.sum +++ b/sdk/resourcemanager/resources/armresources/go.sum @@ -6,8 +6,8 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lk github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v0.3.0 h1:gYG7I0WxtCnHSWOFLbWCHLBWr+yzI5UeU9KuGZajf5U= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v0.3.0/go.mod h1:bwEUbGO8V/7KcrqwO14ADZ0m4AkTvSKx3ma68FRc3Bg= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v0.5.0 h1:b2/sc5zb7jUkbweEFbIswlNyAguvT5JbhscrD+E1AEk= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v0.5.0/go.mod h1:SoY/eDnXPi1TgNYBsWL9PGOwJR0xUf4zHL/fUnQHqDM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v0.6.0 h1:NNnwc8VjwQstfXlLq/gY0juJGPHX5sHhe7Gb1CSjWk8= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v0.6.0/go.mod h1:SoY/eDnXPi1TgNYBsWL9PGOwJR0xUf4zHL/fUnQHqDM= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/sdk/resourcemanager/resources/armresources/ze_generated_example_deployments_client_test.go b/sdk/resourcemanager/resources/armresources/ze_generated_example_deployments_client_test.go deleted file mode 100644 index c47a73d13f6b..000000000000 --- a/sdk/resourcemanager/resources/armresources/ze_generated_example_deployments_client_test.go +++ /dev/null @@ -1,392 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armresources_test - -import ( - "context" - "log" - - "time" - - "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/tree/main/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() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdateAtScope(ctx, - "", - "", - armresources.Deployment{ - Location: to.Ptr(""), - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]interface{}{}, - TemplateLink: &armresources.TemplateLink{ - URI: to.Ptr(""), - }, - }, - Tags: map[string]*string{ - "tagKey1": to.Ptr("tag-value-1"), - "tagKey2": to.Ptr("tag-value-2"), - }, - }, - &armresources.DeploymentsClientBeginCreateOrUpdateAtScopeOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdateAtTenantScope(ctx, - "", - armresources.ScopedDeployment{ - Location: to.Ptr(""), - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]interface{}{}, - TemplateLink: &armresources.TemplateLink{ - URI: to.Ptr(""), - }, - }, - Tags: map[string]*string{ - "tagKey1": to.Ptr("tag-value-1"), - "tagKey2": to.Ptr("tag-value-2"), - }, - }, - &armresources.DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginWhatIfAtTenantScope(ctx, - "", - armresources.ScopedDeploymentWhatIf{ - Location: to.Ptr(""), - Properties: &armresources.DeploymentWhatIfProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]interface{}{}, - TemplateLink: &armresources.TemplateLink{}, - }, - }, - &armresources.DeploymentsClientBeginWhatIfAtTenantScopeOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdateAtManagementGroupScope(ctx, - "", - "", - armresources.ScopedDeployment{ - Location: to.Ptr(""), - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]interface{}{}, - TemplateLink: &armresources.TemplateLink{ - URI: to.Ptr(""), - }, - }, - }, - &armresources.DeploymentsClientBeginCreateOrUpdateAtManagementGroupScopeOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginWhatIfAtManagementGroupScope(ctx, - "", - "", - armresources.ScopedDeploymentWhatIf{ - Location: to.Ptr(""), - Properties: &armresources.DeploymentWhatIfProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]interface{}{}, - TemplateLink: &armresources.TemplateLink{}, - }, - }, - &armresources.DeploymentsClientBeginWhatIfAtManagementGroupScopeOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdateAtSubscriptionScope(ctx, - "", - armresources.Deployment{ - Location: to.Ptr(""), - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]interface{}{}, - TemplateLink: &armresources.TemplateLink{ - ID: to.Ptr(""), - }, - }, - }, - &armresources.DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginWhatIfAtSubscriptionScope(ctx, - "", - armresources.DeploymentWhatIf{ - Location: to.Ptr(""), - Properties: &armresources.DeploymentWhatIfProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]interface{}{}, - TemplateLink: &armresources.TemplateLink{}, - }, - }, - &armresources.DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutDeploymentResourceGroup.json -func ExampleDeploymentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - armresources.Deployment{ - Properties: &armresources.DeploymentProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]interface{}{}, - TemplateLink: &armresources.TemplateLink{ - QueryString: to.Ptr(""), - URI: to.Ptr(""), - }, - }, - }, - &armresources.DeploymentsClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginWhatIf(ctx, - "", - "", - armresources.DeploymentWhatIf{ - Properties: &armresources.DeploymentWhatIfProperties{ - Mode: to.Ptr(armresources.DeploymentModeIncremental), - Parameters: map[string]interface{}{}, - TemplateLink: &armresources.TemplateLink{}, - }, - }, - &armresources.DeploymentsClientBeginWhatIfOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewDeploymentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CalculateTemplateHash(ctx, - map[string]interface{}{ - "$schema": "http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview", - "contentVersion": "1.0.0.0", - "outputs": map[string]interface{}{ - "string": map[string]interface{}{ - "type": "string", - "value": "myvalue", - }, - }, - "parameters": map[string]interface{}{ - "string": map[string]interface{}{ - "type": "string", - }, - }, - "resources": []interface{}{}, - "variables": map[string]interface{}{ - "array": []interface{}{ - float64(1), - float64(2), - float64(3), - float64(4), - }, - "bool": true, - "int": float64(42), - "object": map[string]interface{}{ - "object": map[string]interface{}{ - "location": "West US", - "vmSize": "Large", - }, - }, - "string": "string", - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/resources/armresources/ze_generated_example_providerresourcetypes_client_test.go b/sdk/resourcemanager/resources/armresources/ze_generated_example_providerresourcetypes_client_test.go deleted file mode 100644 index 295c39c4d531..000000000000 --- a/sdk/resourcemanager/resources/armresources/ze_generated_example_providerresourcetypes_client_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/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() - client, err := armresources.NewProviderResourceTypesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "", - &armresources.ProviderResourceTypesClientListOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/resources/armresources/ze_generated_example_providers_client_test.go b/sdk/resourcemanager/resources/armresources/ze_generated_example_providers_client_test.go deleted file mode 100644 index 9b2b91fb9794..000000000000 --- a/sdk/resourcemanager/resources/armresources/ze_generated_example_providers_client_test.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/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() - client, err := armresources.NewProvidersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ProviderPermissions(ctx, - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewProvidersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armresources.ProvidersClientListOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewProvidersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - &armresources.ProvidersClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/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() - client, err := armresources.NewProvidersClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAtTenantScope(ctx, - "", - &armresources.ProvidersClientGetAtTenantScopeOptions{Expand: to.Ptr("")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/resources/armresources/ze_generated_example_resourcegroups_client_test.go b/sdk/resourcemanager/resources/armresources/ze_generated_example_resourcegroups_client_test.go deleted file mode 100644 index 09a1c61aa09b..000000000000 --- a/sdk/resourcemanager/resources/armresources/ze_generated_example_resourcegroups_client_test.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armresources_test - -import ( - "context" - "log" - - "time" - - "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/tree/main/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() - client, err := armresources.NewResourceGroupsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - armresources.ResourceGroup{ - Location: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json -func ExampleResourceGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresources.NewResourceGroupsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "", - &armresources.ResourceGroupsClientBeginDeleteOptions{ForceDeletionTypes: to.Ptr(""), - ResumeToken: "", - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/ExportResourceGroup.json -func ExampleResourceGroupsClient_BeginExportTemplate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresources.NewResourceGroupsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExportTemplate(ctx, - "", - armresources.ExportTemplateRequest{ - Options: to.Ptr(""), - Resources: []*string{ - to.Ptr("*")}, - }, - &armresources.ResourceGroupsClientBeginExportTemplateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/resources/armresources/ze_generated_example_tags_client_test.go b/sdk/resourcemanager/resources/armresources/ze_generated_example_tags_client_test.go deleted file mode 100644 index a0f38aaa5702..000000000000 --- a/sdk/resourcemanager/resources/armresources/ze_generated_example_tags_client_test.go +++ /dev/null @@ -1,68 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/PutTagsResource.json -func ExampleTagsClient_CreateOrUpdateAtScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresources.NewTagsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateAtScope(ctx, - "", - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/resources/resource-manager/Microsoft.Resources/stable/2021-04-01/examples/GetTagsResource.json -func ExampleTagsClient_GetAtScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armresources.NewTagsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAtScope(ctx, - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/resources/armresources/zz_generated_constants.go b/sdk/resourcemanager/resources/armresources/zz_generated_constants.go index e5889a684188..af6cbf54cbeb 100644 --- a/sdk/resourcemanager/resources/armresources/zz_generated_constants.go +++ b/sdk/resourcemanager/resources/armresources/zz_generated_constants.go @@ -10,7 +10,7 @@ package armresources const ( moduleName = "armresources" - moduleVersion = "v0.5.0" + moduleVersion = "v0.5.1" ) // AliasPathAttributes - The attributes of the token that the alias path is referring to.