From 8e1bd2c54fcd5b69c5e7b9436945956c05603487 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 25 Oct 2023 02:44:27 +0000 Subject: [PATCH] CodeGen from PR 26364 in Azure/azure-rest-api-specs Merge 2b169bee98b58cd191e5b15f7cffa89b52f50aed into 1d88127c99135813e029a8e21546a243e191a1f8 --- .../armconnectedvmware/CHANGELOG.md | 4 + .../armconnectedvmware/autorest.md | 7 +- .../clusters_client_example_test.go | 262 ------------- .../armconnectedvmware/constants.go | 2 +- .../datastores_client_example_test.go | 262 ------------- .../connectedvmware/armconnectedvmware/go.mod | 14 +- .../connectedvmware/armconnectedvmware/go.sum | 22 +- .../hosts_client_example_test.go | 262 ------------- .../inventoryitems_client_example_test.go | 140 ------- .../operations_client_example_test.go | 244 ------------ .../resourcepools_client_example_test.go | 262 ------------- .../vcenters_client_example_test.go | 291 --------------- ...ualmachineinstances_client_example_test.go | 349 ------------------ ...ualmachinetemplates_client_example_test.go | 262 ------------- .../virtualnetworks_client_example_test.go | 262 ------------- ...instanceguestagents_client_example_test.go | 162 -------- ...rididentitymetadata_client_example_test.go | 92 ----- 17 files changed, 14 insertions(+), 2885 deletions(-) delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/clusters_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/datastores_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/hosts_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/inventoryitems_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/resourcepools_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/vcenters_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachineinstances_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachinetemplates_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualnetworks_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/vminstanceguestagents_client_example_test.go delete mode 100644 sdk/resourcemanager/connectedvmware/armconnectedvmware/vminstancehybrididentitymetadata_client_example_test.go diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/CHANGELOG.md b/sdk/resourcemanager/connectedvmware/armconnectedvmware/CHANGELOG.md index 133e2bd854dd..58874aed2ed6 100644 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/CHANGELOG.md +++ b/sdk/resourcemanager/connectedvmware/armconnectedvmware/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.1 (2023-10-25) +### Other Changes + + ## 1.0.0 (2023-10-27) ### Breaking Changes diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/autorest.md b/sdk/resourcemanager/connectedvmware/armconnectedvmware/autorest.md index e9b43bf16b39..685a64bd0b5c 100644 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/autorest.md +++ b/sdk/resourcemanager/connectedvmware/armconnectedvmware/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/connectedvmware/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/connectedvmware/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2023-10 +module-version: 1.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/clusters_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/clusters_client_example_test.go deleted file mode 100644 index 49cdb0955ffa..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/clusters_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateCluster.json -func ExampleClustersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "testrg", "HRCluster", armconnectedvmware.Cluster{ - ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - Type: to.Ptr("customLocation"), - }, - Location: to.Ptr("East US"), - Properties: &armconnectedvmware.ClusterProperties{ - MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - }, - }, 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.Cluster = armconnectedvmware.Cluster{ - // Name: to.Ptr("HRCluster"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Clusters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Clusters/HRCluster"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ClusterProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetCluster.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "testrg", "HRCluster", 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.Cluster = armconnectedvmware.Cluster{ - // Name: to.Ptr("HRCluster"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Clusters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Clusters/HRCluster"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ClusterProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateCluster.json -func ExampleClustersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Update(ctx, "testrg", "HRCluster", armconnectedvmware.ResourcePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.Cluster = armconnectedvmware.Cluster{ - // Name: to.Ptr("HRCluster"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Clusters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Clusters/HRCluster"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ClusterProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteCluster.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "testrg", "HRCluster", &armconnectedvmware.ClustersClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListClusters.json -func ExampleClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListPager(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.ClustersList = armconnectedvmware.ClustersList{ - // Value: []*armconnectedvmware.Cluster{ - // { - // Name: to.Ptr("HRCluster"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Clusters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Clusters/HRCluster"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ClusterProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListClustersByResourceGroup.json -func ExampleClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListByResourceGroupPager("testrg", 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.ClustersList = armconnectedvmware.ClustersList{ - // Value: []*armconnectedvmware.Cluster{ - // { - // Name: to.Ptr("HRCluster"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Clusters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Clusters/HRCluster"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ClusterProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/constants.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/constants.go index 15e80280836d..7b725248316a 100644 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/constants.go +++ b/sdk/resourcemanager/connectedvmware/armconnectedvmware/constants.go @@ -19,7 +19,7 @@ package armconnectedvmware const ( moduleName = "armconnectedvmware" - moduleVersion = "v1.0.0" + moduleVersion = "v1.0.1" ) // CreatedByType - The type of identity that created the resource. diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/datastores_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/datastores_client_example_test.go deleted file mode 100644 index eb8cc54b762f..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/datastores_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateDatastore.json -func ExampleDatastoresClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatastoresClient().BeginCreate(ctx, "testrg", "HRDatastore", armconnectedvmware.Datastore{ - ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - Type: to.Ptr("customLocation"), - }, - Location: to.Ptr("East US"), - Properties: &armconnectedvmware.DatastoreProperties{ - MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - }, - }, 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.Datastore = armconnectedvmware.Datastore{ - // Name: to.Ptr("HRDatastore"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Datastores"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Datastores/HRDatastore"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.DatastoreProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetDatastore.json -func ExampleDatastoresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatastoresClient().Get(ctx, "testrg", "HRDatastore", 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.Datastore = armconnectedvmware.Datastore{ - // Name: to.Ptr("HRDatastore"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Datastores"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Datastores/HRDatastore"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.DatastoreProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateDatastore.json -func ExampleDatastoresClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDatastoresClient().Update(ctx, "testrg", "HRDatastore", armconnectedvmware.ResourcePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.Datastore = armconnectedvmware.Datastore{ - // Name: to.Ptr("HRDatastore"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Datastores"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Datastores/HRDatastore"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.DatastoreProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteDatastore.json -func ExampleDatastoresClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDatastoresClient().BeginDelete(ctx, "testrg", "HRDatastore", &armconnectedvmware.DatastoresClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListDatastores.json -func ExampleDatastoresClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatastoresClient().NewListPager(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.DatastoresList = armconnectedvmware.DatastoresList{ - // Value: []*armconnectedvmware.Datastore{ - // { - // Name: to.Ptr("HRDatastore"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Datastores"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Datastores/HRDatastore"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.DatastoreProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListDatastoresByResourceGroup.json -func ExampleDatastoresClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatastoresClient().NewListByResourceGroupPager("testrg", 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.DatastoresList = armconnectedvmware.DatastoresList{ - // Value: []*armconnectedvmware.Datastore{ - // { - // Name: to.Ptr("HRDatastore"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Datastores"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Datastores/HRDatastore"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.DatastoreProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/go.mod b/sdk/resourcemanager/connectedvmware/armconnectedvmware/go.mod index 5cd0d19da48a..0c1fdc7c163b 100644 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/go.mod +++ b/sdk/resourcemanager/connectedvmware/armconnectedvmware/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/connectedvmware/arm go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect - github.com/golang-jwt/jwt/v5 v5.0.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.12.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.14.0 // indirect - golang.org/x/sys v0.11.0 // indirect golang.org/x/text v0.12.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/go.sum b/sdk/resourcemanager/connectedvmware/armconnectedvmware/go.sum index 545850a5189d..b078fe12f439 100644 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/go.sum +++ b/sdk/resourcemanager/connectedvmware/armconnectedvmware/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 h1:/iHxaJhsFr0+xVFfbMr5vxz848jyiWuIEDhYq3y5odY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 h1:LNHhpdK7hzUcx/k1LIcuh5k7k1LGIWLQfCjaneSj7Fc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQjVi2IblCG9iaLtZsuYZ8ne+PuQ02M= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/hosts_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/hosts_client_example_test.go deleted file mode 100644 index 825f69e6e48d..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/hosts_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateHost.json -func ExampleHostsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHostsClient().BeginCreate(ctx, "testrg", "HRHost", armconnectedvmware.Host{ - ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - Type: to.Ptr("customLocation"), - }, - Location: to.Ptr("East US"), - Properties: &armconnectedvmware.HostProperties{ - MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - }, - }, 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.Host = armconnectedvmware.Host{ - // Name: to.Ptr("HRHost"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Hosts"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Hosts/HRHost"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.HostProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetHost.json -func ExampleHostsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostsClient().Get(ctx, "testrg", "HRHost", 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.Host = armconnectedvmware.Host{ - // Name: to.Ptr("HRHost"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Hosts"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Hosts/HRHost"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.HostProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateHost.json -func ExampleHostsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHostsClient().Update(ctx, "testrg", "HRHost", armconnectedvmware.ResourcePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.Host = armconnectedvmware.Host{ - // Name: to.Ptr("HRHost"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Hosts"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Hosts/HRHost"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.HostProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteHost.json -func ExampleHostsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewHostsClient().BeginDelete(ctx, "testrg", "HRHost", &armconnectedvmware.HostsClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListHosts.json -func ExampleHostsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHostsClient().NewListPager(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.HostsList = armconnectedvmware.HostsList{ - // Value: []*armconnectedvmware.Host{ - // { - // Name: to.Ptr("HRHost"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Hosts"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Hosts/HRHost"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.HostProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListHostsByResourceGroup.json -func ExampleHostsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHostsClient().NewListByResourceGroupPager("testrg", 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.HostsList = armconnectedvmware.HostsList{ - // Value: []*armconnectedvmware.Host{ - // { - // Name: to.Ptr("HRHost"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/Hosts"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/Hosts/HRHost"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.HostProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/inventoryitems_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/inventoryitems_client_example_test.go deleted file mode 100644 index eb894a13dc29..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/inventoryitems_client_example_test.go +++ /dev/null @@ -1,140 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateInventoryItem.json -func ExampleInventoryItemsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Create(ctx, "testrg", "ContosoVCenter", "testItem", armconnectedvmware.InventoryItem{ - Properties: &armconnectedvmware.ResourcePoolInventoryItem{ - InventoryType: to.Ptr(armconnectedvmware.InventoryTypeResourcePool), - }, - }, 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.InventoryItem = armconnectedvmware.InventoryItem{ - // Name: to.Ptr("testItem"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VCenters/InventoryItems"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter/InventoryItems/testItem"), - // Properties: &armconnectedvmware.ResourcePoolInventoryItem{ - // InventoryType: to.Ptr(armconnectedvmware.InventoryTypeResourcePool), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetInventoryItem.json -func ExampleInventoryItemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Get(ctx, "testrg", "ContosoVCenter", "testItem", 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.InventoryItem = armconnectedvmware.InventoryItem{ - // Name: to.Ptr("testItem"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VCenters/InventoryItems"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter/InventoryItems/testItem"), - // Properties: &armconnectedvmware.ResourcePoolInventoryItem{ - // InventoryType: to.Ptr(armconnectedvmware.InventoryTypeResourcePool), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteInventoryItem.json -func ExampleInventoryItemsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewInventoryItemsClient().Delete(ctx, "testrg", "ContosoVCenter", "testItem", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/InventoryItems_ListByVCenter.json -func ExampleInventoryItemsClient_NewListByVCenterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInventoryItemsClient().NewListByVCenterPager("testrg", "ContosoVCenter", 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.InventoryItemsList = armconnectedvmware.InventoryItemsList{ - // Value: []*armconnectedvmware.InventoryItem{ - // { - // Name: to.Ptr("testItem"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VCenters/InventoryItems"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter/InventoryItems/testItem"), - // Properties: &armconnectedvmware.ResourcePoolInventoryItem{ - // InventoryType: to.Ptr(armconnectedvmware.InventoryTypeResourcePool), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/operations_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/operations_client_example_test.go deleted file mode 100644 index e542a461c4b0..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/operations_client_example_test.go +++ /dev/null @@ -1,244 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(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.OperationsList = armconnectedvmware.OperationsList{ - // Value: []*armconnectedvmware.Operation{ - // { - // Name: to.Ptr("microsoft.vmware/vcenters/Read"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Read vcenters"), - // Operation: to.Ptr("Gets/List vcenters resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("vcenters"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/vcenters/Write"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Writes vcenters"), - // Operation: to.Ptr("Create/update vcenters resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("vcenters"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/vcenters/Delete"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Deletes vcenters"), - // Operation: to.Ptr("Deletes vcenters resource"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("vcenters"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/resourcepools/Read"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Read resourcepools"), - // Operation: to.Ptr("Gets/List resourcepools resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("resourcepools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/resourcepools/Write"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Writes resourcepools"), - // Operation: to.Ptr("Create/update resourcepools resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("resourcepools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/resourcepools/Delete"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Deletes resourcepools"), - // Operation: to.Ptr("Deletes resourcepools resource"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("resourcepools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualmachines/Read"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Read virtualmachines"), - // Operation: to.Ptr("Gets/List virtualmachines resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualmachines"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualmachines/Write"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Writes virtualmachines"), - // Operation: to.Ptr("Create/update virtualmachines resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualmachines"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualmachines/Delete"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Deletes virtualmachines"), - // Operation: to.Ptr("Deletes virtualmachines resource"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualmachines"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualmachinetemplates/Read"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Read virtualmachinetemplates"), - // Operation: to.Ptr("Gets/List virtualmachinetemplates resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualmachinetemplates"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualmachinetemplates/Write"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Writes virtualmachinetemplates"), - // Operation: to.Ptr("Create/update virtualmachinetemplates resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualmachinetemplates"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualmachinetemplates/Delete"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Deletes virtualmachinetemplates"), - // Operation: to.Ptr("Deletes virtualmachinetemplates resource"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualmachinetemplates"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualnetworks/Read"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Read virtualnetworks"), - // Operation: to.Ptr("Gets/List virtualnetworks resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualnetworks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualnetworks/Write"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Writes virtualnetworks"), - // Operation: to.Ptr("Create/update virtualnetworks resources"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualnetworks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualnetworks/Delete"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Deletes virtualnetworks"), - // Operation: to.Ptr("Deletes virtualnetworks resource"), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualnetworks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/arczones/deploy/action"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Deploy on arczone."), - // Operation: to.Ptr("Deploy on arczone."), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("arczones"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualmachinetemplates/clone/action"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Clone on virtual machine templates."), - // Operation: to.Ptr("Clone on virtual machine templates."), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualmachinetemplates"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/resourcepools/deploy/action"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Deploy on resource pool."), - // Operation: to.Ptr("Deploy on resource pool."), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("resourcepools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("microsoft.vmware/virtualnetworks/join/action"), - // Display: &armconnectedvmware.OperationDisplay{ - // Description: to.Ptr("Join virtual network."), - // Operation: to.Ptr("Join virtual network."), - // Provider: to.Ptr("microsoft.vmware"), - // Resource: to.Ptr("virtualnetworks"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/resourcepools_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/resourcepools_client_example_test.go deleted file mode 100644 index feabede60446..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/resourcepools_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateResourcePool.json -func ExampleResourcePoolsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourcePoolsClient().BeginCreate(ctx, "testrg", "HRPool", armconnectedvmware.ResourcePool{ - ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - Type: to.Ptr("customLocation"), - }, - Location: to.Ptr("East US"), - Properties: &armconnectedvmware.ResourcePoolProperties{ - MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - }, - }, 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.ResourcePool = armconnectedvmware.ResourcePool{ - // Name: to.Ptr("HRPool"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/ResourcePools"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ResourcePoolProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetResourcePool.json -func ExampleResourcePoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourcePoolsClient().Get(ctx, "testrg", "HRPool", 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.ResourcePool = armconnectedvmware.ResourcePool{ - // Name: to.Ptr("HRPool"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/ResourcePools"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ResourcePoolProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateResourcePool.json -func ExampleResourcePoolsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourcePoolsClient().Update(ctx, "testrg", "HRPool", armconnectedvmware.ResourcePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.ResourcePool = armconnectedvmware.ResourcePool{ - // Name: to.Ptr("HRPool"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/ResourcePools"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ResourcePoolProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteResourcePool.json -func ExampleResourcePoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewResourcePoolsClient().BeginDelete(ctx, "testrg", "HRPool", &armconnectedvmware.ResourcePoolsClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListResourcePools.json -func ExampleResourcePoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourcePoolsClient().NewListPager(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.ResourcePoolsList = armconnectedvmware.ResourcePoolsList{ - // Value: []*armconnectedvmware.ResourcePool{ - // { - // Name: to.Ptr("HRPool"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/ResourcePools"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ResourcePoolProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListResourcePoolsByResourceGroup.json -func ExampleResourcePoolsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourcePoolsClient().NewListByResourceGroupPager("testrg", 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.ResourcePoolsList = armconnectedvmware.ResourcePoolsList{ - // Value: []*armconnectedvmware.ResourcePool{ - // { - // Name: to.Ptr("HRPool"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/ResourcePools"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.ResourcePoolProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/vcenters_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/vcenters_client_example_test.go deleted file mode 100644 index 9dceafb42c27..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/vcenters_client_example_test.go +++ /dev/null @@ -1,291 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVCenter.json -func ExampleVCentersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVCentersClient().BeginCreate(ctx, "testrg", "ContosoVCenter", armconnectedvmware.VCenter{ - ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - Type: to.Ptr("customLocation"), - }, - Location: to.Ptr("East US"), - Properties: &armconnectedvmware.VCenterProperties{ - Credentials: &armconnectedvmware.VICredential{ - Password: to.Ptr(""), - Username: to.Ptr("tempuser"), - }, - Fqdn: to.Ptr("ContosoVMware.contoso.com"), - Port: to.Ptr[int32](1234), - }, - }, 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.VCenter = armconnectedvmware.VCenter{ - // Name: to.Ptr("ContosoVCenter"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VCenters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VCenterProperties{ - // Credentials: &armconnectedvmware.VICredential{ - // Username: to.Ptr("tempuser"), - // }, - // Fqdn: to.Ptr("ContosoVMware.contoso.com"), - // InstanceUUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Port: to.Ptr[int32](1234), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVCenter.json -func ExampleVCentersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVCentersClient().Get(ctx, "testrg", "ContosoVCenter", 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.VCenter = armconnectedvmware.VCenter{ - // Name: to.Ptr("ContosoVCenter"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VCenters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VCenterProperties{ - // Credentials: &armconnectedvmware.VICredential{ - // Username: to.Ptr("tempuser"), - // }, - // Fqdn: to.Ptr("ContosoVMware.contoso.com"), - // InstanceUUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Port: to.Ptr[int32](1234), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVCenter.json -func ExampleVCentersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVCentersClient().Update(ctx, "testrg", "ContosoVCenter", armconnectedvmware.ResourcePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.VCenter = armconnectedvmware.VCenter{ - // Name: to.Ptr("ContosoVCenter"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VCenters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VCenterProperties{ - // Credentials: &armconnectedvmware.VICredential{ - // Username: to.Ptr("tempuser"), - // }, - // Fqdn: to.Ptr("ContosoVMware.contoso.com"), - // InstanceUUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Port: to.Ptr[int32](1234), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVCenter.json -func ExampleVCentersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVCentersClient().BeginDelete(ctx, "testrg", "ContosoVCenter", &armconnectedvmware.VCentersClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVCenters.json -func ExampleVCentersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVCentersClient().NewListPager(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.VCentersList = armconnectedvmware.VCentersList{ - // Value: []*armconnectedvmware.VCenter{ - // { - // Name: to.Ptr("ContosoVCenter"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VCenters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VCenterProperties{ - // Credentials: &armconnectedvmware.VICredential{ - // Username: to.Ptr("tempuser"), - // }, - // Fqdn: to.Ptr("ContosoVMware.contoso.com"), - // InstanceUUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Port: to.Ptr[int32](1234), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVCentersByResourceGroup.json -func ExampleVCentersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVCentersClient().NewListByResourceGroupPager("testrg", 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.VCentersList = armconnectedvmware.VCentersList{ - // Value: []*armconnectedvmware.VCenter{ - // { - // Name: to.Ptr("ContosoVCenter"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VCenters"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VCenterProperties{ - // Credentials: &armconnectedvmware.VICredential{ - // Username: to.Ptr("tempuser"), - // }, - // Fqdn: to.Ptr("ContosoVMware.contoso.com"), - // InstanceUUID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // Port: to.Ptr[int32](1234), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachineinstances_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachineinstances_client_example_test.go deleted file mode 100644 index 94a9cbf30659..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachineinstances_client_example_test.go +++ /dev/null @@ -1,349 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", armconnectedvmware.VirtualMachineInstance{ - ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - Type: to.Ptr("customLocation"), - }, - Properties: &armconnectedvmware.VirtualMachineInstanceProperties{ - HardwareProfile: &armconnectedvmware.HardwareProfile{ - MemorySizeMB: to.Ptr[int32](4196), - NumCPUs: to.Ptr[int32](4), - }, - InfrastructureProfile: &armconnectedvmware.InfrastructureProfile{ - TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - }, - PlacementProfile: &armconnectedvmware.PlacementProfile{ - ResourcePoolID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - }, - }, - }, 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.VirtualMachineInstance = armconnectedvmware.VirtualMachineInstance{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachines"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armconnectedvmware.VirtualMachineInstanceProperties{ - // HardwareProfile: &armconnectedvmware.HardwareProfile{ - // MemorySizeMB: to.Ptr[int32](4196), - // NumCPUs: to.Ptr[int32](4), - // }, - // InfrastructureProfile: &armconnectedvmware.InfrastructureProfile{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // OSProfile: &armconnectedvmware.OsProfileForVMInstance{ - // ComputerName: to.Ptr("DemoVM"), - // OSType: to.Ptr(armconnectedvmware.OsTypeWindows), - // }, - // PlacementProfile: &armconnectedvmware.PlacementProfile{ - // ResourcePoolID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - // }, - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineInstancesClient().Get(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", 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.VirtualMachineInstance = armconnectedvmware.VirtualMachineInstance{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachines"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armconnectedvmware.VirtualMachineInstanceProperties{ - // HardwareProfile: &armconnectedvmware.HardwareProfile{ - // MemorySizeMB: to.Ptr[int32](4196), - // NumCPUs: to.Ptr[int32](4), - // }, - // InfrastructureProfile: &armconnectedvmware.InfrastructureProfile{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // OSProfile: &armconnectedvmware.OsProfileForVMInstance{ - // ComputerName: to.Ptr("DemoVM"), - // OSType: to.Ptr(armconnectedvmware.OsTypeWindows), - // }, - // PlacementProfile: &armconnectedvmware.PlacementProfile{ - // ResourcePoolID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - // }, - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginUpdate(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", armconnectedvmware.VirtualMachineInstanceUpdate{ - Properties: &armconnectedvmware.VirtualMachineInstanceUpdateProperties{ - HardwareProfile: &armconnectedvmware.HardwareProfile{ - MemorySizeMB: to.Ptr[int32](4196), - NumCPUs: to.Ptr[int32](4), - }, - }, - }, 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.VirtualMachineInstance = armconnectedvmware.VirtualMachineInstance{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachines"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armconnectedvmware.VirtualMachineInstanceProperties{ - // HardwareProfile: &armconnectedvmware.HardwareProfile{ - // MemorySizeMB: to.Ptr[int32](4196), - // NumCPUs: to.Ptr[int32](4), - // }, - // InfrastructureProfile: &armconnectedvmware.InfrastructureProfile{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // OSProfile: &armconnectedvmware.OsProfileForVMInstance{ - // ComputerName: to.Ptr("DemoVM"), - // OSType: to.Ptr(armconnectedvmware.OsTypeWindows), - // }, - // PlacementProfile: &armconnectedvmware.PlacementProfile{ - // ResourcePoolID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - // }, - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDelete(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", &armconnectedvmware.VirtualMachineInstancesClientBeginDeleteOptions{DeleteFromHost: nil, - Force: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualMachineInstances.json -func ExampleVirtualMachineInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineInstancesClient().NewListPager("subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", 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.VirtualMachineInstancesList = armconnectedvmware.VirtualMachineInstancesList{ - // Value: []*armconnectedvmware.VirtualMachineInstance{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachines"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armconnectedvmware.VirtualMachineInstanceProperties{ - // HardwareProfile: &armconnectedvmware.HardwareProfile{ - // MemorySizeMB: to.Ptr[int32](4196), - // NumCPUs: to.Ptr[int32](4), - // }, - // InfrastructureProfile: &armconnectedvmware.InfrastructureProfile{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // TemplateID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // OSProfile: &armconnectedvmware.OsProfileForVMInstance{ - // ComputerName: to.Ptr("DemoVM"), - // OSType: to.Ptr(armconnectedvmware.OsTypeWindows), - // }, - // PlacementProfile: &armconnectedvmware.PlacementProfile{ - // ResourcePoolID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/ResourcePools/HRPool"), - // }, - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/StopVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStop(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", &armconnectedvmware.VirtualMachineInstancesClientBeginStopOptions{Body: &armconnectedvmware.StopVirtualMachineOptions{ - SkipShutdown: to.Ptr(true), - }, - }) - 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/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/StartVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStart(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/RestartVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestart(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachinetemplates_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachinetemplates_client_example_test.go deleted file mode 100644 index 14a31048e5fb..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachinetemplates_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVirtualMachineTemplate.json -func ExampleVirtualMachineTemplatesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginCreate(ctx, "testrg", "WebFrontEndTemplate", armconnectedvmware.VirtualMachineTemplate{ - ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - Type: to.Ptr("customLocation"), - }, - Location: to.Ptr("East US"), - Properties: &armconnectedvmware.VirtualMachineTemplateProperties{ - MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - }, - }, 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.VirtualMachineTemplate = armconnectedvmware.VirtualMachineTemplate{ - // Name: to.Ptr("WebFrontEndTemplate"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualMachineTemplateProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVirtualMachineTemplate.json -func ExampleVirtualMachineTemplatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineTemplatesClient().Get(ctx, "testrg", "WebFrontEndTemplate", 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.VirtualMachineTemplate = armconnectedvmware.VirtualMachineTemplate{ - // Name: to.Ptr("WebFrontEndTemplate"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualMachineTemplateProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVirtualMachineTemplate.json -func ExampleVirtualMachineTemplatesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineTemplatesClient().Update(ctx, "testrg", "WebFrontEndTemplate", armconnectedvmware.ResourcePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.VirtualMachineTemplate = armconnectedvmware.VirtualMachineTemplate{ - // Name: to.Ptr("WebFrontEndTemplate"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualMachineTemplateProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVirtualMachineTemplate.json -func ExampleVirtualMachineTemplatesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginDelete(ctx, "testrg", "WebFrontEndTemplate", &armconnectedvmware.VirtualMachineTemplatesClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualMachineTemplates.json -func ExampleVirtualMachineTemplatesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListPager(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.VirtualMachineTemplatesList = armconnectedvmware.VirtualMachineTemplatesList{ - // Value: []*armconnectedvmware.VirtualMachineTemplate{ - // { - // Name: to.Ptr("WebFrontEndTemplate"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualMachineTemplateProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualMachineTemplatesByResourceGroup.json -func ExampleVirtualMachineTemplatesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListByResourceGroupPager("testrg", 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.VirtualMachineTemplatesList = armconnectedvmware.VirtualMachineTemplatesList{ - // Value: []*armconnectedvmware.VirtualMachineTemplate{ - // { - // Name: to.Ptr("WebFrontEndTemplate"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineTemplates/WebFrontEndTemplate"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualMachineTemplateProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualnetworks_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualnetworks_client_example_test.go deleted file mode 100644 index fa654de02ab1..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualnetworks_client_example_test.go +++ /dev/null @@ -1,262 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVirtualNetwork.json -func ExampleVirtualNetworksClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreate(ctx, "testrg", "ProdNetwork", armconnectedvmware.VirtualNetwork{ - ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - Type: to.Ptr("customLocation"), - }, - Location: to.Ptr("East US"), - Properties: &armconnectedvmware.VirtualNetworkProperties{ - MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - }, - }, 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.VirtualNetwork = armconnectedvmware.VirtualNetwork{ - // Name: to.Ptr("ProdNetwork"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualNetworks"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualNetworks/ProdNetwork"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualNetworkProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVirtualNetwork.json -func ExampleVirtualNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "testrg", "ProdNetwork", 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.VirtualNetwork = armconnectedvmware.VirtualNetwork{ - // Name: to.Ptr("ProdNetwork"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualNetworks"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualNetworks/ProdNetwork"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualNetworkProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/UpdateVirtualNetwork.json -func ExampleVirtualNetworksClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Update(ctx, "testrg", "ProdNetwork", armconnectedvmware.ResourcePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.VirtualNetwork = armconnectedvmware.VirtualNetwork{ - // Name: to.Ptr("ProdNetwork"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualNetworks"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualNetworks/ProdNetwork"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualNetworkProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVirtualNetwork.json -func ExampleVirtualNetworksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "testrg", "ProdNetwork", &armconnectedvmware.VirtualNetworksClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualNetworks.json -func ExampleVirtualNetworksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListPager(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.VirtualNetworksList = armconnectedvmware.VirtualNetworksList{ - // Value: []*armconnectedvmware.VirtualNetwork{ - // { - // Name: to.Ptr("ProdNetwork"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualNetworks"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualNetworks/ProdNetwork"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualNetworkProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/ListVirtualNetworksByResourceGroup.json -func ExampleVirtualNetworksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListByResourceGroupPager("testrg", 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.VirtualNetworksList = armconnectedvmware.VirtualNetworksList{ - // Value: []*armconnectedvmware.VirtualNetwork{ - // { - // Name: to.Ptr("ProdNetwork"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualNetworks"), - // ExtendedLocation: &armconnectedvmware.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.ExtendedLocation/customLocations/contoso"), - // Type: to.Ptr("customLocation"), - // }, - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VirtualNetworks/ProdNetwork"), - // Location: to.Ptr("East US"), - // Properties: &armconnectedvmware.VirtualNetworkProperties{ - // MoRefID: to.Ptr("aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // VCenterID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ConnectedVMwarevSphere/VCenters/ContosoVCenter"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/vminstanceguestagents_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/vminstanceguestagents_client_example_test.go deleted file mode 100644 index e94757dedf30..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/vminstanceguestagents_client_example_test.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_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/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/CreateVMInstanceGuestAgent.json -func ExampleVMInstanceGuestAgentsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVMInstanceGuestAgentsClient().BeginCreate(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", armconnectedvmware.GuestAgent{ - Properties: &armconnectedvmware.GuestAgentProperties{ - Credentials: &armconnectedvmware.GuestCredential{ - Password: to.Ptr(""), - Username: to.Ptr("tempuser"), - }, - HTTPProxyConfig: &armconnectedvmware.HTTPProxyConfiguration{ - HTTPSProxy: to.Ptr("http://192.1.2.3:8080"), - }, - PrivateLinkScopeResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), - ProvisioningAction: to.Ptr(armconnectedvmware.ProvisioningActionInstall), - }, - }, 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.GuestAgent = armconnectedvmware.GuestAgent{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachineInstances/guestAgents"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents/default"), - // Properties: &armconnectedvmware.GuestAgentProperties{ - // ProvisioningAction: to.Ptr(armconnectedvmware.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // Status: to.Ptr("connected"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVMInstanceGuestAgent.json -func ExampleVMInstanceGuestAgentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVMInstanceGuestAgentsClient().Get(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", 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.GuestAgent = armconnectedvmware.GuestAgent{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VitualMachineInstances/guestAgents"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents/default"), - // Properties: &armconnectedvmware.GuestAgentProperties{ - // ProvisioningAction: to.Ptr(armconnectedvmware.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // Status: to.Ptr("connected"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/DeleteVMInstanceGuestAgent.json -func ExampleVMInstanceGuestAgentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVMInstanceGuestAgentsClient().BeginDelete(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/VMInstanceGuestAgent_ListByVm.json -func ExampleVMInstanceGuestAgentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVMInstanceGuestAgentsClient().NewListPager("subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", 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.GuestAgentList = armconnectedvmware.GuestAgentList{ - // Value: []*armconnectedvmware.GuestAgent{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VitualMachineInstances/guestAgents"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents/default"), - // Properties: &armconnectedvmware.GuestAgentProperties{ - // ProvisioningAction: to.Ptr(armconnectedvmware.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armconnectedvmware.ProvisioningStateSucceeded), - // Status: to.Ptr("connected"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/connectedvmware/armconnectedvmware/vminstancehybrididentitymetadata_client_example_test.go b/sdk/resourcemanager/connectedvmware/armconnectedvmware/vminstancehybrididentitymetadata_client_example_test.go deleted file mode 100644 index 9ac23f185af6..000000000000 --- a/sdk/resourcemanager/connectedvmware/armconnectedvmware/vminstancehybrididentitymetadata_client_example_test.go +++ /dev/null @@ -1,92 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// 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 armconnectedvmware_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/connectedvmware/armconnectedvmware" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/GetVmInstanceHybridIdentityMetadata.json -func ExampleVMInstanceHybridIdentityMetadataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVMInstanceHybridIdentityMetadataClient().Get(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", 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.VMInstanceHybridIdentityMetadata = armconnectedvmware.VMInstanceHybridIdentityMetadata{ - // Name: to.Ptr("testItem"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VitualMachineInstances/hybridIdentityMetadata"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.ConnectedVMwarevSphere/VitualMachineInstances/default/hybridIdentityMetadata/default"), - // Properties: &armconnectedvmware.VMInstanceHybridIdentityMetadataProperties{ - // PublicKey: to.Ptr("8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2"), - // ResourceUID: to.Ptr("f8b82dff-38ef-4220-99ef-d3a3f86ddc6c"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3066a973f4baf2e2bf072a013b585a820bb10146/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/examples/HybridIdentityMetadata_ListByVmInstance.json -func ExampleVMInstanceHybridIdentityMetadataClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armconnectedvmware.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVMInstanceHybridIdentityMetadataClient().NewListPager("subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM", 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.VMInstanceHybridIdentityMetadataList = armconnectedvmware.VMInstanceHybridIdentityMetadataList{ - // Value: []*armconnectedvmware.VMInstanceHybridIdentityMetadata{ - // { - // Name: to.Ptr("testItem"), - // Type: to.Ptr("Microsoft.ConnectedVMwarevSphere/VirtualMachineInstances/hybridIdentityMetadata"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.ConnectedVMwarevSphere/VirtualMachineInstances/default/hybridIdentityMetadata/default"), - // Properties: &armconnectedvmware.VMInstanceHybridIdentityMetadataProperties{ - // PublicKey: to.Ptr("8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2"), - // ResourceUID: to.Ptr("f8b82dff-38ef-4220-99ef-d3a3f86ddc6c"), - // }, - // }}, - // } - } -}