diff --git a/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md b/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md index 4b4702a05b07..c4184ad77a2f 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md +++ b/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 2.0.0 (2025-03-25) +### Breaking Changes + +- Function `*VirtualMachineInstancesClient.BeginStop` parameter(s) have been changed from `(context.Context, string, StopVirtualMachineOptions, *VirtualMachineInstancesClientBeginStopOptions)` to `(context.Context, string, *VirtualMachineInstancesClientBeginStopOptions)` + +### Features Added + +- New field `StorageGB` in struct `CloudCapacity` +- New field `PrivateLinkScopeResourceID` in struct `GuestAgentProperties` +- New field `AdminUsername`, `DomainName`, `DomainPassword`, `DomainUsername`, `ProductKey`, `RunOnceCommands`, `Timezone`, `Workgroup` in struct `OsProfileForVMInstance` +- New field `Body` in struct `VirtualMachineInstancesClientBeginStopOptions` +- New field `Generation` in struct `VirtualMachineInventoryItem` + + ## 1.0.0 (2024-06-28) ### Breaking Changes diff --git a/sdk/resourcemanager/scvmm/armscvmm/README.md b/sdk/resourcemanager/scvmm/armscvmm/README.md index 180217e2a9f8..f885b9c9d3c0 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/README.md +++ b/sdk/resourcemanager/scvmm/armscvmm/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Scvmm module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2 ``` ## Authorization diff --git a/sdk/resourcemanager/scvmm/armscvmm/autorest.md b/sdk/resourcemanager/scvmm/armscvmm/autorest.md index be912d6e1c0c..60d923df049d 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/autorest.md +++ b/sdk/resourcemanager/scvmm/armscvmm/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/scvmm/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/scvmm/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2023-10 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go b/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go index cea845178f08..f5c279e695ef 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAvailabilitySetsClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Onboards the ScVmm availability set as an Azure resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - resource - Resource create parameters. @@ -73,7 +70,7 @@ func (client *AvailabilitySetsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Onboards the ScVmm availability set as an Azure resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *AvailabilitySetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, resource AvailabilitySet, options *AvailabilitySetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AvailabilitySetsClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *AvailabilitySetsClient) createOrUpdate(ctx context.Context, resour } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, resource AvailabilitySet, options *AvailabilitySetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, resource AvailabilitySet, _ *AvailabilitySetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +112,7 @@ func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +124,7 @@ func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deregisters the ScVmm availability set from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - options - AvailabilitySetsClientBeginDeleteOptions contains the optional parameters for the AvailabilitySetsClient.BeginDelete @@ -153,7 +150,7 @@ func (client *AvailabilitySetsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deregisters the ScVmm availability set from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *AvailabilitySetsClient) deleteOperation(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, options *AvailabilitySetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AvailabilitySetsClient.BeginDelete" @@ -195,7 +192,7 @@ func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -207,7 +204,7 @@ func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, r // Get - Implements AvailabilitySet GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. @@ -234,7 +231,7 @@ func (client *AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, options *AvailabilitySetsClientGetOptions) (*policy.Request, error) { +func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, _ *AvailabilitySetsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -253,7 +250,7 @@ func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +267,7 @@ func (client *AvailabilitySetsClient) getHandleResponse(resp *http.Response) (Av // NewListByResourceGroupPager - List of AvailabilitySets in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AvailabilitySetsClientListByResourceGroupOptions contains the optional parameters for the AvailabilitySetsClient.NewListByResourceGroupPager // method. @@ -298,7 +295,7 @@ func (client *AvailabilitySetsClient) NewListByResourceGroupPager(resourceGroupN } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AvailabilitySetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AvailabilitySetsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *AvailabilitySetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *AvailabilitySetsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -313,7 +310,7 @@ func (client *AvailabilitySetsClient) listByResourceGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +327,7 @@ func (client *AvailabilitySetsClient) listByResourceGroupHandleResponse(resp *ht // NewListBySubscriptionPager - List of AvailabilitySets in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager // method. func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse] { @@ -357,7 +354,7 @@ func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *Availa } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx context.Context, options *AvailabilitySetsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *AvailabilitySetsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/availabilitySets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -368,7 +365,7 @@ func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +383,7 @@ func (client *AvailabilitySetsClient) listBySubscriptionHandleResponse(resp *htt // BeginUpdate - Updates the AvailabilitySets resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - properties - The resource properties to be updated. @@ -413,7 +410,7 @@ func (client *AvailabilitySetsClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates the AvailabilitySets resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *AvailabilitySetsClient) update(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, properties AvailabilitySetTagsUpdate, options *AvailabilitySetsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AvailabilitySetsClient.BeginUpdate" @@ -436,7 +433,7 @@ func (client *AvailabilitySetsClient) update(ctx context.Context, resourceGroupN } // updateCreateRequest creates the Update request. -func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, properties AvailabilitySetTagsUpdate, options *AvailabilitySetsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, properties AvailabilitySetTagsUpdate, _ *AvailabilitySetsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -455,7 +452,7 @@ func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go deleted file mode 100644 index de9ef8437cfa..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go +++ /dev/null @@ -1,488 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListBySubscriptionPager_availabilitySetsListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(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.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListBySubscriptionPager_availabilitySetsListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(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.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListByResourceGroupPager_availabilitySetsListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListByResourceGroupPager("rgscvmm", 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.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListByResourceGroupPager_availabilitySetsListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListByResourceGroupPager("rgscvmm", 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.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_Get_availabilitySetsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgscvmm", "-", 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.AvailabilitySet = armscvmm.AvailabilitySet{ - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_Get_availabilitySetsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgscvmm", "V", 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.AvailabilitySet = armscvmm.AvailabilitySet{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginCreateOrUpdate_availabilitySetsCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.AvailabilitySet{ - Location: to.Ptr("jelevilan"), - Tags: map[string]*string{ - "key5701": to.Ptr("cldtxloqh"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.AvailabilitySetProperties{ - AvailabilitySetName: to.Ptr("njrpftunzo"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, 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.AvailabilitySet = armscvmm.AvailabilitySet{ - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginCreateOrUpdate_availabilitySetsCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "_", armscvmm.AvailabilitySet{ - Location: to.Ptr("jelevilan"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, 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.AvailabilitySet = armscvmm.AvailabilitySet{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginUpdate_availabilitySetsUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginUpdate(ctx, "rgscvmm", "-", armscvmm.AvailabilitySetTagsUpdate{ - Tags: map[string]*string{ - "key1460": to.Ptr("vcbwibkvr"), - }, - }, 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.AvailabilitySet = armscvmm.AvailabilitySet{ - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginUpdate_availabilitySetsUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginUpdate(ctx, "rgscvmm", "1", armscvmm.AvailabilitySetTagsUpdate{}, 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.AvailabilitySet = armscvmm.AvailabilitySet{ - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginDelete_availabilitySetsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginDelete(ctx, "rgscvmm", "_", &armscvmm.AvailabilitySetsClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginDelete_availabilitySetsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginDelete(ctx, "rgscvmm", "6", &armscvmm.AvailabilitySetsClientBeginDeleteOptions{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) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/client_factory.go b/sdk/resourcemanager/scvmm/armscvmm/client_factory.go index 09d6b51885d0..f3376127ef61 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/client_factory.go +++ b/sdk/resourcemanager/scvmm/armscvmm/client_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go b/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go index defd671ed809..24cfdf0ccb69 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewCloudsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Onboards the ScVmm fabric cloud as an Azure cloud resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - resource - Resource create parameters. @@ -73,7 +70,7 @@ func (client *CloudsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Onboards the ScVmm fabric cloud as an Azure cloud resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *CloudsClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudResourceName string, resource Cloud, options *CloudsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudsClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *CloudsClient) createOrUpdate(ctx context.Context, resourceGroupNam } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *CloudsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudResourceName string, resource Cloud, options *CloudsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *CloudsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudResourceName string, resource Cloud, _ *CloudsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +112,7 @@ func (client *CloudsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +124,7 @@ func (client *CloudsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deregisters the ScVmm fabric cloud from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - options - CloudsClientBeginDeleteOptions contains the optional parameters for the CloudsClient.BeginDelete method. @@ -152,7 +149,7 @@ func (client *CloudsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deregisters the ScVmm fabric cloud from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *CloudsClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudResourceName string, options *CloudsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudsClient.BeginDelete" @@ -194,7 +191,7 @@ func (client *CloudsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -206,7 +203,7 @@ func (client *CloudsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Implements Cloud GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - options - CloudsClientGetOptions contains the optional parameters for the CloudsClient.Get method. @@ -233,7 +230,7 @@ func (client *CloudsClient) Get(ctx context.Context, resourceGroupName string, c } // getCreateRequest creates the Get request. -func (client *CloudsClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudResourceName string, options *CloudsClientGetOptions) (*policy.Request, error) { +func (client *CloudsClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudResourceName string, _ *CloudsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -252,7 +249,7 @@ func (client *CloudsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +266,7 @@ func (client *CloudsClient) getHandleResponse(resp *http.Response) (CloudsClient // NewListByResourceGroupPager - List of Clouds in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CloudsClientListByResourceGroupOptions contains the optional parameters for the CloudsClient.NewListByResourceGroupPager // method. @@ -297,7 +294,7 @@ func (client *CloudsClient) NewListByResourceGroupPager(resourceGroupName string } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *CloudsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CloudsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *CloudsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *CloudsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -312,7 +309,7 @@ func (client *CloudsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +326,7 @@ func (client *CloudsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - List of Clouds in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - options - CloudsClientListBySubscriptionOptions contains the optional parameters for the CloudsClient.NewListBySubscriptionPager // method. func (client *CloudsClient) NewListBySubscriptionPager(options *CloudsClientListBySubscriptionOptions) *runtime.Pager[CloudsClientListBySubscriptionResponse] { @@ -356,7 +353,7 @@ func (client *CloudsClient) NewListBySubscriptionPager(options *CloudsClientList } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *CloudsClient) listBySubscriptionCreateRequest(ctx context.Context, options *CloudsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *CloudsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *CloudsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/clouds" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -367,7 +364,7 @@ func (client *CloudsClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +382,7 @@ func (client *CloudsClient) listBySubscriptionHandleResponse(resp *http.Response // BeginUpdate - Updates the Clouds resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - properties - The resource properties to be updated. @@ -411,7 +408,7 @@ func (client *CloudsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates the Clouds resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *CloudsClient) update(ctx context.Context, resourceGroupName string, cloudResourceName string, properties CloudTagsUpdate, options *CloudsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudsClient.BeginUpdate" @@ -434,7 +431,7 @@ func (client *CloudsClient) update(ctx context.Context, resourceGroupName string } // updateCreateRequest creates the Update request. -func (client *CloudsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudResourceName string, properties CloudTagsUpdate, options *CloudsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *CloudsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudResourceName string, properties CloudTagsUpdate, _ *CloudsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/clouds/{cloudResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -453,7 +450,7 @@ func (client *CloudsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go deleted file mode 100644 index 13b1ecee71db..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go +++ /dev/null @@ -1,570 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MaximumSet_Gen.json -func ExampleCloudsClient_NewListBySubscriptionPager_cloudsListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListBySubscriptionPager(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.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MinimumSet_Gen.json -func ExampleCloudsClient_NewListBySubscriptionPager_cloudsListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListBySubscriptionPager(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.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MaximumSet_Gen.json -func ExampleCloudsClient_NewListByResourceGroupPager_cloudsListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListByResourceGroupPager("rgscvmm", 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.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MinimumSet_Gen.json -func ExampleCloudsClient_NewListByResourceGroupPager_cloudsListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListByResourceGroupPager("rgscvmm", 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.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json -func ExampleCloudsClient_Get_cloudsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudsClient().Get(ctx, "rgscvmm", "_", 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.Cloud = armscvmm.Cloud{ - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MinimumSet_Gen.json -func ExampleCloudsClient_Get_cloudsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudsClient().Get(ctx, "rgscvmm", "i", 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.Cloud = armscvmm.Cloud{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MaximumSet_Gen.json -func ExampleCloudsClient_BeginCreateOrUpdate_cloudsCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "2", armscvmm.Cloud{ - Location: to.Ptr("khwsdmaxfhmbu"), - Tags: map[string]*string{ - "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.CloudProperties{ - CloudCapacity: &armscvmm.CloudCapacity{}, - InventoryItemID: to.Ptr("qjd"), - UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, 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.Cloud = armscvmm.Cloud{ - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MinimumSet_Gen.json -func ExampleCloudsClient_BeginCreateOrUpdate_cloudsCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.Cloud{ - Location: to.Ptr("khwsdmaxfhmbu"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, 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.Cloud = armscvmm.Cloud{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json -func ExampleCloudsClient_BeginUpdate_cloudsUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginUpdate(ctx, "rgscvmm", "P", armscvmm.CloudTagsUpdate{ - Tags: map[string]*string{ - "key5266": to.Ptr("hjpcnwmpnixsolrxnbl"), - }, - }, 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.Cloud = armscvmm.Cloud{ - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MinimumSet_Gen.json -func ExampleCloudsClient_BeginUpdate_cloudsUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginUpdate(ctx, "rgscvmm", "_", armscvmm.CloudTagsUpdate{}, 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.Cloud = armscvmm.Cloud{ - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json -func ExampleCloudsClient_BeginDelete_cloudsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginDelete(ctx, "rgscvmm", "-", &armscvmm.CloudsClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MinimumSet_Gen.json -func ExampleCloudsClient_BeginDelete_cloudsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginDelete(ctx, "rgscvmm", "1", &armscvmm.CloudsClientBeginDeleteOptions{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) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/constants.go b/sdk/resourcemanager/scvmm/armscvmm/constants.go index 7c68e179fa2f..191ce77a8684 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/constants.go +++ b/sdk/resourcemanager/scvmm/armscvmm/constants.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,7 +7,7 @@ package armscvmm const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/availabilitysets_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/availabilitysets_server.go index a3357a05ca99..8371d01815d5 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/availabilitysets_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/availabilitysets_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" @@ -29,7 +26,7 @@ type AvailabilitySetsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, resource armscvmm.AvailabilitySet, options *armscvmm.AvailabilitySetsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armscvmm.AvailabilitySetsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method AvailabilitySetsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, options *armscvmm.AvailabilitySetsClientBeginDeleteOptions) (resp azfake.PollerResponder[armscvmm.AvailabilitySetsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method AvailabilitySetsClient.Get @@ -82,31 +79,50 @@ func (a *AvailabilitySetsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AvailabilitySetsClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "AvailabilitySetsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AvailabilitySetsClient.Get": - resp, err = a.dispatchGet(req) - case "AvailabilitySetsClient.NewListByResourceGroupPager": - resp, err = a.dispatchNewListByResourceGroupPager(req) - case "AvailabilitySetsClient.NewListBySubscriptionPager": - resp, err = a.dispatchNewListBySubscriptionPager(req) - case "AvailabilitySetsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AvailabilitySetsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if availabilitySetsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = availabilitySetsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AvailabilitySetsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AvailabilitySetsClient.BeginDelete": + res.resp, res.err = a.dispatchBeginDelete(req) + case "AvailabilitySetsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AvailabilitySetsClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + case "AvailabilitySetsClient.NewListBySubscriptionPager": + res.resp, res.err = a.dispatchNewListBySubscriptionPager(req) + case "AvailabilitySetsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AvailabilitySetsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -202,9 +218,9 @@ func (a *AvailabilitySetsServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { a.beginDelete.remove(req) @@ -363,3 +379,9 @@ func (a *AvailabilitySetsServerTransport) dispatchBeginUpdate(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to AvailabilitySetsServerTransport +var availabilitySetsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/clouds_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/clouds_server.go index e5bb28aaa5d6..5db2dd62499a 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/clouds_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/clouds_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" @@ -29,7 +26,7 @@ type CloudsServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, cloudResourceName string, resource armscvmm.Cloud, options *armscvmm.CloudsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armscvmm.CloudsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method CloudsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, cloudResourceName string, options *armscvmm.CloudsClientBeginDeleteOptions) (resp azfake.PollerResponder[armscvmm.CloudsClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method CloudsClient.Get @@ -82,31 +79,50 @@ func (c *CloudsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CloudsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "CloudsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "CloudsClient.Get": - resp, err = c.dispatchGet(req) - case "CloudsClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "CloudsClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - case "CloudsClient.BeginUpdate": - resp, err = c.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CloudsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if cloudsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = cloudsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CloudsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "CloudsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "CloudsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CloudsClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "CloudsClient.NewListBySubscriptionPager": + res.resp, res.err = c.dispatchNewListBySubscriptionPager(req) + case "CloudsClient.BeginUpdate": + res.resp, res.err = c.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CloudsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -202,9 +218,9 @@ func (c *CloudsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { c.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { c.beginDelete.remove(req) @@ -363,3 +379,9 @@ func (c *CloudsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re return resp, nil } + +// set this to conditionally intercept incoming requests to CloudsServerTransport +var cloudsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/guestagents_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/guestagents_server.go index 1d9302b83e5b..0ad7c09db780 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/guestagents_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/guestagents_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" @@ -68,27 +65,46 @@ func (g *GuestAgentsServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GuestAgentsClient.BeginCreate": - resp, err = g.dispatchBeginCreate(req) - case "GuestAgentsClient.Delete": - resp, err = g.dispatchDelete(req) - case "GuestAgentsClient.Get": - resp, err = g.dispatchGet(req) - case "GuestAgentsClient.NewListByVirtualMachineInstancePager": - resp, err = g.dispatchNewListByVirtualMachineInstancePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GuestAgentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if guestAgentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = guestAgentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GuestAgentsClient.BeginCreate": + res.resp, res.err = g.dispatchBeginCreate(req) + case "GuestAgentsClient.Delete": + res.resp, res.err = g.dispatchDelete(req) + case "GuestAgentsClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GuestAgentsClient.NewListByVirtualMachineInstancePager": + res.resp, res.err = g.dispatchNewListByVirtualMachineInstancePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GuestAgentsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { @@ -229,3 +245,9 @@ func (g *GuestAgentsServerTransport) dispatchNewListByVirtualMachineInstancePage } return resp, nil } + +// set this to conditionally intercept incoming requests to GuestAgentsServerTransport +var guestAgentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/internal.go b/sdk/resourcemanager/scvmm/armscvmm/fake/internal.go index 94e060e89dbd..486a30a014e6 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/internal.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/internal.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,6 +12,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/inventoryitems_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/inventoryitems_server.go index f8df37d81ce9..3e49e5f8a631 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/inventoryitems_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/inventoryitems_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" @@ -66,27 +63,46 @@ func (i *InventoryItemsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "InventoryItemsClient.Create": - resp, err = i.dispatchCreate(req) - case "InventoryItemsClient.Delete": - resp, err = i.dispatchDelete(req) - case "InventoryItemsClient.Get": - resp, err = i.dispatchGet(req) - case "InventoryItemsClient.NewListByVmmServerPager": - resp, err = i.dispatchNewListByVmmServerPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *InventoryItemsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if inventoryItemsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = inventoryItemsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InventoryItemsClient.Create": + res.resp, res.err = i.dispatchCreate(req) + case "InventoryItemsClient.Delete": + res.resp, res.err = i.dispatchDelete(req) + case "InventoryItemsClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "InventoryItemsClient.NewListByVmmServerPager": + res.resp, res.err = i.dispatchNewListByVmmServerPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *InventoryItemsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -244,3 +260,9 @@ func (i *InventoryItemsServerTransport) dispatchNewListByVmmServerPager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to InventoryItemsServerTransport +var inventoryItemsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/operations_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/operations_server.go index 477592a51cf1..91799cec2644 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/operations_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/operations_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -15,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" ) @@ -51,21 +48,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/server_factory.go b/sdk/resourcemanager/scvmm/armscvmm/fake/server_factory.go index df22ef4394fd..1319322a859b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/server_factory.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/server_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -19,16 +16,35 @@ import ( // ServerFactory is a fake server for instances of the armscvmm.ClientFactory type. type ServerFactory struct { - AvailabilitySetsServer AvailabilitySetsServer - CloudsServer CloudsServer - GuestAgentsServer GuestAgentsServer - InventoryItemsServer InventoryItemsServer - OperationsServer OperationsServer + // AvailabilitySetsServer contains the fakes for client AvailabilitySetsClient + AvailabilitySetsServer AvailabilitySetsServer + + // CloudsServer contains the fakes for client CloudsClient + CloudsServer CloudsServer + + // GuestAgentsServer contains the fakes for client GuestAgentsClient + GuestAgentsServer GuestAgentsServer + + // InventoryItemsServer contains the fakes for client InventoryItemsClient + InventoryItemsServer InventoryItemsServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // VMInstanceHybridIdentityMetadatasServer contains the fakes for client VMInstanceHybridIdentityMetadatasClient VMInstanceHybridIdentityMetadatasServer VMInstanceHybridIdentityMetadatasServer - VirtualMachineInstancesServer VirtualMachineInstancesServer - VirtualMachineTemplatesServer VirtualMachineTemplatesServer - VirtualNetworksServer VirtualNetworksServer - VmmServersServer VmmServersServer + + // VirtualMachineInstancesServer contains the fakes for client VirtualMachineInstancesClient + VirtualMachineInstancesServer VirtualMachineInstancesServer + + // VirtualMachineTemplatesServer contains the fakes for client VirtualMachineTemplatesClient + VirtualMachineTemplatesServer VirtualMachineTemplatesServer + + // VirtualNetworksServer contains the fakes for client VirtualNetworksClient + VirtualNetworksServer VirtualNetworksServer + + // VmmServersServer contains the fakes for client VmmServersClient + VmmServersServer VmmServersServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/time_rfc3339.go b/sdk/resourcemanager/scvmm/armscvmm/fake/time_rfc3339.go index 81f308b0d343..7691a451714b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/time_rfc3339.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/time_rfc3339.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachineinstances_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachineinstances_server.go index eabd181b08ba..b7f61db5f358 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachineinstances_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachineinstances_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,16 +13,17 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" + "reflect" "regexp" ) // VirtualMachineInstancesServer is a fake server for instances of the armscvmm.VirtualMachineInstancesClient type. type VirtualMachineInstancesServer struct { // BeginCreateCheckpoint is the fake for method VirtualMachineInstancesClient.BeginCreateCheckpoint - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginCreateCheckpoint func(ctx context.Context, resourceURI string, body armscvmm.VirtualMachineCreateCheckpoint, options *armscvmm.VirtualMachineInstancesClientBeginCreateCheckpointOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientCreateCheckpointResponse], errResp azfake.ErrorResponder) // BeginCreateOrUpdate is the fake for method VirtualMachineInstancesClient.BeginCreateOrUpdate @@ -33,11 +31,11 @@ type VirtualMachineInstancesServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceURI string, resource armscvmm.VirtualMachineInstance, options *armscvmm.VirtualMachineInstancesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VirtualMachineInstancesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceURI string, options *armscvmm.VirtualMachineInstancesClientBeginDeleteOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientDeleteResponse], errResp azfake.ErrorResponder) // BeginDeleteCheckpoint is the fake for method VirtualMachineInstancesClient.BeginDeleteCheckpoint - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDeleteCheckpoint func(ctx context.Context, resourceURI string, body armscvmm.VirtualMachineDeleteCheckpoint, options *armscvmm.VirtualMachineInstancesClientBeginDeleteCheckpointOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientDeleteCheckpointResponse], errResp azfake.ErrorResponder) // Get is the fake for method VirtualMachineInstancesClient.Get @@ -49,20 +47,20 @@ type VirtualMachineInstancesServer struct { NewListPager func(resourceURI string, options *armscvmm.VirtualMachineInstancesClientListOptions) (resp azfake.PagerResponder[armscvmm.VirtualMachineInstancesClientListResponse]) // BeginRestart is the fake for method VirtualMachineInstancesClient.BeginRestart - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestart func(ctx context.Context, resourceURI string, options *armscvmm.VirtualMachineInstancesClientBeginRestartOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientRestartResponse], errResp azfake.ErrorResponder) // BeginRestoreCheckpoint is the fake for method VirtualMachineInstancesClient.BeginRestoreCheckpoint - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginRestoreCheckpoint func(ctx context.Context, resourceURI string, body armscvmm.VirtualMachineRestoreCheckpoint, options *armscvmm.VirtualMachineInstancesClientBeginRestoreCheckpointOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientRestoreCheckpointResponse], errResp azfake.ErrorResponder) // BeginStart is the fake for method VirtualMachineInstancesClient.BeginStart - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStart func(ctx context.Context, resourceURI string, options *armscvmm.VirtualMachineInstancesClientBeginStartOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientStartResponse], errResp azfake.ErrorResponder) // BeginStop is the fake for method VirtualMachineInstancesClient.BeginStop - // HTTP status codes to indicate success: http.StatusAccepted - BeginStop func(ctx context.Context, resourceURI string, body armscvmm.StopVirtualMachineOptions, options *armscvmm.VirtualMachineInstancesClientBeginStopOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientStopResponse], errResp azfake.ErrorResponder) + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginStop func(ctx context.Context, resourceURI string, options *armscvmm.VirtualMachineInstancesClientBeginStopOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientStopResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method VirtualMachineInstancesClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted @@ -112,41 +110,60 @@ func (v *VirtualMachineInstancesServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "VirtualMachineInstancesClient.BeginCreateCheckpoint": - resp, err = v.dispatchBeginCreateCheckpoint(req) - case "VirtualMachineInstancesClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualMachineInstancesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualMachineInstancesClient.BeginDeleteCheckpoint": - resp, err = v.dispatchBeginDeleteCheckpoint(req) - case "VirtualMachineInstancesClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualMachineInstancesClient.NewListPager": - resp, err = v.dispatchNewListPager(req) - case "VirtualMachineInstancesClient.BeginRestart": - resp, err = v.dispatchBeginRestart(req) - case "VirtualMachineInstancesClient.BeginRestoreCheckpoint": - resp, err = v.dispatchBeginRestoreCheckpoint(req) - case "VirtualMachineInstancesClient.BeginStart": - resp, err = v.dispatchBeginStart(req) - case "VirtualMachineInstancesClient.BeginStop": - resp, err = v.dispatchBeginStop(req) - case "VirtualMachineInstancesClient.BeginUpdate": - resp, err = v.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return v.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (v *VirtualMachineInstancesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if virtualMachineInstancesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualMachineInstancesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualMachineInstancesClient.BeginCreateCheckpoint": + res.resp, res.err = v.dispatchBeginCreateCheckpoint(req) + case "VirtualMachineInstancesClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualMachineInstancesClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualMachineInstancesClient.BeginDeleteCheckpoint": + res.resp, res.err = v.dispatchBeginDeleteCheckpoint(req) + case "VirtualMachineInstancesClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualMachineInstancesClient.NewListPager": + res.resp, res.err = v.dispatchNewListPager(req) + case "VirtualMachineInstancesClient.BeginRestart": + res.resp, res.err = v.dispatchBeginRestart(req) + case "VirtualMachineInstancesClient.BeginRestoreCheckpoint": + res.resp, res.err = v.dispatchBeginRestoreCheckpoint(req) + case "VirtualMachineInstancesClient.BeginStart": + res.resp, res.err = v.dispatchBeginStart(req) + case "VirtualMachineInstancesClient.BeginStop": + res.resp, res.err = v.dispatchBeginStop(req) + case "VirtualMachineInstancesClient.BeginUpdate": + res.resp, res.err = v.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualMachineInstancesServerTransport) dispatchBeginCreateCheckpoint(req *http.Request) (*http.Response, error) { @@ -182,9 +199,9 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginCreateCheckpoint(r return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginCreateCheckpoint.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginCreateCheckpoint) { v.beginCreateCheckpoint.remove(req) @@ -284,9 +301,9 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginDelete(req *http.R return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { v.beginDelete.remove(req) @@ -328,9 +345,9 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginDeleteCheckpoint(r return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDeleteCheckpoint.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDeleteCheckpoint) { v.beginDeleteCheckpoint.remove(req) @@ -434,9 +451,9 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginRestart(req *http. return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginRestart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestart) { v.beginRestart.remove(req) @@ -478,9 +495,9 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginRestoreCheckpoint( return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginRestoreCheckpoint.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginRestoreCheckpoint) { v.beginRestoreCheckpoint.remove(req) @@ -518,9 +535,9 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginStart(req *http.Re return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginStart.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStart) { v.beginStart.remove(req) @@ -549,7 +566,13 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginStop(req *http.Req if err != nil { return nil, err } - respr, errRespr := v.srv.BeginStop(req.Context(), resourceURIParam, body, nil) + var options *armscvmm.VirtualMachineInstancesClientBeginStopOptions + if !reflect.ValueOf(body).IsZero() { + options = &armscvmm.VirtualMachineInstancesClientBeginStopOptions{ + Body: &body, + } + } + respr, errRespr := v.srv.BeginStop(req.Context(), resourceURIParam, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -562,9 +585,9 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginStop(req *http.Req return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginStop.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStop) { v.beginStop.remove(req) @@ -616,3 +639,9 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginUpdate(req *http.R return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualMachineInstancesServerTransport +var virtualMachineInstancesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachinetemplates_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachinetemplates_server.go index 9a4308e8cbc8..796cfdb9977b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachinetemplates_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachinetemplates_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" @@ -29,7 +26,7 @@ type VirtualMachineTemplatesServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, resource armscvmm.VirtualMachineTemplate, options *armscvmm.VirtualMachineTemplatesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineTemplatesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VirtualMachineTemplatesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, options *armscvmm.VirtualMachineTemplatesClientBeginDeleteOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineTemplatesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method VirtualMachineTemplatesClient.Get @@ -82,31 +79,50 @@ func (v *VirtualMachineTemplatesServerTransport) Do(req *http.Request) (*http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualMachineTemplatesClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualMachineTemplatesClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualMachineTemplatesClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualMachineTemplatesClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VirtualMachineTemplatesClient.NewListBySubscriptionPager": - resp, err = v.dispatchNewListBySubscriptionPager(req) - case "VirtualMachineTemplatesClient.BeginUpdate": - resp, err = v.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualMachineTemplatesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualMachineTemplatesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualMachineTemplatesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualMachineTemplatesClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualMachineTemplatesClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualMachineTemplatesClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualMachineTemplatesClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VirtualMachineTemplatesClient.NewListBySubscriptionPager": + res.resp, res.err = v.dispatchNewListBySubscriptionPager(req) + case "VirtualMachineTemplatesClient.BeginUpdate": + res.resp, res.err = v.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualMachineTemplatesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -202,9 +218,9 @@ func (v *VirtualMachineTemplatesServerTransport) dispatchBeginDelete(req *http.R return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { v.beginDelete.remove(req) @@ -363,3 +379,9 @@ func (v *VirtualMachineTemplatesServerTransport) dispatchBeginUpdate(req *http.R return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualMachineTemplatesServerTransport +var virtualMachineTemplatesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualnetworks_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualnetworks_server.go index 33c8a6cb93c1..d5cf64ee8b3d 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualnetworks_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualnetworks_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" @@ -29,7 +26,7 @@ type VirtualNetworksServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, virtualNetworkName string, resource armscvmm.VirtualNetwork, options *armscvmm.VirtualNetworksClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armscvmm.VirtualNetworksClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VirtualNetworksClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *armscvmm.VirtualNetworksClientBeginDeleteOptions) (resp azfake.PollerResponder[armscvmm.VirtualNetworksClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method VirtualNetworksClient.Get @@ -82,31 +79,50 @@ func (v *VirtualNetworksServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VirtualNetworksClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VirtualNetworksClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VirtualNetworksClient.Get": - resp, err = v.dispatchGet(req) - case "VirtualNetworksClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VirtualNetworksClient.NewListBySubscriptionPager": - resp, err = v.dispatchNewListBySubscriptionPager(req) - case "VirtualNetworksClient.BeginUpdate": - resp, err = v.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VirtualNetworksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if virtualNetworksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = virtualNetworksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VirtualNetworksClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VirtualNetworksClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VirtualNetworksClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VirtualNetworksClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VirtualNetworksClient.NewListBySubscriptionPager": + res.resp, res.err = v.dispatchNewListBySubscriptionPager(req) + case "VirtualNetworksClient.BeginUpdate": + res.resp, res.err = v.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VirtualNetworksServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -202,9 +218,9 @@ func (v *VirtualNetworksServerTransport) dispatchBeginDelete(req *http.Request) return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { v.beginDelete.remove(req) @@ -363,3 +379,9 @@ func (v *VirtualNetworksServerTransport) dispatchBeginUpdate(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to VirtualNetworksServerTransport +var virtualNetworksServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/vminstancehybrididentitymetadatas_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/vminstancehybrididentitymetadatas_server.go index 5b8d55a3702d..ce0bad20a16d 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/vminstancehybrididentitymetadatas_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/vminstancehybrididentitymetadatas_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" @@ -58,23 +55,42 @@ func (v *VMInstanceHybridIdentityMetadatasServerTransport) Do(req *http.Request) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VMInstanceHybridIdentityMetadatasClient.Get": - resp, err = v.dispatchGet(req) - case "VMInstanceHybridIdentityMetadatasClient.NewListByVirtualMachineInstancePager": - resp, err = v.dispatchNewListByVirtualMachineInstancePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VMInstanceHybridIdentityMetadatasServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vmInstanceHybridIdentityMetadatasServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vmInstanceHybridIdentityMetadatasServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VMInstanceHybridIdentityMetadatasClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VMInstanceHybridIdentityMetadatasClient.NewListByVirtualMachineInstancePager": + res.resp, res.err = v.dispatchNewListByVirtualMachineInstancePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VMInstanceHybridIdentityMetadatasServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -142,3 +158,9 @@ func (v *VMInstanceHybridIdentityMetadatasServerTransport) dispatchNewListByVirt } return resp, nil } + +// set this to conditionally intercept incoming requests to VMInstanceHybridIdentityMetadatasServerTransport +var vmInstanceHybridIdentityMetadatasServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/vmmservers_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/vmmservers_server.go index 1f21f887f115..a5472dad1a6f 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/vmmservers_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/vmmservers_server.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -16,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" @@ -29,7 +26,7 @@ type VmmServersServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, vmmServerName string, resource armscvmm.VmmServer, options *armscvmm.VmmServersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armscvmm.VmmServersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method VmmServersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, vmmServerName string, options *armscvmm.VmmServersClientBeginDeleteOptions) (resp azfake.PollerResponder[armscvmm.VmmServersClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method VmmServersClient.Get @@ -82,31 +79,50 @@ func (v *VmmServersServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return v.dispatchToMethodFake(req, method) +} - switch method { - case "VmmServersClient.BeginCreateOrUpdate": - resp, err = v.dispatchBeginCreateOrUpdate(req) - case "VmmServersClient.BeginDelete": - resp, err = v.dispatchBeginDelete(req) - case "VmmServersClient.Get": - resp, err = v.dispatchGet(req) - case "VmmServersClient.NewListByResourceGroupPager": - resp, err = v.dispatchNewListByResourceGroupPager(req) - case "VmmServersClient.NewListBySubscriptionPager": - resp, err = v.dispatchNewListBySubscriptionPager(req) - case "VmmServersClient.BeginUpdate": - resp, err = v.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (v *VmmServersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if vmmServersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = vmmServersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "VmmServersClient.BeginCreateOrUpdate": + res.resp, res.err = v.dispatchBeginCreateOrUpdate(req) + case "VmmServersClient.BeginDelete": + res.resp, res.err = v.dispatchBeginDelete(req) + case "VmmServersClient.Get": + res.resp, res.err = v.dispatchGet(req) + case "VmmServersClient.NewListByResourceGroupPager": + res.resp, res.err = v.dispatchNewListByResourceGroupPager(req) + case "VmmServersClient.NewListBySubscriptionPager": + res.resp, res.err = v.dispatchNewListBySubscriptionPager(req) + case "VmmServersClient.BeginUpdate": + res.resp, res.err = v.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (v *VmmServersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -202,9 +218,9 @@ func (v *VmmServersServerTransport) dispatchBeginDelete(req *http.Request) (*htt return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { v.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { v.beginDelete.remove(req) @@ -363,3 +379,9 @@ func (v *VmmServersServerTransport) dispatchBeginUpdate(req *http.Request) (*htt return resp, nil } + +// set this to conditionally intercept incoming requests to VmmServersServerTransport +var vmmServersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/scvmm/armscvmm/go.mod b/sdk/resourcemanager/scvmm/armscvmm/go.mod index 5c99d79ad3b3..16705f92dcd7 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/go.mod +++ b/sdk/resourcemanager/scvmm/armscvmm/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2 go 1.23.0 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.36.0 // indirect golang.org/x/net v0.37.0 // indirect - golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 // indirect ) diff --git a/sdk/resourcemanager/scvmm/armscvmm/go.sum b/sdk/resourcemanager/scvmm/armscvmm/go.sum index 811025f6d57f..cfff861c9769 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/go.sum +++ b/sdk/resourcemanager/scvmm/armscvmm/go.sum @@ -1,44 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 h1:DSDNVxqkoXJiko6x8a90zidoYqnYYa6c1MTzDKzKkTo= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1/go.mod h1:zGqV2R4Cr/k8Uye5w+dgQ06WJtEcbQG/8J7BB6hnCr4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1 h1:8BKxhZZLX/WosEeoCvWysmKUscfa9v8LIPEEU0JjE2o= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= -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-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= -github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go b/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go index abaabf3a1784..ecb7e40fd9a8 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -41,7 +38,7 @@ func NewGuestAgentsClient(credential azcore.TokenCredential, options *arm.Client // BeginCreate - Create Or Update GuestAgent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - resource - Resource create parameters. // - options - GuestAgentsClientBeginCreateOptions contains the optional parameters for the GuestAgentsClient.BeginCreate method. @@ -66,7 +63,7 @@ func (client *GuestAgentsClient) BeginCreate(ctx context.Context, resourceURI st // Create - Create Or Update GuestAgent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *GuestAgentsClient) create(ctx context.Context, resourceURI string, resource GuestAgent, options *GuestAgentsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "GuestAgentsClient.BeginCreate" @@ -89,7 +86,7 @@ func (client *GuestAgentsClient) create(ctx context.Context, resourceURI string, } // createCreateRequest creates the Create request. -func (client *GuestAgentsClient) createCreateRequest(ctx context.Context, resourceURI string, resource GuestAgent, options *GuestAgentsClientBeginCreateOptions) (*policy.Request, error) { +func (client *GuestAgentsClient) createCreateRequest(ctx context.Context, resourceURI string, resource GuestAgent, _ *GuestAgentsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -97,7 +94,7 @@ func (client *GuestAgentsClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -109,7 +106,7 @@ func (client *GuestAgentsClient) createCreateRequest(ctx context.Context, resour // Delete - Implements GuestAgent DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - GuestAgentsClientDeleteOptions contains the optional parameters for the GuestAgentsClient.Delete method. func (client *GuestAgentsClient) Delete(ctx context.Context, resourceURI string, options *GuestAgentsClientDeleteOptions) (GuestAgentsClientDeleteResponse, error) { @@ -134,7 +131,7 @@ func (client *GuestAgentsClient) Delete(ctx context.Context, resourceURI string, } // deleteCreateRequest creates the Delete request. -func (client *GuestAgentsClient) deleteCreateRequest(ctx context.Context, resourceURI string, options *GuestAgentsClientDeleteOptions) (*policy.Request, error) { +func (client *GuestAgentsClient) deleteCreateRequest(ctx context.Context, resourceURI string, _ *GuestAgentsClientDeleteOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -142,7 +139,7 @@ func (client *GuestAgentsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -151,7 +148,7 @@ func (client *GuestAgentsClient) deleteCreateRequest(ctx context.Context, resour // Get - Implements GuestAgent GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - GuestAgentsClientGetOptions contains the optional parameters for the GuestAgentsClient.Get method. func (client *GuestAgentsClient) Get(ctx context.Context, resourceURI string, options *GuestAgentsClientGetOptions) (GuestAgentsClientGetResponse, error) { @@ -177,7 +174,7 @@ func (client *GuestAgentsClient) Get(ctx context.Context, resourceURI string, op } // getCreateRequest creates the Get request. -func (client *GuestAgentsClient) getCreateRequest(ctx context.Context, resourceURI string, options *GuestAgentsClientGetOptions) (*policy.Request, error) { +func (client *GuestAgentsClient) getCreateRequest(ctx context.Context, resourceURI string, _ *GuestAgentsClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -185,7 +182,7 @@ func (client *GuestAgentsClient) getCreateRequest(ctx context.Context, resourceU return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +199,7 @@ func (client *GuestAgentsClient) getHandleResponse(resp *http.Response) (GuestAg // NewListByVirtualMachineInstancePager - Returns the list of GuestAgent of the given vm. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - GuestAgentsClientListByVirtualMachineInstanceOptions contains the optional parameters for the GuestAgentsClient.NewListByVirtualMachineInstancePager // method. @@ -230,7 +227,7 @@ func (client *GuestAgentsClient) NewListByVirtualMachineInstancePager(resourceUR } // listByVirtualMachineInstanceCreateRequest creates the ListByVirtualMachineInstance request. -func (client *GuestAgentsClient) listByVirtualMachineInstanceCreateRequest(ctx context.Context, resourceURI string, options *GuestAgentsClientListByVirtualMachineInstanceOptions) (*policy.Request, error) { +func (client *GuestAgentsClient) listByVirtualMachineInstanceCreateRequest(ctx context.Context, resourceURI string, _ *GuestAgentsClientListByVirtualMachineInstanceOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -238,7 +235,7 @@ func (client *GuestAgentsClient) listByVirtualMachineInstanceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go deleted file mode 100644 index 0ea7db384610..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go +++ /dev/null @@ -1,293 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MaximumSet_Gen.json -func ExampleGuestAgentsClient_NewListByVirtualMachineInstancePager_guestAgentsListByVirtualMachineInstanceMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGuestAgentsClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", 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.GuestAgentListResult = armscvmm.GuestAgentListResult{ - // Value: []*armscvmm.GuestAgent{ - // { - // Name: to.Ptr("rwecpthzyt"), - // Type: to.Ptr("dkcgcbtlwtsedxzhvtu"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.GuestAgentProperties{ - // Credentials: &armscvmm.GuestCredential{ - // Username: to.Ptr("jqxuwirrcpfv"), - // }, - // CustomResourceName: to.Ptr("mhqymxkapuvsugd"), - // HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - // HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - // }, - // ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // Status: to.Ptr("jpoukrzfenzrmjdahimkl"), - // UUID: to.Ptr("hbsgztyakewtgbuxbesezncnzu"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MinimumSet_Gen.json -func ExampleGuestAgentsClient_NewListByVirtualMachineInstancePager_guestAgentsListByVirtualMachineInstanceMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGuestAgentsClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", 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.GuestAgentListResult = armscvmm.GuestAgentListResult{ - // Value: []*armscvmm.GuestAgent{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MaximumSet_Gen.json -func ExampleGuestAgentsClient_Get_guestAgentsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGuestAgentsClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.GuestAgent{ - // Name: to.Ptr("rwecpthzyt"), - // Type: to.Ptr("dkcgcbtlwtsedxzhvtu"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.GuestAgentProperties{ - // Credentials: &armscvmm.GuestCredential{ - // Username: to.Ptr("jqxuwirrcpfv"), - // }, - // CustomResourceName: to.Ptr("mhqymxkapuvsugd"), - // HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - // HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - // }, - // ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // Status: to.Ptr("jpoukrzfenzrmjdahimkl"), - // UUID: to.Ptr("hbsgztyakewtgbuxbesezncnzu"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MinimumSet_Gen.json -func ExampleGuestAgentsClient_Get_guestAgentsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGuestAgentsClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.GuestAgent{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MaximumSet_Gen.json -func ExampleGuestAgentsClient_BeginCreate_guestAgentsCreateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGuestAgentsClient().BeginCreate(ctx, "gtgclehcbsyave", armscvmm.GuestAgent{ - Properties: &armscvmm.GuestAgentProperties{ - Credentials: &armscvmm.GuestCredential{ - Password: to.Ptr("gkvbnmuahumuoibvscoxzfdqwvfuf"), - Username: to.Ptr("jqxuwirrcpfv"), - }, - HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - }, - ProvisioningAction: to.Ptr(armscvmm.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 = armscvmm.GuestAgent{ - // Name: to.Ptr("rwecpthzyt"), - // Type: to.Ptr("dkcgcbtlwtsedxzhvtu"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.GuestAgentProperties{ - // Credentials: &armscvmm.GuestCredential{ - // Username: to.Ptr("jqxuwirrcpfv"), - // }, - // CustomResourceName: to.Ptr("mhqymxkapuvsugd"), - // HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - // HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - // }, - // ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // Status: to.Ptr("jpoukrzfenzrmjdahimkl"), - // UUID: to.Ptr("hbsgztyakewtgbuxbesezncnzu"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MinimumSet_Gen.json -func ExampleGuestAgentsClient_BeginCreate_guestAgentsCreateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGuestAgentsClient().BeginCreate(ctx, "gtgclehcbsyave", armscvmm.GuestAgent{}, 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 = armscvmm.GuestAgent{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MaximumSet_Gen.json -func ExampleGuestAgentsClient_Delete_guestAgentsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGuestAgentsClient().Delete(ctx, "gtgclehcbsyave", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MinimumSet_Gen.json -func ExampleGuestAgentsClient_Delete_guestAgentsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGuestAgentsClient().Delete(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/interfaces.go b/sdk/resourcemanager/scvmm/armscvmm/interfaces.go index 963d33f39002..22346c1b8ff7 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/interfaces.go +++ b/sdk/resourcemanager/scvmm/armscvmm/interfaces.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go b/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go index 33d02089cc34..166a205c10fb 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewInventoryItemsClient(subscriptionID string, credential azcore.TokenCrede // Create - Create Or Update InventoryItem. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - inventoryItemResourceName - Name of the inventoryItem. @@ -75,7 +72,7 @@ func (client *InventoryItemsClient) Create(ctx context.Context, resourceGroupNam } // createCreateRequest creates the Create request. -func (client *InventoryItemsClient) createCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, inventoryItemResourceName string, resource InventoryItem, options *InventoryItemsClientCreateOptions) (*policy.Request, error) { +func (client *InventoryItemsClient) createCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, inventoryItemResourceName string, resource InventoryItem, _ *InventoryItemsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -98,7 +95,7 @@ func (client *InventoryItemsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -119,7 +116,7 @@ func (client *InventoryItemsClient) createHandleResponse(resp *http.Response) (I // Delete - Deletes an inventoryItem. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - inventoryItemResourceName - Name of the inventoryItem. @@ -146,7 +143,7 @@ func (client *InventoryItemsClient) Delete(ctx context.Context, resourceGroupNam } // deleteCreateRequest creates the Delete request. -func (client *InventoryItemsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, inventoryItemResourceName string, options *InventoryItemsClientDeleteOptions) (*policy.Request, error) { +func (client *InventoryItemsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, inventoryItemResourceName string, _ *InventoryItemsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -169,7 +166,7 @@ func (client *InventoryItemsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +175,7 @@ func (client *InventoryItemsClient) deleteCreateRequest(ctx context.Context, res // Get - Shows an inventory item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - inventoryItemResourceName - Name of the inventoryItem. @@ -206,7 +203,7 @@ func (client *InventoryItemsClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *InventoryItemsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, inventoryItemResourceName string, options *InventoryItemsClientGetOptions) (*policy.Request, error) { +func (client *InventoryItemsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, inventoryItemResourceName string, _ *InventoryItemsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/{inventoryItemResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -229,7 +226,7 @@ func (client *InventoryItemsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +243,7 @@ func (client *InventoryItemsClient) getHandleResponse(resp *http.Response) (Inve // NewListByVmmServerPager - Returns the list of inventoryItems in the given VmmServer. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - options - InventoryItemsClientListByVmmServerOptions contains the optional parameters for the InventoryItemsClient.NewListByVmmServerPager @@ -275,7 +272,7 @@ func (client *InventoryItemsClient) NewListByVmmServerPager(resourceGroupName st } // listByVmmServerCreateRequest creates the ListByVmmServer request. -func (client *InventoryItemsClient) listByVmmServerCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, options *InventoryItemsClientListByVmmServerOptions) (*policy.Request, error) { +func (client *InventoryItemsClient) listByVmmServerCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, _ *InventoryItemsClientListByVmmServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -294,7 +291,7 @@ func (client *InventoryItemsClient) listByVmmServerCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go deleted file mode 100644 index 72dfbef0933f..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go +++ /dev/null @@ -1,264 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MaximumSet_Gen.json -func ExampleInventoryItemsClient_NewListByVmmServerPager_inventoryItemsListByVmmServerMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInventoryItemsClient().NewListByVmmServerPager("rgscvmm", "X", 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.InventoryItemListResult = armscvmm.InventoryItemListResult{ - // Value: []*armscvmm.InventoryItem{ - // { - // Name: to.Ptr("oimmcgxagnhmasgsmhdaigznub"), - // Type: to.Ptr("lfhuayaplzxdqzubmjvtgcan"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Kind: to.Ptr("M\\d_,V."), - // Properties: &armscvmm.InventoryItemProperties{ - // InventoryItemName: to.Ptr("kspgdhmlmycalwrepfmshoaoumna"), - // InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - // ManagedResourceID: to.Ptr("ictxvjzvurnkdgwabqyyfyckkkdx"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("jolmoxfopwfoje"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MinimumSet_Gen.json -func ExampleInventoryItemsClient_NewListByVmmServerPager_inventoryItemsListByVmmServerMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInventoryItemsClient().NewListByVmmServerPager("rgscvmm", "H", 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.InventoryItemListResult = armscvmm.InventoryItemListResult{ - // Value: []*armscvmm.InventoryItem{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MaximumSet_Gen.json -func ExampleInventoryItemsClient_Get_inventoryItemsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Get(ctx, "rgscvmm", "1", "2bFBede6-EEf8-becB-dBbd-B96DbBFdB3f3", 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 = armscvmm.InventoryItem{ - // Name: to.Ptr("oimmcgxagnhmasgsmhdaigznub"), - // Type: to.Ptr("lfhuayaplzxdqzubmjvtgcan"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Kind: to.Ptr("M\\d_,V."), - // Properties: &armscvmm.InventoryItemProperties{ - // InventoryItemName: to.Ptr("kspgdhmlmycalwrepfmshoaoumna"), - // InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - // ManagedResourceID: to.Ptr("ictxvjzvurnkdgwabqyyfyckkkdx"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("jolmoxfopwfoje"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MinimumSet_Gen.json -func ExampleInventoryItemsClient_Get_inventoryItemsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Get(ctx, "rgscvmm", "_", "cacb8Ceb-efAC-bebb-ae7C-dec8C5Bb7100", 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 = armscvmm.InventoryItem{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MaximumSet_Gen.json -func ExampleInventoryItemsClient_Create_inventoryItemsCreateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Create(ctx, "rgscvmm", "O", "1BdDc2Ab-bDd9-Ebd6-bfdb-C0dbbdB5DEDf", armscvmm.InventoryItem{ - Kind: to.Ptr("M\\d_,V."), - Properties: &armscvmm.InventoryItemProperties{ - InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - }, - }, 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 = armscvmm.InventoryItem{ - // Name: to.Ptr("oimmcgxagnhmasgsmhdaigznub"), - // Type: to.Ptr("lfhuayaplzxdqzubmjvtgcan"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Kind: to.Ptr("M\\d_,V."), - // Properties: &armscvmm.InventoryItemProperties{ - // InventoryItemName: to.Ptr("kspgdhmlmycalwrepfmshoaoumna"), - // InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - // ManagedResourceID: to.Ptr("ictxvjzvurnkdgwabqyyfyckkkdx"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("jolmoxfopwfoje"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MinimumSet_Gen.json -func ExampleInventoryItemsClient_Create_inventoryItemsCreateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Create(ctx, "rgscvmm", ".", "bbFb0cBb-50ce-4bfc-3eeD-bC26AbCC257a", armscvmm.InventoryItem{}, 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 = armscvmm.InventoryItem{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MaximumSet_Gen.json -func ExampleInventoryItemsClient_Delete_inventoryItemsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewInventoryItemsClient().Delete(ctx, "rgscvmm", "b", "EcECadfd-Eaaa-e5Ce-ebdA-badeEd3c6af1", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MinimumSet_Gen.json -func ExampleInventoryItemsClient_Delete_inventoryItemsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewInventoryItemsClient().Delete(ctx, "rgscvmm", "_", "cDBcbae6-BC3d-52fe-CedC-7eFeaBFabb82", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/models.go b/sdk/resourcemanager/scvmm/armscvmm/models.go index 954137ee3c26..41881898f5d5 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/models.go +++ b/sdk/resourcemanager/scvmm/armscvmm/models.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -123,6 +120,9 @@ type CloudCapacity struct { // READ-ONLY; MemoryMB specifies a memory usage limit in megabytes. MemoryMB *int64 + // READ-ONLY; StorageGB gives the storage in GB present in the cloud. + StorageGB *int64 + // READ-ONLY; VMCount gives the max number of VMs that can be deployed in the cloud. VMCount *int64 } @@ -239,6 +239,9 @@ type GuestAgentProperties struct { // HTTP Proxy configuration for the VM. HTTPProxyConfig *HTTPProxyConfiguration + // The resource id of the private link scope this machine is assigned to, if any. + PrivateLinkScopeResourceID *string + // Gets or sets the guest agent provisioning action. ProvisioningAction *ProvisioningAction @@ -546,9 +549,33 @@ type OsProfileForVMInstance struct { // Admin password of the virtual machine. AdminPassword *string + // Gets or sets the admin username. + AdminUsername *string + // Gets or sets computer name. ComputerName *string + // Gets or sets the domain name. + DomainName *string + + // Password of the domain the VM has to join. + DomainPassword *string + + // Gets or sets the domain username. + DomainUsername *string + + // Gets or sets the product key.Input format xxxxx-xxxxx-xxxxx-xxxxx-xxxxx + ProductKey *string + + // Get or sets the commands to be run once at the time of creation separated by semicolons. + RunOnceCommands *string + + // Gets or sets the index value of the timezone. + Timezone *int32 + + // Gets or sets the workgroup. + Workgroup *string + // READ-ONLY; Gets os sku. OSSKU *string @@ -851,6 +878,9 @@ type VirtualMachineInventoryItem struct { // READ-ONLY; Gets the bios guid. BiosGUID *string + // READ-ONLY; Gets vm generation. + Generation *int64 + // READ-ONLY; Gets the Managed Object name in Vmm for the inventory item. InventoryItemName *string diff --git a/sdk/resourcemanager/scvmm/armscvmm/models_serde.go b/sdk/resourcemanager/scvmm/armscvmm/models_serde.go index a0c75adc8c61..542dd201b363 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/models_serde.go +++ b/sdk/resourcemanager/scvmm/armscvmm/models_serde.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -293,6 +290,7 @@ func (c CloudCapacity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cpuCount", c.CPUCount) populate(objectMap, "memoryMB", c.MemoryMB) + populate(objectMap, "storageGB", c.StorageGB) populate(objectMap, "vmCount", c.VMCount) return json.Marshal(objectMap) } @@ -312,6 +310,9 @@ func (c *CloudCapacity) UnmarshalJSON(data []byte) error { case "memoryMB": err = unpopulate(val, "MemoryMB", &c.MemoryMB) delete(rawMsg, key) + case "storageGB": + err = unpopulate(val, "StorageGB", &c.StorageGB) + delete(rawMsg, key) case "vmCount": err = unpopulate(val, "VMCount", &c.VMCount) delete(rawMsg, key) @@ -586,6 +587,7 @@ func (g GuestAgentProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "credentials", g.Credentials) populate(objectMap, "customResourceName", g.CustomResourceName) populate(objectMap, "httpProxyConfig", g.HTTPProxyConfig) + populate(objectMap, "privateLinkScopeResourceId", g.PrivateLinkScopeResourceID) populate(objectMap, "provisioningAction", g.ProvisioningAction) populate(objectMap, "provisioningState", g.ProvisioningState) populate(objectMap, "status", g.Status) @@ -611,6 +613,9 @@ func (g *GuestAgentProperties) UnmarshalJSON(data []byte) error { case "httpProxyConfig": err = unpopulate(val, "HTTPProxyConfig", &g.HTTPProxyConfig) delete(rawMsg, key) + case "privateLinkScopeResourceId": + err = unpopulate(val, "PrivateLinkScopeResourceID", &g.PrivateLinkScopeResourceID) + delete(rawMsg, key) case "provisioningAction": err = unpopulate(val, "ProvisioningAction", &g.ProvisioningAction) delete(rawMsg, key) @@ -1322,10 +1327,18 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { func (o OsProfileForVMInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "adminPassword", o.AdminPassword) + populate(objectMap, "adminUsername", o.AdminUsername) populate(objectMap, "computerName", o.ComputerName) + populate(objectMap, "domainName", o.DomainName) + populate(objectMap, "domainPassword", o.DomainPassword) + populate(objectMap, "domainUsername", o.DomainUsername) populate(objectMap, "osSku", o.OSSKU) populate(objectMap, "osType", o.OSType) populate(objectMap, "osVersion", o.OSVersion) + populate(objectMap, "productKey", o.ProductKey) + populate(objectMap, "runOnceCommands", o.RunOnceCommands) + populate(objectMap, "timezone", o.Timezone) + populate(objectMap, "workgroup", o.Workgroup) return json.Marshal(objectMap) } @@ -1341,9 +1354,21 @@ func (o *OsProfileForVMInstance) UnmarshalJSON(data []byte) error { case "adminPassword": err = unpopulate(val, "AdminPassword", &o.AdminPassword) delete(rawMsg, key) + case "adminUsername": + err = unpopulate(val, "AdminUsername", &o.AdminUsername) + delete(rawMsg, key) case "computerName": err = unpopulate(val, "ComputerName", &o.ComputerName) delete(rawMsg, key) + case "domainName": + err = unpopulate(val, "DomainName", &o.DomainName) + delete(rawMsg, key) + case "domainPassword": + err = unpopulate(val, "DomainPassword", &o.DomainPassword) + delete(rawMsg, key) + case "domainUsername": + err = unpopulate(val, "DomainUsername", &o.DomainUsername) + delete(rawMsg, key) case "osSku": err = unpopulate(val, "OSSKU", &o.OSSKU) delete(rawMsg, key) @@ -1353,6 +1378,18 @@ func (o *OsProfileForVMInstance) UnmarshalJSON(data []byte) error { case "osVersion": err = unpopulate(val, "OSVersion", &o.OSVersion) delete(rawMsg, key) + case "productKey": + err = unpopulate(val, "ProductKey", &o.ProductKey) + delete(rawMsg, key) + case "runOnceCommands": + err = unpopulate(val, "RunOnceCommands", &o.RunOnceCommands) + delete(rawMsg, key) + case "timezone": + err = unpopulate(val, "Timezone", &o.Timezone) + delete(rawMsg, key) + case "workgroup": + err = unpopulate(val, "Workgroup", &o.Workgroup) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -2076,6 +2113,7 @@ func (v VirtualMachineInventoryItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "biosGuid", v.BiosGUID) populate(objectMap, "cloud", v.Cloud) + populate(objectMap, "generation", v.Generation) populate(objectMap, "ipAddresses", v.IPAddresses) populate(objectMap, "inventoryItemName", v.InventoryItemName) objectMap["inventoryType"] = InventoryTypeVirtualMachine @@ -2105,6 +2143,9 @@ func (v *VirtualMachineInventoryItem) UnmarshalJSON(data []byte) error { case "cloud": err = unpopulate(val, "Cloud", &v.Cloud) delete(rawMsg, key) + case "generation": + err = unpopulate(val, "Generation", &v.Generation) + delete(rawMsg, key) case "ipAddresses": err = unpopulate(val, "IPAddresses", &v.IPAddresses) delete(rawMsg, key) diff --git a/sdk/resourcemanager/scvmm/armscvmm/operations_client.go b/sdk/resourcemanager/scvmm/armscvmm/operations_client.go index 859c2036320a..d3830277a7b0 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/operations_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/operations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -39,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -65,14 +62,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.ScVmm/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go deleted file mode 100644 index 15482cfb6029..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.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.OperationListResult = armscvmm.OperationListResult{ - // Value: []*armscvmm.Operation{ - // { - // Name: to.Ptr("rieknsh"), - // ActionType: to.Ptr(armscvmm.ActionTypeInternal), - // Display: &armscvmm.OperationDisplay{ - // Description: to.Ptr("fmwevntnynhgzoksqpjidn"), - // Operation: to.Ptr("v"), - // Provider: to.Ptr("avkabpzrbafrbnubspbrsippj"), - // Resource: to.Ptr("qojushhvjhkwwmboofogcky"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armscvmm.OriginUser), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.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.OperationListResult = armscvmm.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/options.go b/sdk/resourcemanager/scvmm/armscvmm/options.go index b22dfafc9139..95ff4e2b035c 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/options.go +++ b/sdk/resourcemanager/scvmm/armscvmm/options.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -11,7 +8,7 @@ package armscvmm // AvailabilitySetsClientBeginCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.BeginCreateOrUpdate // method. type AvailabilitySetsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -20,13 +17,13 @@ type AvailabilitySetsClientBeginDeleteOptions struct { // Forces the resource to be deleted. Force *ForceDelete - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AvailabilitySetsClientBeginUpdateOptions contains the optional parameters for the AvailabilitySetsClient.BeginUpdate method. type AvailabilitySetsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -49,7 +46,7 @@ type AvailabilitySetsClientListBySubscriptionOptions struct { // CloudsClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudsClient.BeginCreateOrUpdate method. type CloudsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -58,13 +55,13 @@ type CloudsClientBeginDeleteOptions struct { // Forces the resource to be deleted. Force *ForceDelete - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // CloudsClientBeginUpdateOptions contains the optional parameters for the CloudsClient.BeginUpdate method. type CloudsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -87,7 +84,7 @@ type CloudsClientListBySubscriptionOptions struct { // GuestAgentsClientBeginCreateOptions contains the optional parameters for the GuestAgentsClient.BeginCreate method. type GuestAgentsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -148,21 +145,21 @@ type VMInstanceHybridIdentityMetadatasClientListByVirtualMachineInstanceOptions // VirtualMachineInstancesClientBeginCreateCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginCreateCheckpoint // method. type VirtualMachineInstancesClientBeginCreateCheckpointOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualMachineInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginCreateOrUpdate // method. type VirtualMachineInstancesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualMachineInstancesClientBeginDeleteCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginDeleteCheckpoint // method. type VirtualMachineInstancesClientBeginDeleteCheckpointOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -175,42 +172,45 @@ type VirtualMachineInstancesClientBeginDeleteOptions struct { // Forces the resource to be deleted. Force *ForceDelete - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualMachineInstancesClientBeginRestartOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginRestart // method. type VirtualMachineInstancesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualMachineInstancesClientBeginRestoreCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginRestoreCheckpoint // method. type VirtualMachineInstancesClientBeginRestoreCheckpointOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualMachineInstancesClientBeginStartOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginStart // method. type VirtualMachineInstancesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualMachineInstancesClientBeginStopOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginStop // method. type VirtualMachineInstancesClientBeginStopOptions struct { - // Resumes the LRO from the provided token. + // The content of the action request + Body *StopVirtualMachineOptions + + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualMachineInstancesClientBeginUpdateOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginUpdate // method. type VirtualMachineInstancesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -228,7 +228,7 @@ type VirtualMachineInstancesClientListOptions struct { // VirtualMachineTemplatesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginCreateOrUpdate // method. type VirtualMachineTemplatesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -238,14 +238,14 @@ type VirtualMachineTemplatesClientBeginDeleteOptions struct { // Forces the resource to be deleted. Force *ForceDelete - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualMachineTemplatesClientBeginUpdateOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginUpdate // method. type VirtualMachineTemplatesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -269,7 +269,7 @@ type VirtualMachineTemplatesClientListBySubscriptionOptions struct { // VirtualNetworksClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginCreateOrUpdate // method. type VirtualNetworksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -278,13 +278,13 @@ type VirtualNetworksClientBeginDeleteOptions struct { // Forces the resource to be deleted. Force *ForceDelete - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VirtualNetworksClientBeginUpdateOptions contains the optional parameters for the VirtualNetworksClient.BeginUpdate method. type VirtualNetworksClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -308,7 +308,7 @@ type VirtualNetworksClientListBySubscriptionOptions struct { // VmmServersClientBeginCreateOrUpdateOptions contains the optional parameters for the VmmServersClient.BeginCreateOrUpdate // method. type VmmServersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -317,13 +317,13 @@ type VmmServersClientBeginDeleteOptions struct { // Forces the resource to be deleted. Force *ForceDelete - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // VmmServersClientBeginUpdateOptions contains the optional parameters for the VmmServersClient.BeginUpdate method. type VmmServersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/scvmm/armscvmm/polymorphic_helpers.go b/sdk/resourcemanager/scvmm/armscvmm/polymorphic_helpers.go index 336d9c45d58d..8f58d93b7e8b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/polymorphic_helpers.go +++ b/sdk/resourcemanager/scvmm/armscvmm/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/sdk/resourcemanager/scvmm/armscvmm/responses.go b/sdk/resourcemanager/scvmm/armscvmm/responses.go index 1b7d0d73a597..0fb606e938d3 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/responses.go +++ b/sdk/resourcemanager/scvmm/armscvmm/responses.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/sdk/resourcemanager/scvmm/armscvmm/time_rfc3339.go b/sdk/resourcemanager/scvmm/armscvmm/time_rfc3339.go index acbe2d31cf8f..464c6b68a34e 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/time_rfc3339.go +++ b/sdk/resourcemanager/scvmm/armscvmm/time_rfc3339.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go index baed77d9ab5c..87cf2036c0d5 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -41,7 +38,7 @@ func NewVirtualMachineInstancesClient(credential azcore.TokenCredential, options // BeginCreateCheckpoint - Creates a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginCreateCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginCreateCheckpoint @@ -67,7 +64,7 @@ func (client *VirtualMachineInstancesClient) BeginCreateCheckpoint(ctx context.C // CreateCheckpoint - Creates a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineInstancesClient) createCheckpoint(ctx context.Context, resourceURI string, body VirtualMachineCreateCheckpoint, options *VirtualMachineInstancesClientBeginCreateCheckpointOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginCreateCheckpoint" @@ -90,7 +87,7 @@ func (client *VirtualMachineInstancesClient) createCheckpoint(ctx context.Contex } // createCheckpointCreateRequest creates the CreateCheckpoint request. -func (client *VirtualMachineInstancesClient) createCheckpointCreateRequest(ctx context.Context, resourceURI string, body VirtualMachineCreateCheckpoint, options *VirtualMachineInstancesClientBeginCreateCheckpointOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) createCheckpointCreateRequest(ctx context.Context, resourceURI string, body VirtualMachineCreateCheckpoint, _ *VirtualMachineInstancesClientBeginCreateCheckpointOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -98,7 +95,7 @@ func (client *VirtualMachineInstancesClient) createCheckpointCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -111,7 +108,7 @@ func (client *VirtualMachineInstancesClient) createCheckpointCreateRequest(ctx c // set only during virtual machine instance creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - resource - Resource create parameters. // - options - VirtualMachineInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginCreateOrUpdate @@ -138,7 +135,7 @@ func (client *VirtualMachineInstancesClient) BeginCreateOrUpdate(ctx context.Con // during virtual machine instance creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineInstancesClient) createOrUpdate(ctx context.Context, resourceURI string, resource VirtualMachineInstance, options *VirtualMachineInstancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginCreateOrUpdate" @@ -161,7 +158,7 @@ func (client *VirtualMachineInstancesClient) createOrUpdate(ctx context.Context, } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineInstancesClient) createOrUpdateCreateRequest(ctx context.Context, resourceURI string, resource VirtualMachineInstance, options *VirtualMachineInstancesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) createOrUpdateCreateRequest(ctx context.Context, resourceURI string, resource VirtualMachineInstance, _ *VirtualMachineInstancesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -169,7 +166,7 @@ func (client *VirtualMachineInstancesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -181,7 +178,7 @@ func (client *VirtualMachineInstancesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - The operation to delete a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginDelete // method. @@ -206,7 +203,7 @@ func (client *VirtualMachineInstancesClient) BeginDelete(ctx context.Context, re // Delete - The operation to delete a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineInstancesClient) deleteOperation(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginDelete" @@ -237,7 +234,7 @@ func (client *VirtualMachineInstancesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") if options != nil && options.DeleteFromHost != nil { reqQP.Set("deleteFromHost", string(*options.DeleteFromHost)) } @@ -252,7 +249,7 @@ func (client *VirtualMachineInstancesClient) deleteCreateRequest(ctx context.Con // BeginDeleteCheckpoint - Deletes a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginDeleteCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginDeleteCheckpoint @@ -278,7 +275,7 @@ func (client *VirtualMachineInstancesClient) BeginDeleteCheckpoint(ctx context.C // DeleteCheckpoint - Deletes a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineInstancesClient) deleteCheckpoint(ctx context.Context, resourceURI string, body VirtualMachineDeleteCheckpoint, options *VirtualMachineInstancesClientBeginDeleteCheckpointOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginDeleteCheckpoint" @@ -301,7 +298,7 @@ func (client *VirtualMachineInstancesClient) deleteCheckpoint(ctx context.Contex } // deleteCheckpointCreateRequest creates the DeleteCheckpoint request. -func (client *VirtualMachineInstancesClient) deleteCheckpointCreateRequest(ctx context.Context, resourceURI string, body VirtualMachineDeleteCheckpoint, options *VirtualMachineInstancesClientBeginDeleteCheckpointOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) deleteCheckpointCreateRequest(ctx context.Context, resourceURI string, body VirtualMachineDeleteCheckpoint, _ *VirtualMachineInstancesClientBeginDeleteCheckpointOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -309,7 +306,7 @@ func (client *VirtualMachineInstancesClient) deleteCheckpointCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -321,7 +318,7 @@ func (client *VirtualMachineInstancesClient) deleteCheckpointCreateRequest(ctx c // Get - Retrieves information about a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientGetOptions contains the optional parameters for the VirtualMachineInstancesClient.Get // method. @@ -348,7 +345,7 @@ func (client *VirtualMachineInstancesClient) Get(ctx context.Context, resourceUR } // getCreateRequest creates the Get request. -func (client *VirtualMachineInstancesClient) getCreateRequest(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientGetOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) getCreateRequest(ctx context.Context, resourceURI string, _ *VirtualMachineInstancesClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -356,7 +353,7 @@ func (client *VirtualMachineInstancesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,7 +370,7 @@ func (client *VirtualMachineInstancesClient) getHandleResponse(resp *http.Respon // NewListPager - Lists all of the virtual machine instances within the specified parent resource. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientListOptions contains the optional parameters for the VirtualMachineInstancesClient.NewListPager // method. @@ -401,7 +398,7 @@ func (client *VirtualMachineInstancesClient) NewListPager(resourceURI string, op } // listCreateRequest creates the List request. -func (client *VirtualMachineInstancesClient) listCreateRequest(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientListOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) listCreateRequest(ctx context.Context, resourceURI string, _ *VirtualMachineInstancesClientListOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -409,7 +406,7 @@ func (client *VirtualMachineInstancesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -427,7 +424,7 @@ func (client *VirtualMachineInstancesClient) listHandleResponse(resp *http.Respo // BeginRestart - The operation to restart a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientBeginRestartOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginRestart // method. @@ -452,7 +449,7 @@ func (client *VirtualMachineInstancesClient) BeginRestart(ctx context.Context, r // Restart - The operation to restart a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineInstancesClient) restart(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginRestart" @@ -475,7 +472,7 @@ func (client *VirtualMachineInstancesClient) restart(ctx context.Context, resour } // restartCreateRequest creates the Restart request. -func (client *VirtualMachineInstancesClient) restartCreateRequest(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginRestartOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) restartCreateRequest(ctx context.Context, resourceURI string, _ *VirtualMachineInstancesClientBeginRestartOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -483,7 +480,7 @@ func (client *VirtualMachineInstancesClient) restartCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -492,7 +489,7 @@ func (client *VirtualMachineInstancesClient) restartCreateRequest(ctx context.Co // BeginRestoreCheckpoint - Restores to a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginRestoreCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginRestoreCheckpoint @@ -518,7 +515,7 @@ func (client *VirtualMachineInstancesClient) BeginRestoreCheckpoint(ctx context. // RestoreCheckpoint - Restores to a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineInstancesClient) restoreCheckpoint(ctx context.Context, resourceURI string, body VirtualMachineRestoreCheckpoint, options *VirtualMachineInstancesClientBeginRestoreCheckpointOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginRestoreCheckpoint" @@ -541,7 +538,7 @@ func (client *VirtualMachineInstancesClient) restoreCheckpoint(ctx context.Conte } // restoreCheckpointCreateRequest creates the RestoreCheckpoint request. -func (client *VirtualMachineInstancesClient) restoreCheckpointCreateRequest(ctx context.Context, resourceURI string, body VirtualMachineRestoreCheckpoint, options *VirtualMachineInstancesClientBeginRestoreCheckpointOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) restoreCheckpointCreateRequest(ctx context.Context, resourceURI string, body VirtualMachineRestoreCheckpoint, _ *VirtualMachineInstancesClientBeginRestoreCheckpointOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -549,7 +546,7 @@ func (client *VirtualMachineInstancesClient) restoreCheckpointCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -561,7 +558,7 @@ func (client *VirtualMachineInstancesClient) restoreCheckpointCreateRequest(ctx // BeginStart - The operation to start a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientBeginStartOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginStart // method. @@ -586,7 +583,7 @@ func (client *VirtualMachineInstancesClient) BeginStart(ctx context.Context, res // Start - The operation to start a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineInstancesClient) start(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginStart" @@ -609,7 +606,7 @@ func (client *VirtualMachineInstancesClient) start(ctx context.Context, resource } // startCreateRequest creates the Start request. -func (client *VirtualMachineInstancesClient) startCreateRequest(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStartOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) startCreateRequest(ctx context.Context, resourceURI string, _ *VirtualMachineInstancesClientBeginStartOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/start" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -617,7 +614,7 @@ func (client *VirtualMachineInstancesClient) startCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -626,14 +623,13 @@ func (client *VirtualMachineInstancesClient) startCreateRequest(ctx context.Cont // BeginStop - The operation to power off (stop) a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. -// - body - The content of the action request // - options - VirtualMachineInstancesClientBeginStopOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginStop // method. -func (client *VirtualMachineInstancesClient) BeginStop(ctx context.Context, resourceURI string, body StopVirtualMachineOptions, options *VirtualMachineInstancesClientBeginStopOptions) (*runtime.Poller[VirtualMachineInstancesClientStopResponse], error) { +func (client *VirtualMachineInstancesClient) BeginStop(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStopOptions) (*runtime.Poller[VirtualMachineInstancesClientStopResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.stop(ctx, resourceURI, body, options) + resp, err := client.stop(ctx, resourceURI, options) if err != nil { return nil, err } @@ -652,14 +648,14 @@ func (client *VirtualMachineInstancesClient) BeginStop(ctx context.Context, reso // Stop - The operation to power off (stop) a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 -func (client *VirtualMachineInstancesClient) stop(ctx context.Context, resourceURI string, body StopVirtualMachineOptions, options *VirtualMachineInstancesClientBeginStopOptions) (*http.Response, error) { +// Generated from API version 2025-03-13 +func (client *VirtualMachineInstancesClient) stop(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginStop" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.stopCreateRequest(ctx, resourceURI, body, options) + req, err := client.stopCreateRequest(ctx, resourceURI, options) if err != nil { return nil, err } @@ -675,7 +671,7 @@ func (client *VirtualMachineInstancesClient) stop(ctx context.Context, resourceU } // stopCreateRequest creates the Stop request. -func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Context, resourceURI string, body StopVirtualMachineOptions, options *VirtualMachineInstancesClientBeginStopOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStopOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -683,11 +679,14 @@ func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, body); err != nil { - return nil, err + if options != nil && options.Body != nil { + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -695,7 +694,7 @@ func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Conte // BeginUpdate - The operation to update a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - properties - The resource properties to be updated. // - options - VirtualMachineInstancesClientBeginUpdateOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginUpdate @@ -721,7 +720,7 @@ func (client *VirtualMachineInstancesClient) BeginUpdate(ctx context.Context, re // Update - The operation to update a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineInstancesClient) update(ctx context.Context, resourceURI string, properties VirtualMachineInstanceUpdate, options *VirtualMachineInstancesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginUpdate" @@ -744,7 +743,7 @@ func (client *VirtualMachineInstancesClient) update(ctx context.Context, resourc } // updateCreateRequest creates the Update request. -func (client *VirtualMachineInstancesClient) updateCreateRequest(ctx context.Context, resourceURI string, properties VirtualMachineInstanceUpdate, options *VirtualMachineInstancesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) updateCreateRequest(ctx context.Context, resourceURI string, properties VirtualMachineInstanceUpdate, _ *VirtualMachineInstancesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -752,7 +751,7 @@ func (client *VirtualMachineInstancesClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go deleted file mode 100644 index d2eb007ddf2a..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go +++ /dev/null @@ -1,1079 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_NewListPager_virtualMachineInstancesListMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineInstancesClient().NewListPager("gtgclehcbsyave", 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.VirtualMachineInstanceListResult = armscvmm.VirtualMachineInstanceListResult{ - // Value: []*armscvmm.VirtualMachineInstance{ - // { - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_NewListPager_virtualMachineInstancesListMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineInstancesClient().NewListPager("gtgclehcbsyave", 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.VirtualMachineInstanceListResult = armscvmm.VirtualMachineInstanceListResult{ - // Value: []*armscvmm.VirtualMachineInstance{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_Get_virtualMachineInstancesGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineInstancesClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.VirtualMachineInstance{ - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_Get_virtualMachineInstancesGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineInstancesClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_virtualMachineInstancesCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstance{ - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VirtualMachineInstanceProperties{ - AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - { - Name: to.Ptr("lwbhaseo"), - ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - }}, - HardwareProfile: &armscvmm.HardwareProfile{ - CPUCount: to.Ptr[int32](22), - DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - DynamicMemoryMaxMB: to.Ptr[int32](2), - DynamicMemoryMinMB: to.Ptr[int32](30), - IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - MemoryMB: to.Ptr[int32](5), - }, - InfrastructureProfile: &armscvmm.InfrastructureProfile{ - BiosGUID: to.Ptr("xixivxifyql"), - CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - Generation: to.Ptr[int32](28), - InventoryItemID: to.Ptr("ihkkqmg"), - LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - Name: to.Ptr("keqn"), - Description: to.Ptr("qurzfrgyflrh"), - CheckpointID: to.Ptr("wsqmrje"), - ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - }, - TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - UUID: to.Ptr("hrpw"), - VMName: to.Ptr("qovpayfydhcvfrhe"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - NetworkProfile: &armscvmm.NetworkProfile{ - NetworkInterfaces: []*armscvmm.NetworkInterface{ - { - Name: to.Ptr("kvofzqulbjlbtt"), - IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - MacAddress: to.Ptr("oaeqqegt"), - MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - NicID: to.Ptr("roxpsvlo"), - VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - }}, - }, - OSProfile: &armscvmm.OsProfileForVMInstance{ - AdminPassword: to.Ptr("vavtppmmhlspydtkzxda"), - ComputerName: to.Ptr("uuxpcxuxcufllc"), - OSType: to.Ptr(armscvmm.OsTypeWindows), - }, - StorageProfile: &armscvmm.StorageProfile{ - Disks: []*armscvmm.VirtualDisk{ - { - Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - Bus: to.Ptr[int32](8), - BusType: to.Ptr("zu"), - CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - DiskSizeGB: to.Ptr[int32](30), - Lun: to.Ptr[int32](10), - StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - Name: to.Ptr("ceiyfrflu"), - ID: to.Ptr("o"), - }, - TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - }}, - }, - }, - }, 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 = armscvmm.VirtualMachineInstance{ - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("kz"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_virtualMachineInstancesCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstance{ - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, 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 = armscvmm.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginUpdate_virtualMachineInstancesUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstanceUpdate{ - Properties: &armscvmm.VirtualMachineInstanceUpdateProperties{ - AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - { - Name: to.Ptr("lwbhaseo"), - ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - }}, - HardwareProfile: &armscvmm.HardwareProfileUpdate{ - CPUCount: to.Ptr[int32](22), - DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - DynamicMemoryMaxMB: to.Ptr[int32](2), - DynamicMemoryMinMB: to.Ptr[int32](30), - LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - MemoryMB: to.Ptr[int32](5), - }, - InfrastructureProfile: &armscvmm.InfrastructureProfileUpdate{ - CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - }, - NetworkProfile: &armscvmm.NetworkProfileUpdate{ - NetworkInterfaces: []*armscvmm.NetworkInterfaceUpdate{ - { - Name: to.Ptr("kvofzqulbjlbtt"), - IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - MacAddress: to.Ptr("oaeqqegt"), - MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - NicID: to.Ptr("roxpsvlo"), - VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - }}, - }, - StorageProfile: &armscvmm.StorageProfileUpdate{ - Disks: []*armscvmm.VirtualDiskUpdate{ - { - Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - Bus: to.Ptr[int32](8), - BusType: to.Ptr("zu"), - DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - DiskSizeGB: to.Ptr[int32](30), - Lun: to.Ptr[int32](10), - StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - Name: to.Ptr("ceiyfrflu"), - ID: to.Ptr("o"), - }, - VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - }}, - }, - }, - }, 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 = armscvmm.VirtualMachineInstance{ - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("kz"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginUpdate_virtualMachineInstancesUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstanceUpdate{}, 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 = armscvmm.VirtualMachineInstance{ - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDelete_virtualMachineInstancesDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDelete(ctx, "gtgclehcbsyave", &armscvmm.VirtualMachineInstancesClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue), - DeleteFromHost: to.Ptr(armscvmm.DeleteFromHostTrue), - }) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDelete_virtualMachineInstancesDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDelete(ctx, "gtgclehcbsyave", &armscvmm.VirtualMachineInstancesClientBeginDeleteOptions{Force: nil, - DeleteFromHost: 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateCheckpoint_virtualMachineInstancesCreateCheckpointMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineCreateCheckpoint{ - Name: to.Ptr("ilvltf"), - Description: to.Ptr("zoozhfbepldrgpjqsbhpqebtodrhvy"), - }, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateCheckpoint_virtualMachineInstancesCreateCheckpointMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineCreateCheckpoint{}, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDeleteCheckpoint_virtualMachineInstancesDeleteCheckpointMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDeleteCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineDeleteCheckpoint{ - ID: to.Ptr("eenfflimcbgqfsebdusophahjpk"), - }, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDeleteCheckpoint_virtualMachineInstancesDeleteCheckpointMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDeleteCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineDeleteCheckpoint{}, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestart_virtualMachineInstancesRestartMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestart(ctx, "gtgclehcbsyave", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestart_virtualMachineInstancesRestartMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestart(ctx, "gtgclehcbsyave", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestoreCheckpoint_virtualMachineInstancesRestoreCheckpointMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestoreCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineRestoreCheckpoint{ - ID: to.Ptr("rweqduwzsn"), - }, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestoreCheckpoint_virtualMachineInstancesRestoreCheckpointMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestoreCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineRestoreCheckpoint{}, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStart_virtualMachineInstancesStartMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStart(ctx, "gtgclehcbsyave", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStart_virtualMachineInstancesStartMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStart(ctx, "gtgclehcbsyave", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStop_virtualMachineInstancesStopMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStop(ctx, "gtgclehcbsyave", armscvmm.StopVirtualMachineOptions{ - SkipShutdown: to.Ptr(armscvmm.SkipShutdownTrue), - }, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStop_virtualMachineInstancesStopMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStop(ctx, "gtgclehcbsyave", armscvmm.StopVirtualMachineOptions{}, 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/scvmm/armscvmm/virtualmachinetemplates_client.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go index 84281bc35baf..a1f99637dd8c 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewVirtualMachineTemplatesClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Onboards the ScVmm VM Template as an Azure VM Template resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - resource - Resource create parameters. @@ -73,7 +70,7 @@ func (client *VirtualMachineTemplatesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Onboards the ScVmm VM Template as an Azure VM Template resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineTemplatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, resource VirtualMachineTemplate, options *VirtualMachineTemplatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineTemplatesClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *VirtualMachineTemplatesClient) createOrUpdate(ctx context.Context, } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualMachineTemplatesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, resource VirtualMachineTemplate, options *VirtualMachineTemplatesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualMachineTemplatesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, resource VirtualMachineTemplate, _ *VirtualMachineTemplatesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +112,7 @@ func (client *VirtualMachineTemplatesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +124,7 @@ func (client *VirtualMachineTemplatesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deregisters the ScVmm VM Template from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - options - VirtualMachineTemplatesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginDelete @@ -153,7 +150,7 @@ func (client *VirtualMachineTemplatesClient) BeginDelete(ctx context.Context, re // Delete - Deregisters the ScVmm VM Template from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineTemplatesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, options *VirtualMachineTemplatesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineTemplatesClient.BeginDelete" @@ -195,7 +192,7 @@ func (client *VirtualMachineTemplatesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -207,7 +204,7 @@ func (client *VirtualMachineTemplatesClient) deleteCreateRequest(ctx context.Con // Get - Implements VirtualMachineTemplate GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - options - VirtualMachineTemplatesClientGetOptions contains the optional parameters for the VirtualMachineTemplatesClient.Get @@ -235,7 +232,7 @@ func (client *VirtualMachineTemplatesClient) Get(ctx context.Context, resourceGr } // getCreateRequest creates the Get request. -func (client *VirtualMachineTemplatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, options *VirtualMachineTemplatesClientGetOptions) (*policy.Request, error) { +func (client *VirtualMachineTemplatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, _ *VirtualMachineTemplatesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -254,7 +251,7 @@ func (client *VirtualMachineTemplatesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +268,7 @@ func (client *VirtualMachineTemplatesClient) getHandleResponse(resp *http.Respon // NewListByResourceGroupPager - List of VirtualMachineTemplates in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualMachineTemplatesClientListByResourceGroupOptions contains the optional parameters for the VirtualMachineTemplatesClient.NewListByResourceGroupPager // method. @@ -299,7 +296,7 @@ func (client *VirtualMachineTemplatesClient) NewListByResourceGroupPager(resourc } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualMachineTemplatesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachineTemplatesClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *VirtualMachineTemplatesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualMachineTemplatesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -314,7 +311,7 @@ func (client *VirtualMachineTemplatesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +328,7 @@ func (client *VirtualMachineTemplatesClient) listByResourceGroupHandleResponse(r // NewListBySubscriptionPager - List of VirtualMachineTemplates in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - options - VirtualMachineTemplatesClientListBySubscriptionOptions contains the optional parameters for the VirtualMachineTemplatesClient.NewListBySubscriptionPager // method. func (client *VirtualMachineTemplatesClient) NewListBySubscriptionPager(options *VirtualMachineTemplatesClientListBySubscriptionOptions) *runtime.Pager[VirtualMachineTemplatesClientListBySubscriptionResponse] { @@ -358,7 +355,7 @@ func (client *VirtualMachineTemplatesClient) NewListBySubscriptionPager(options } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *VirtualMachineTemplatesClient) listBySubscriptionCreateRequest(ctx context.Context, options *VirtualMachineTemplatesClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *VirtualMachineTemplatesClient) listBySubscriptionCreateRequest(ctx context.Context, _ *VirtualMachineTemplatesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualMachineTemplates" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -369,7 +366,7 @@ func (client *VirtualMachineTemplatesClient) listBySubscriptionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +384,7 @@ func (client *VirtualMachineTemplatesClient) listBySubscriptionHandleResponse(re // BeginUpdate - Updates the VirtualMachineTemplate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - properties - The resource properties to be updated. @@ -414,7 +411,7 @@ func (client *VirtualMachineTemplatesClient) BeginUpdate(ctx context.Context, re // Update - Updates the VirtualMachineTemplate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualMachineTemplatesClient) update(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, properties VirtualMachineTemplateTagsUpdate, options *VirtualMachineTemplatesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineTemplatesClient.BeginUpdate" @@ -437,7 +434,7 @@ func (client *VirtualMachineTemplatesClient) update(ctx context.Context, resourc } // updateCreateRequest creates the Update request. -func (client *VirtualMachineTemplatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, properties VirtualMachineTemplateTagsUpdate, options *VirtualMachineTemplatesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *VirtualMachineTemplatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, properties VirtualMachineTemplateTagsUpdate, _ *VirtualMachineTemplatesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachineTemplates/{virtualMachineTemplateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -456,7 +453,7 @@ func (client *VirtualMachineTemplatesClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go deleted file mode 100644 index 0b71bb748b18..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go +++ /dev/null @@ -1,739 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListBySubscriptionPager_virtualMachineTemplatesListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListBySubscriptionPager(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.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListBySubscriptionPager_virtualMachineTemplatesListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListBySubscriptionPager(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.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListByResourceGroupPager_virtualMachineTemplatesListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListByResourceGroupPager("rgscvmm", 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.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListByResourceGroupPager_virtualMachineTemplatesListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListByResourceGroupPager("rgscvmm", 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.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_Get_virtualMachineTemplatesGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineTemplatesClient().Get(ctx, "rgscvmm", "4", 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 = armscvmm.VirtualMachineTemplate{ - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_Get_virtualMachineTemplatesGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineTemplatesClient().Get(ctx, "rgscvmm", "m", 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 = armscvmm.VirtualMachineTemplate{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginCreateOrUpdate_virtualMachineTemplatesCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginCreateOrUpdate(ctx, "rgscvmm", "6", armscvmm.VirtualMachineTemplate{ - Location: to.Ptr("ayxsyduviotylbojh"), - Tags: map[string]*string{ - "key9494": to.Ptr("kkbmfpwhmvlobm"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VirtualMachineTemplateProperties{ - DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - OSType: to.Ptr(armscvmm.OsTypeWindows), - UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, 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 = armscvmm.VirtualMachineTemplate{ - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginCreateOrUpdate_virtualMachineTemplatesCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginCreateOrUpdate(ctx, "rgscvmm", "P", armscvmm.VirtualMachineTemplate{ - Location: to.Ptr("ayxsyduviotylbojh"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, 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 = armscvmm.VirtualMachineTemplate{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginUpdate_virtualMachineTemplatesUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginUpdate(ctx, "rgscvmm", "g", armscvmm.VirtualMachineTemplateTagsUpdate{ - Tags: map[string]*string{ - "key6634": to.Ptr("wwfhrg"), - }, - }, 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 = armscvmm.VirtualMachineTemplate{ - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginUpdate_virtualMachineTemplatesUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginUpdate(ctx, "rgscvmm", "-", armscvmm.VirtualMachineTemplateTagsUpdate{}, 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 = armscvmm.VirtualMachineTemplate{ - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginDelete_virtualMachineTemplatesDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginDelete(ctx, "rgscvmm", "6", &armscvmm.VirtualMachineTemplatesClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginDelete_virtualMachineTemplatesDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginDelete(ctx, "rgscvmm", "5", &armscvmm.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) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go b/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go index c3ee98db816a..2bb03eb306a3 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Onboards the ScVmm virtual network as an Azure virtual network resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - resource - Resource create parameters. @@ -73,7 +70,7 @@ func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Onboards the ScVmm virtual network as an Azure virtual network resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, resource VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourc } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, resource VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, resource VirtualNetwork, _ *VirtualNetworksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +112,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +124,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deregisters the ScVmm virtual network from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - options - VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete @@ -153,7 +150,7 @@ func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deregisters the ScVmm virtual network from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginDelete" @@ -195,7 +192,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -207,7 +204,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re // Get - Implements VirtualNetwork GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - options - VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. @@ -234,7 +231,7 @@ func (client *VirtualNetworksClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientGetOptions) (*policy.Request, error) { +func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, _ *VirtualNetworksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -253,7 +250,7 @@ func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +267,7 @@ func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (Vir // NewListByResourceGroupPager - List of VirtualNetworks in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualNetworksClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworksClient.NewListByResourceGroupPager // method. @@ -298,7 +295,7 @@ func (client *VirtualNetworksClient) NewListByResourceGroupPager(resourceGroupNa } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VirtualNetworksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualNetworksClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *VirtualNetworksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VirtualNetworksClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -313,7 +310,7 @@ func (client *VirtualNetworksClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +327,7 @@ func (client *VirtualNetworksClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - List of VirtualNetworks in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - options - VirtualNetworksClientListBySubscriptionOptions contains the optional parameters for the VirtualNetworksClient.NewListBySubscriptionPager // method. func (client *VirtualNetworksClient) NewListBySubscriptionPager(options *VirtualNetworksClientListBySubscriptionOptions) *runtime.Pager[VirtualNetworksClientListBySubscriptionResponse] { @@ -357,7 +354,7 @@ func (client *VirtualNetworksClient) NewListBySubscriptionPager(options *Virtual } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *VirtualNetworksClient) listBySubscriptionCreateRequest(ctx context.Context, options *VirtualNetworksClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *VirtualNetworksClient) listBySubscriptionCreateRequest(ctx context.Context, _ *VirtualNetworksClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/virtualNetworks" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -368,7 +365,7 @@ func (client *VirtualNetworksClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +383,7 @@ func (client *VirtualNetworksClient) listBySubscriptionHandleResponse(resp *http // BeginUpdate - Updates the VirtualNetworks resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - properties - The resource properties to be updated. @@ -413,7 +410,7 @@ func (client *VirtualNetworksClient) BeginUpdate(ctx context.Context, resourceGr // Update - Updates the VirtualNetworks resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VirtualNetworksClient) update(ctx context.Context, resourceGroupName string, virtualNetworkName string, properties VirtualNetworkTagsUpdate, options *VirtualNetworksClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginUpdate" @@ -436,7 +433,7 @@ func (client *VirtualNetworksClient) update(ctx context.Context, resourceGroupNa } // updateCreateRequest creates the Update request. -func (client *VirtualNetworksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, properties VirtualNetworkTagsUpdate, options *VirtualNetworksClientBeginUpdateOptions) (*policy.Request, error) { +func (client *VirtualNetworksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, virtualNetworkName string, properties VirtualNetworkTagsUpdate, _ *VirtualNetworksClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualNetworks/{virtualNetworkName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -455,7 +452,7 @@ func (client *VirtualNetworksClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go deleted file mode 100644 index 48165b958265..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go +++ /dev/null @@ -1,500 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_NewListBySubscriptionPager_virtualNetworksListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListBySubscriptionPager(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.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_NewListBySubscriptionPager_virtualNetworksListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListBySubscriptionPager(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.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_NewListByResourceGroupPager_virtualNetworksListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListByResourceGroupPager("rgscvmm", 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.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_NewListByResourceGroupPager_virtualNetworksListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListByResourceGroupPager("rgscvmm", 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.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_Get_virtualNetworksGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rgscvmm", "2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_Get_virtualNetworksGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rgscvmm", "-", 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 = armscvmm.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_virtualNetworksCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rgscvmm", "_", armscvmm.VirtualNetwork{ - Location: to.Ptr("fky"), - Tags: map[string]*string{ - "key705": to.Ptr("apgplvjdyocx"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VirtualNetworkProperties{ - InventoryItemID: to.Ptr("bxn"), - UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, 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 = armscvmm.VirtualNetwork{ - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_virtualNetworksCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.VirtualNetwork{ - Location: to.Ptr("fky"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, 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 = armscvmm.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_BeginUpdate_virtualNetworksUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginUpdate(ctx, "rgscvmm", "S", armscvmm.VirtualNetworkTagsUpdate{ - Tags: map[string]*string{ - "key9516": to.Ptr("oxduo"), - }, - }, 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 = armscvmm.VirtualNetwork{ - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_BeginUpdate_virtualNetworksUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginUpdate(ctx, "rgscvmm", "-", armscvmm.VirtualNetworkTagsUpdate{}, 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 = armscvmm.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_BeginDelete_virtualNetworksDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rgscvmm", ".", &armscvmm.VirtualNetworksClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_BeginDelete_virtualNetworksDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rgscvmm", "1", &armscvmm.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) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go b/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go index e47d239a05b4..759e8192a612 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -41,7 +38,7 @@ func NewVMInstanceHybridIdentityMetadatasClient(credential azcore.TokenCredentia // Get - Implements HybridIdentityMetadata GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VMInstanceHybridIdentityMetadatasClientGetOptions contains the optional parameters for the VMInstanceHybridIdentityMetadatasClient.Get // method. @@ -68,7 +65,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) Get(ctx context.Context, } // getCreateRequest creates the Get request. -func (client *VMInstanceHybridIdentityMetadatasClient) getCreateRequest(ctx context.Context, resourceURI string, options *VMInstanceHybridIdentityMetadatasClientGetOptions) (*policy.Request, error) { +func (client *VMInstanceHybridIdentityMetadatasClient) getCreateRequest(ctx context.Context, resourceURI string, _ *VMInstanceHybridIdentityMetadatasClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -76,7 +73,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -93,7 +90,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) getHandleResponse(resp *h // NewListByVirtualMachineInstancePager - Returns the list of HybridIdentityMetadata of the given VM. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VMInstanceHybridIdentityMetadatasClientListByVirtualMachineInstanceOptions contains the optional parameters for // the VMInstanceHybridIdentityMetadatasClient.NewListByVirtualMachineInstancePager method. @@ -121,7 +118,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) NewListByVirtualMachineIn } // listByVirtualMachineInstanceCreateRequest creates the ListByVirtualMachineInstance request. -func (client *VMInstanceHybridIdentityMetadatasClient) listByVirtualMachineInstanceCreateRequest(ctx context.Context, resourceURI string, options *VMInstanceHybridIdentityMetadatasClientListByVirtualMachineInstanceOptions) (*policy.Request, error) { +func (client *VMInstanceHybridIdentityMetadatasClient) listByVirtualMachineInstanceCreateRequest(ctx context.Context, resourceURI string, _ *VMInstanceHybridIdentityMetadatasClientListByVirtualMachineInstanceOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -129,7 +126,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) listByVirtualMachineInsta return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go deleted file mode 100644 index 28cdf105c571..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MaximumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_NewListByVirtualMachineInstancePager_vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", 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.VMInstanceHybridIdentityMetadataListResult = armscvmm.VMInstanceHybridIdentityMetadataListResult{ - // Value: []*armscvmm.VMInstanceHybridIdentityMetadata{ - // { - // Name: to.Ptr("rxvpcegqc"), - // Type: to.Ptr("ixqhymswessvylnqgti"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.VMInstanceHybridIdentityMetadataProperties{ - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // PublicKey: to.Ptr("hijhfxcdjuzidfjjztoh"), - // ResourceUID: to.Ptr("mikbntobifeiouinvsalnu"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MinimumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_NewListByVirtualMachineInstancePager_vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", 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.VMInstanceHybridIdentityMetadataListResult = armscvmm.VMInstanceHybridIdentityMetadataListResult{ - // Value: []*armscvmm.VMInstanceHybridIdentityMetadata{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MaximumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_Get_vmInstanceHybridIdentityMetadatasGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.VMInstanceHybridIdentityMetadata{ - // Name: to.Ptr("rxvpcegqc"), - // Type: to.Ptr("ixqhymswessvylnqgti"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.VMInstanceHybridIdentityMetadataProperties{ - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // PublicKey: to.Ptr("hijhfxcdjuzidfjjztoh"), - // ResourceUID: to.Ptr("mikbntobifeiouinvsalnu"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MinimumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_Get_vmInstanceHybridIdentityMetadatasGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.VMInstanceHybridIdentityMetadata{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go b/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go index 13f2dad140c1..6f093e4be167 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewVmmServersClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Onboards the SCVmm fabric as an Azure VmmServer resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - resource - Resource create parameters. @@ -73,7 +70,7 @@ func (client *VmmServersClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Onboards the SCVmm fabric as an Azure VmmServer resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VmmServersClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmmServerName string, resource VmmServer, options *VmmServersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VmmServersClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *VmmServersClient) createOrUpdate(ctx context.Context, resourceGrou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VmmServersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, resource VmmServer, options *VmmServersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VmmServersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, resource VmmServer, _ *VmmServersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +112,7 @@ func (client *VmmServersClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +124,7 @@ func (client *VmmServersClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Removes the SCVmm fabric from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - options - VmmServersClientBeginDeleteOptions contains the optional parameters for the VmmServersClient.BeginDelete method. @@ -152,7 +149,7 @@ func (client *VmmServersClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Removes the SCVmm fabric from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VmmServersClient) deleteOperation(ctx context.Context, resourceGroupName string, vmmServerName string, options *VmmServersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VmmServersClient.BeginDelete" @@ -194,7 +191,7 @@ func (client *VmmServersClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -206,7 +203,7 @@ func (client *VmmServersClient) deleteCreateRequest(ctx context.Context, resourc // Get - Implements VmmServer GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - options - VmmServersClientGetOptions contains the optional parameters for the VmmServersClient.Get method. @@ -233,7 +230,7 @@ func (client *VmmServersClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *VmmServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, options *VmmServersClientGetOptions) (*policy.Request, error) { +func (client *VmmServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, _ *VmmServersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -252,7 +249,7 @@ func (client *VmmServersClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +266,7 @@ func (client *VmmServersClient) getHandleResponse(resp *http.Response) (VmmServe // NewListByResourceGroupPager - List of VmmServers in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VmmServersClientListByResourceGroupOptions contains the optional parameters for the VmmServersClient.NewListByResourceGroupPager // method. @@ -297,7 +294,7 @@ func (client *VmmServersClient) NewListByResourceGroupPager(resourceGroupName st } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *VmmServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *VmmServersClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *VmmServersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *VmmServersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -312,7 +309,7 @@ func (client *VmmServersClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +326,7 @@ func (client *VmmServersClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - List of VmmServers in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - options - VmmServersClientListBySubscriptionOptions contains the optional parameters for the VmmServersClient.NewListBySubscriptionPager // method. func (client *VmmServersClient) NewListBySubscriptionPager(options *VmmServersClientListBySubscriptionOptions) *runtime.Pager[VmmServersClientListBySubscriptionResponse] { @@ -356,7 +353,7 @@ func (client *VmmServersClient) NewListBySubscriptionPager(options *VmmServersCl } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *VmmServersClient) listBySubscriptionCreateRequest(ctx context.Context, options *VmmServersClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *VmmServersClient) listBySubscriptionCreateRequest(ctx context.Context, _ *VmmServersClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ScVmm/vmmServers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -367,7 +364,7 @@ func (client *VmmServersClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +382,7 @@ func (client *VmmServersClient) listBySubscriptionHandleResponse(resp *http.Resp // BeginUpdate - Updates the VmmServers resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - properties - The resource properties to be updated. @@ -411,7 +408,7 @@ func (client *VmmServersClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates the VmmServers resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2025-03-13 func (client *VmmServersClient) update(ctx context.Context, resourceGroupName string, vmmServerName string, properties VmmServerTagsUpdate, options *VmmServersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VmmServersClient.BeginUpdate" @@ -434,7 +431,7 @@ func (client *VmmServersClient) update(ctx context.Context, resourceGroupName st } // updateCreateRequest creates the Update request. -func (client *VmmServersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, properties VmmServerTagsUpdate, options *VmmServersClientBeginUpdateOptions) (*policy.Request, error) { +func (client *VmmServersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmmServerName string, properties VmmServerTagsUpdate, _ *VmmServersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -453,7 +450,7 @@ func (client *VmmServersClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2025-03-13") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go deleted file mode 100644 index e440882550b1..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go +++ /dev/null @@ -1,528 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MaximumSet_Gen.json -func ExampleVmmServersClient_NewListBySubscriptionPager_vmmServersListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListBySubscriptionPager(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.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MinimumSet_Gen.json -func ExampleVmmServersClient_NewListBySubscriptionPager_vmmServersListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListBySubscriptionPager(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.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MaximumSet_Gen.json -func ExampleVmmServersClient_NewListByResourceGroupPager_vmmServersListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListByResourceGroupPager("rgscvmm", 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.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MinimumSet_Gen.json -func ExampleVmmServersClient_NewListByResourceGroupPager_vmmServersListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListByResourceGroupPager("rgscvmm", 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.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen.json -func ExampleVmmServersClient_Get_vmmServersGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVmmServersClient().Get(ctx, "rgscvmm", ".", 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.VmmServer = armscvmm.VmmServer{ - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MinimumSet_Gen.json -func ExampleVmmServersClient_Get_vmmServersGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVmmServersClient().Get(ctx, "rgscvmm", "D", 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.VmmServer = armscvmm.VmmServer{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVmmServersClient_BeginCreateOrUpdate_vmmServersCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.VmmServer{ - Location: to.Ptr("hslxkyzktvwpqbypvs"), - Tags: map[string]*string{ - "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VmmServerProperties{ - Credentials: &armscvmm.VmmCredential{ - Password: to.Ptr("gaecsnkjr"), - Username: to.Ptr("jbuoltypmrgqfi"), - }, - Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - Port: 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.VmmServer = armscvmm.VmmServer{ - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVmmServersClient_BeginCreateOrUpdate_vmmServersCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginCreateOrUpdate(ctx, "rgscvmm", "w", armscvmm.VmmServer{ - Location: to.Ptr("hslxkyzktvwpqbypvs"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, 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.VmmServer = armscvmm.VmmServer{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen.json -func ExampleVmmServersClient_BeginUpdate_vmmServersUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginUpdate(ctx, "rgscvmm", "Y", armscvmm.VmmServerTagsUpdate{ - Tags: map[string]*string{ - "key7187": to.Ptr("oktnfvklfchnquelzzdagtpwfskzc"), - }, - }, 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.VmmServer = armscvmm.VmmServer{ - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MinimumSet_Gen.json -func ExampleVmmServersClient_BeginUpdate_vmmServersUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginUpdate(ctx, "rgscvmm", "_", armscvmm.VmmServerTagsUpdate{}, 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.VmmServer = armscvmm.VmmServer{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen.json -func ExampleVmmServersClient_BeginDelete_vmmServersDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginDelete(ctx, "rgscvmm", ".", &armscvmm.VmmServersClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MinimumSet_Gen.json -func ExampleVmmServersClient_BeginDelete_vmmServersDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginDelete(ctx, "rgscvmm", "8", &armscvmm.VmmServersClientBeginDeleteOptions{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) - } -}