From 281bbd2006f1c0cacd4cca08a104f910b818c764 Mon Sep 17 00:00:00 2001 From: ReleaseHelper Date: Wed, 8 Mar 2023 01:08:05 +0000 Subject: [PATCH 1/7] [Release] sdk/resourcemanager/netapp/armnetapp/4.0.0 generation from spec commit: 1e7b408f3323e7f5424745718fe62c7a043a2337 --- .../netapp/armnetapp/CHANGELOG.md | 36 + .../netapp/armnetapp/accountbackups_client.go | 49 +- .../accountbackups_client_example_test.go | 48 +- .../netapp/armnetapp/accounts_client.go | 101 +- .../armnetapp/accounts_client_example_test.go | 135 +- .../netapp/armnetapp/autorest.md | 6 +- .../netapp/armnetapp/backuppolicies_client.go | 89 +- .../backuppolicies_client_example_test.go | 97 +- .../netapp/armnetapp/backups_client.go | 217 ++- .../armnetapp/backups_client_example_test.go | 140 +- .../netapp/armnetapp/constants.go | 47 +- sdk/resourcemanager/netapp/armnetapp/go.mod | 24 +- sdk/resourcemanager/netapp/armnetapp/go.sum | 48 +- .../netapp/armnetapp/models.go | 208 ++- .../netapp/armnetapp/models_serde.go | 510 +++--- .../netapp/armnetapp/operations_client.go | 11 +- .../operations_client_example_test.go | 1559 ++++++++++++++++- .../netapp/armnetapp/pools_client.go | 85 +- .../armnetapp/pools_client_example_test.go | 90 +- .../netapp/armnetapp/resource_client.go | 57 +- .../armnetapp/resource_client_example_test.go | 40 +- .../armnetapp/resourcequotalimits_client.go | 29 +- ...resourcequotalimits_client_example_test.go | 101 +- .../netapp/armnetapp/response_types.go | 133 +- .../armnetapp/snapshotpolicies_client.go | 100 +- .../snapshotpolicies_client_example_test.go | 179 +- .../netapp/armnetapp/snapshots_client.go | 133 +- .../snapshots_client_example_test.go | 66 +- .../netapp/armnetapp/subvolumes_client.go | 126 +- .../subvolumes_client_example_test.go | 85 +- .../netapp/armnetapp/time_rfc3339.go | 2 +- .../netapp/armnetapp/vaults_client.go | 119 -- .../armnetapp/vaults_client_example_test.go | 41 - .../netapp/armnetapp/volumegroups_client.go | 71 +- .../volumegroups_client_example_test.go | 144 +- .../armnetapp/volumequotarules_client.go | 113 +- .../volumequotarules_client_example_test.go | 80 +- .../netapp/armnetapp/volumes_client.go | 450 +++-- .../armnetapp/volumes_client_example_test.go | 195 ++- 39 files changed, 4301 insertions(+), 1463 deletions(-) delete mode 100644 sdk/resourcemanager/netapp/armnetapp/vaults_client.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/vaults_client_example_test.go diff --git a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md index d478f074ffeb..96970c993ea1 100644 --- a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md +++ b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md @@ -1,5 +1,41 @@ # Release History +## 4.0.0 (2023-03-24) +### Breaking Changes + +- Function `*SnapshotsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, string, interface{}, *SnapshotsClientBeginUpdateOptions)` to `(context.Context, string, string, string, string, string, any, *SnapshotsClientBeginUpdateOptions)` +- Type of `Account.Identity` has been changed from `*Identity` to `*ManagedServiceIdentity` +- Type alias `IdentityType` has been removed +- Function `NewVaultsClient` has been removed +- Function `*VaultsClient.NewListPager` has been removed +- Struct `Identity` has been removed +- Struct `Vault` has been removed +- Struct `VaultList` has been removed +- Struct `VaultProperties` has been removed +- Struct `VaultsClient` has been removed +- Field `VaultID` of struct `VolumeBackupProperties` has been removed + +### Features Added + +- New type alias `FileAccessLogs` with values `FileAccessLogsDisabled`, `FileAccessLogsEnabled` +- New type alias `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` +- New function `*BackupsClient.BeginRestoreFiles(context.Context, string, string, string, string, string, BackupRestoreFiles, *BackupsClientBeginRestoreFilesOptions) (*runtime.Poller[BackupsClientRestoreFilesResponse], error)` +- New function `*VolumesClient.BeginBreakFileLocks(context.Context, string, string, string, string, *VolumesClientBeginBreakFileLocksOptions) (*runtime.Poller[VolumesClientBreakFileLocksResponse], error)` +- New struct `BackupRestoreFiles` +- New struct `BreakFileLocksRequest` +- New struct `ManagedServiceIdentity` +- New struct `VolumeRelocationProperties` +- New field `PreferredServersForLdapClient` in struct `ActiveDirectory` +- New field `SystemData` in struct `Backup` +- New field `SystemData` in struct `Snapshot` +- New field `DataStoreResourceID` in struct `VolumeProperties` +- New field `FileAccessLogs` in struct `VolumeProperties` +- New field `IsLargeVolume` in struct `VolumeProperties` +- New field `ProvisionedAvailabilityZone` in struct `VolumeProperties` +- New field `VolumeRelocation` in struct `VolumePropertiesDataProtection` +- New field `Tags` in struct `VolumeQuotaRulePatch` + + ## 3.0.0 (2022-09-16) ### Breaking Changes diff --git a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go index 3078a1366d49..6c87297f175c 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go @@ -32,10 +32,9 @@ type AccountBackupsClient struct { } // NewAccountBackupsClient creates a new instance of AccountBackupsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAccountBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountBackupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +57,13 @@ func NewAccountBackupsClient(subscriptionID string, credential azcore.TokenCrede // BeginDelete - Delete the specified Backup for a Netapp Account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// backupName - The name of the backup -// options - AccountBackupsClientBeginDeleteOptions contains the optional parameters for the AccountBackupsClient.BeginDelete -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - backupName - The name of the backup +// - options - AccountBackupsClientBeginDeleteOptions contains the optional parameters for the AccountBackupsClient.BeginDelete +// method. func (client *AccountBackupsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *AccountBackupsClientBeginDeleteOptions) (*runtime.Poller[AccountBackupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, backupName, options) @@ -80,7 +80,8 @@ func (client *AccountBackupsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete the specified Backup for a Netapp Account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *AccountBackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *AccountBackupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, backupName, options) if err != nil { @@ -120,18 +121,19 @@ func (client *AccountBackupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets the specified backup for a Netapp Account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// backupName - The name of the backup -// options - AccountBackupsClientGetOptions contains the optional parameters for the AccountBackupsClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - backupName - The name of the backup +// - options - AccountBackupsClientGetOptions contains the optional parameters for the AccountBackupsClient.Get method. func (client *AccountBackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *AccountBackupsClientGetOptions) (AccountBackupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, backupName, options) if err != nil { @@ -171,7 +173,7 @@ func (client *AccountBackupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,10 +189,11 @@ func (client *AccountBackupsClient) getHandleResponse(resp *http.Response) (Acco } // NewListPager - List all Backups for a Netapp Account -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// options - AccountBackupsClientListOptions contains the optional parameters for the AccountBackupsClient.List method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - options - AccountBackupsClientListOptions contains the optional parameters for the AccountBackupsClient.NewListPager method. func (client *AccountBackupsClient) NewListPager(resourceGroupName string, accountName string, options *AccountBackupsClientListOptions) *runtime.Pager[AccountBackupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AccountBackupsClientListResponse]{ More: func(page AccountBackupsClientListResponse) bool { @@ -233,7 +236,7 @@ func (client *AccountBackupsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go index eafd6e6aff11..10779412e2ad 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_Account_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Backups_Account_List.json func ExampleAccountBackupsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,18 +30,35 @@ func ExampleAccountBackupsClient_NewListPager() { } pager := client.NewListPager("myRG", "account1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.BackupsList = armnetapp.BackupsList{ + // Value: []*armnetapp.Backup{ + // { + // Name: to.Ptr("account1/backup1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/accountBackups/backup1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.BackupProperties{ + // BackupType: to.Ptr(armnetapp.BackupTypeManual), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // Label: to.Ptr("myLabel"), + // ProvisioningState: to.Ptr("Succeeded"), + // Size: to.Ptr[int64](10011), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_Account_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Backups_Account_Get.json func ExampleAccountBackupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -55,11 +73,25 @@ func ExampleAccountBackupsClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.Backup = armnetapp.Backup{ + // Name: to.Ptr("account1/backup1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/accountBackups/backup1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.BackupProperties{ + // BackupType: to.Ptr(armnetapp.BackupTypeManual), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // Label: to.Ptr("myLabel"), + // ProvisioningState: to.Ptr("Succeeded"), + // Size: to.Ptr[int64](10011), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_Account_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Backups_Account_Delete.json func ExampleAccountBackupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/netapp/armnetapp/accounts_client.go b/sdk/resourcemanager/netapp/armnetapp/accounts_client.go index d829d167f7e4..60b1427bbcba 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accounts_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/accounts_client.go @@ -32,10 +32,9 @@ type AccountsClient struct { } // NewAccountsClient creates a new instance of AccountsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +57,13 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update the specified NetApp account within the resource group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// body - NetApp Account object supplied in the body of the operation. -// options - AccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the AccountsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - body - NetApp Account object supplied in the body of the operation. +// - options - AccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the AccountsClient.BeginCreateOrUpdate +// method. func (client *AccountsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, body Account, options *AccountsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AccountsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, body, options) @@ -80,7 +80,8 @@ func (client *AccountsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update the specified NetApp account within the resource group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *AccountsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, body Account, options *AccountsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, body, options) if err != nil { @@ -116,7 +117,7 @@ func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -124,10 +125,11 @@ func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// options - AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - options - AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*runtime.Poller[AccountsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, options) @@ -144,7 +146,8 @@ func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *AccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -180,17 +183,18 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get the NetApp account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// options - AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - options - AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. func (client *AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetOptions) (AccountsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -226,7 +230,7 @@ func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,9 +246,10 @@ func (client *AccountsClient) getHandleResponse(resp *http.Response) (AccountsCl } // NewListPager - List and describe all NetApp accounts in the resource group. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// options - AccountsClientListOptions contains the optional parameters for the AccountsClient.List method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. func (client *AccountsClient) NewListPager(resourceGroupName string, options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AccountsClientListResponse]{ More: func(page AccountsClientListResponse) bool { @@ -289,7 +294,7 @@ func (client *AccountsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,9 +310,10 @@ func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsC } // NewListBySubscriptionPager - List and describe all NetApp accounts in the subscription. -// Generated from API version 2022-05-01 -// options - AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.ListBySubscription -// method. +// +// Generated from API version 2022-09-01 +// - options - AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.NewListBySubscriptionPager +// method. func (client *AccountsClient) NewListBySubscriptionPager(options *AccountsClientListBySubscriptionOptions) *runtime.Pager[AccountsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[AccountsClientListBySubscriptionResponse]{ More: func(page AccountsClientListBySubscriptionResponse) bool { @@ -348,7 +354,7 @@ func (client *AccountsClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,11 +373,12 @@ func (client *AccountsClient) listBySubscriptionHandleResponse(resp *http.Respon // encryption. If encryption.identity.principalId does not match identity.principalId, running this // operation will fix it. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// options - AccountsClientBeginRenewCredentialsOptions contains the optional parameters for the AccountsClient.BeginRenewCredentials -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - options - AccountsClientBeginRenewCredentialsOptions contains the optional parameters for the AccountsClient.BeginRenewCredentials +// method. func (client *AccountsClient) BeginRenewCredentials(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginRenewCredentialsOptions) (*runtime.Poller[AccountsClientRenewCredentialsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.renewCredentials(ctx, resourceGroupName, accountName, options) @@ -390,7 +397,8 @@ func (client *AccountsClient) BeginRenewCredentials(ctx context.Context, resourc // If encryption.identity.principalId does not match identity.principalId, running this // operation will fix it. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *AccountsClient) renewCredentials(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginRenewCredentialsOptions) (*http.Response, error) { req, err := client.renewCredentialsCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -425,16 +433,20 @@ func (client *AccountsClient) renewCredentialsCreateRequest(ctx context.Context, if err != nil { return nil, err } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginUpdate - Patch the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// body - NetApp Account object supplied in the body of the operation. -// options - AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - body - NetApp Account object supplied in the body of the operation. +// - options - AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, body AccountPatch, options *AccountsClientBeginUpdateOptions) (*runtime.Poller[AccountsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, body, options) @@ -451,7 +463,8 @@ func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Patch the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *AccountsClient) update(ctx context.Context, resourceGroupName string, accountName string, body AccountPatch, options *AccountsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, body, options) if err != nil { @@ -487,7 +500,7 @@ func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go index ee7c8d130371..502ffce0488c 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Accounts_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Accounts_List.json func ExampleAccountsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,18 +31,31 @@ func ExampleAccountsClient_NewListBySubscriptionPager() { } pager := client.NewListBySubscriptionPager(nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.AccountList = armnetapp.AccountList{ + // Value: []*armnetapp.Account{ + // { + // Name: to.Ptr("account1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.AccountProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Accounts_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Accounts_Get.json func ExampleAccountsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,12 +70,72 @@ func ExampleAccountsClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.Account = armnetapp.Account{ + // Name: to.Ptr("account1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.AccountProperties{ + // ActiveDirectories: []*armnetapp.ActiveDirectory{ + // { + // ActiveDirectoryID: to.Ptr("02da3711-6c58-2d64-098a-e3af7afaf936"), + // AesEncryption: to.Ptr(true), + // DNS: to.Ptr("10.10.10.3, 10.10.10.4"), + // Domain: to.Ptr("10.10.10.3"), + // LdapSigning: to.Ptr(true), + // OrganizationalUnit: to.Ptr("OU=Engineering"), + // Site: to.Ptr("SiteName"), + // SmbServerName: to.Ptr("SMBServer"), + // Status: to.Ptr(armnetapp.ActiveDirectoryStatusInUse), + // StatusDetails: to.Ptr("Status Details"), + // Username: to.Ptr("ad_user_name"), + // }}, + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Accounts_CreateOrUpdate.json -func ExampleAccountsClient_BeginCreateOrUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Accounts_CreateOrUpdate.json +func ExampleAccountsClient_BeginCreateOrUpdate_accountsCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armnetapp.NewAccountsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, "myRG", "account1", armnetapp.Account{ + Location: to.Ptr("eastus"), + Properties: &armnetapp.AccountProperties{}, + }, 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.Account = armnetapp.Account{ + // Name: to.Ptr("account1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.AccountProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Accounts_CreateOrUpdateAD.json +func ExampleAccountsClient_BeginCreateOrUpdate_accountsCreateOrUpdateWithActiveDirectory() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -96,11 +170,34 @@ func ExampleAccountsClient_BeginCreateOrUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.Account = armnetapp.Account{ + // Name: to.Ptr("account1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.AccountProperties{ + // ActiveDirectories: []*armnetapp.ActiveDirectory{ + // { + // ActiveDirectoryID: to.Ptr("503d38f9-f17c-f92d-ef26-b0d46374534b"), + // AesEncryption: to.Ptr(true), + // DNS: to.Ptr("10.10.10.3, 10.10.10.4"), + // Domain: to.Ptr("10.10.10.3"), + // LdapOverTLS: to.Ptr(false), + // LdapSigning: to.Ptr(false), + // OrganizationalUnit: to.Ptr("OU=Engineering"), + // Site: to.Ptr("SiteName"), + // SmbServerName: to.Ptr("SMBServer"), + // Username: to.Ptr("ad_user_name"), + // }}, + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Accounts_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Accounts_Delete.json func ExampleAccountsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -121,7 +218,7 @@ func ExampleAccountsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Accounts_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Accounts_Update.json func ExampleAccountsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -144,11 +241,21 @@ func ExampleAccountsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.Account = armnetapp.Account{ + // Name: to.Ptr("account1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.AccountProperties{ + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Accounts_RenewCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Accounts_RenewCredentials.json func ExampleAccountsClient_BeginRenewCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/netapp/armnetapp/autorest.md b/sdk/resourcemanager/netapp/armnetapp/autorest.md index f9a4dc238fbe..a781f50d84b7 100644 --- a/sdk/resourcemanager/netapp/armnetapp/autorest.md +++ b/sdk/resourcemanager/netapp/armnetapp/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/0507c3d410681049bb5cd9545b49a7578a91d3d0/specification/netapp/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0507c3d410681049bb5cd9545b49a7578a91d3d0/specification/netapp/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.0.0 +module-version: 4.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go index 9d3cd0911a66..aee42da4a0fe 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go @@ -32,10 +32,9 @@ type BackupPoliciesClient struct { } // NewBackupPoliciesClient creates a new instance of BackupPoliciesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +57,14 @@ func NewBackupPoliciesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreate - Create a backup policy for Netapp Account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// backupPolicyName - Backup policy Name which uniquely identify backup policy. -// body - Backup policy object supplied in the body of the operation. -// options - BackupPoliciesClientBeginCreateOptions contains the optional parameters for the BackupPoliciesClient.BeginCreate -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - backupPolicyName - Backup policy Name which uniquely identify backup policy. +// - body - Backup policy object supplied in the body of the operation. +// - options - BackupPoliciesClientBeginCreateOptions contains the optional parameters for the BackupPoliciesClient.BeginCreate +// method. func (client *BackupPoliciesClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy, options *BackupPoliciesClientBeginCreateOptions) (*runtime.Poller[BackupPoliciesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, backupPolicyName, body, options) @@ -81,7 +81,8 @@ func (client *BackupPoliciesClient) BeginCreate(ctx context.Context, resourceGro // Create - Create a backup policy for Netapp Account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *BackupPoliciesClient) create(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy, options *BackupPoliciesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, backupPolicyName, body, options) if err != nil { @@ -121,7 +122,7 @@ func (client *BackupPoliciesClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -129,12 +130,13 @@ func (client *BackupPoliciesClient) createCreateRequest(ctx context.Context, res // BeginDelete - Delete backup policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// backupPolicyName - Backup policy Name which uniquely identify backup policy. -// options - BackupPoliciesClientBeginDeleteOptions contains the optional parameters for the BackupPoliciesClient.BeginDelete -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - backupPolicyName - Backup policy Name which uniquely identify backup policy. +// - options - BackupPoliciesClientBeginDeleteOptions contains the optional parameters for the BackupPoliciesClient.BeginDelete +// method. func (client *BackupPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, options *BackupPoliciesClientBeginDeleteOptions) (*runtime.Poller[BackupPoliciesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, backupPolicyName, options) @@ -151,7 +153,8 @@ func (client *BackupPoliciesClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete backup policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *BackupPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, options *BackupPoliciesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, backupPolicyName, options) if err != nil { @@ -191,18 +194,19 @@ func (client *BackupPoliciesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get a particular backup Policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// backupPolicyName - Backup policy Name which uniquely identify backup policy. -// options - BackupPoliciesClientGetOptions contains the optional parameters for the BackupPoliciesClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - backupPolicyName - Backup policy Name which uniquely identify backup policy. +// - options - BackupPoliciesClientGetOptions contains the optional parameters for the BackupPoliciesClient.Get method. func (client *BackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, options *BackupPoliciesClientGetOptions) (BackupPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, backupPolicyName, options) if err != nil { @@ -242,7 +246,7 @@ func (client *BackupPoliciesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,10 +262,11 @@ func (client *BackupPoliciesClient) getHandleResponse(resp *http.Response) (Back } // NewListPager - List backup policies for Netapp Account -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// options - BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.List method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - options - BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. func (client *BackupPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *BackupPoliciesClientListOptions) *runtime.Pager[BackupPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupPoliciesClientListResponse]{ More: func(page BackupPoliciesClientListResponse) bool { @@ -304,7 +309,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,13 +326,14 @@ func (client *BackupPoliciesClient) listHandleResponse(resp *http.Response) (Bac // BeginUpdate - Patch a backup policy for Netapp Account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// backupPolicyName - Backup policy Name which uniquely identify backup policy. -// body - Backup policy object supplied in the body of the operation. -// options - BackupPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupPoliciesClient.BeginUpdate -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - backupPolicyName - Backup policy Name which uniquely identify backup policy. +// - body - Backup policy object supplied in the body of the operation. +// - options - BackupPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupPoliciesClient.BeginUpdate +// method. func (client *BackupPoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch, options *BackupPoliciesClientBeginUpdateOptions) (*runtime.Poller[BackupPoliciesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, backupPolicyName, body, options) @@ -344,7 +350,8 @@ func (client *BackupPoliciesClient) BeginUpdate(ctx context.Context, resourceGro // Update - Patch a backup policy for Netapp Account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *BackupPoliciesClient) update(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch, options *BackupPoliciesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, backupPolicyName, body, options) if err != nil { @@ -384,7 +391,7 @@ func (client *BackupPoliciesClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go index 67a879aa0cc7..72b5b74116a4 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/BackupPolicies_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/BackupPolicies_List.json func ExampleBackupPoliciesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,18 +31,35 @@ func ExampleBackupPoliciesClient_NewListPager() { } pager := client.NewListPager("myRG", "account1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.BackupPoliciesList = armnetapp.BackupPoliciesList{ + // Value: []*armnetapp.BackupPolicy{ + // { + // Name: to.Ptr("account1/backupPolicy1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicy1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.BackupPolicyProperties{ + // DailyBackupsToKeep: to.Ptr[int32](10), + // Enabled: to.Ptr(true), + // MonthlyBackupsToKeep: to.Ptr[int32](10), + // VolumesAssigned: to.Ptr[int32](0), + // WeeklyBackupsToKeep: to.Ptr[int32](10), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/BackupPolicies_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/BackupPolicies_Get.json func ExampleBackupPoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,11 +74,31 @@ func ExampleBackupPoliciesClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.BackupPolicy = armnetapp.BackupPolicy{ + // Name: to.Ptr("account1/backupPolicyName"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicyName"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.BackupPolicyProperties{ + // DailyBackupsToKeep: to.Ptr[int32](10), + // Enabled: to.Ptr(true), + // MonthlyBackupsToKeep: to.Ptr[int32](10), + // VolumeBackups: []*armnetapp.VolumeBackups{ + // { + // BackupsCount: to.Ptr[int32](5), + // PolicyEnabled: to.Ptr(true), + // VolumeName: to.Ptr("volume 1"), + // }}, + // VolumesAssigned: to.Ptr[int32](0), + // WeeklyBackupsToKeep: to.Ptr[int32](10), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/BackupPolicies_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/BackupPolicies_Create.json func ExampleBackupPoliciesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -87,11 +125,25 @@ func ExampleBackupPoliciesClient_BeginCreate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.BackupPolicy = armnetapp.BackupPolicy{ + // Name: to.Ptr("account1/backupPolicyName"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicyName"), + // Location: to.Ptr("westus"), + // Properties: &armnetapp.BackupPolicyProperties{ + // DailyBackupsToKeep: to.Ptr[int32](10), + // Enabled: to.Ptr(true), + // MonthlyBackupsToKeep: to.Ptr[int32](10), + // ProvisioningState: to.Ptr("Succeeded"), + // WeeklyBackupsToKeep: to.Ptr[int32](10), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/BackupPolicies_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/BackupPolicies_Update.json func ExampleBackupPoliciesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,11 +170,32 @@ func ExampleBackupPoliciesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.BackupPolicy = armnetapp.BackupPolicy{ + // Name: to.Ptr("account1/backupPolicyName"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicyName"), + // Location: to.Ptr("westus"), + // Properties: &armnetapp.BackupPolicyProperties{ + // DailyBackupsToKeep: to.Ptr[int32](5), + // Enabled: to.Ptr(false), + // MonthlyBackupsToKeep: to.Ptr[int32](10), + // ProvisioningState: to.Ptr("Succeeded"), + // VolumeBackups: []*armnetapp.VolumeBackups{ + // { + // BackupsCount: to.Ptr[int32](5), + // PolicyEnabled: to.Ptr(true), + // VolumeName: to.Ptr("volume 1"), + // }}, + // VolumesAssigned: to.Ptr[int32](1), + // WeeklyBackupsToKeep: to.Ptr[int32](10), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/BackupPolicies_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/BackupPolicies_Delete.json func ExampleBackupPoliciesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/netapp/armnetapp/backups_client.go b/sdk/resourcemanager/netapp/armnetapp/backups_client.go index d6840deb7d98..886cef2bc065 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/backups_client.go @@ -32,10 +32,9 @@ type BackupsClient struct { } // NewBackupsClient creates a new instance of BackupsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +57,15 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Create a backup for the volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// backupName - The name of the backup -// body - Backup object supplied in the body of the operation. -// options - BackupsClientBeginCreateOptions contains the optional parameters for the BackupsClient.BeginCreate method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - backupName - The name of the backup +// - body - Backup object supplied in the body of the operation. +// - options - BackupsClientBeginCreateOptions contains the optional parameters for the BackupsClient.BeginCreate method. func (client *BackupsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup, options *BackupsClientBeginCreateOptions) (*runtime.Poller[BackupsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) @@ -82,7 +82,8 @@ func (client *BackupsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Create a backup for the volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *BackupsClient) create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup, options *BackupsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) if err != nil { @@ -130,7 +131,7 @@ func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -138,13 +139,14 @@ func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Delete a backup of the volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// backupName - The name of the backup -// options - BackupsClientBeginDeleteOptions contains the optional parameters for the BackupsClient.BeginDelete method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - backupName - The name of the backup +// - options - BackupsClientBeginDeleteOptions contains the optional parameters for the BackupsClient.BeginDelete method. func (client *BackupsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, options *BackupsClientBeginDeleteOptions) (*runtime.Poller[BackupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, options) @@ -161,7 +163,8 @@ func (client *BackupsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a backup of the volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *BackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, options *BackupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, options) if err != nil { @@ -209,20 +212,21 @@ func (client *BackupsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets the specified backup of the volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// backupName - The name of the backup -// options - BackupsClientGetOptions contains the optional parameters for the BackupsClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - backupName - The name of the backup +// - options - BackupsClientGetOptions contains the optional parameters for the BackupsClient.Get method. func (client *BackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, options *BackupsClientGetOptions) (BackupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, options) if err != nil { @@ -270,7 +274,7 @@ func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,12 +291,13 @@ func (client *BackupsClient) getHandleResponse(resp *http.Response) (BackupsClie // GetStatus - Get the status of the backup for a volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - BackupsClientGetStatusOptions contains the optional parameters for the BackupsClient.GetStatus method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - BackupsClientGetStatusOptions contains the optional parameters for the BackupsClient.GetStatus method. func (client *BackupsClient) GetStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientGetStatusOptions) (BackupsClientGetStatusResponse, error) { req, err := client.getStatusCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -336,7 +341,7 @@ func (client *BackupsClient) getStatusCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,13 +358,14 @@ func (client *BackupsClient) getStatusHandleResponse(resp *http.Response) (Backu // GetVolumeRestoreStatus - Get the status of the restore for a volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - BackupsClientGetVolumeRestoreStatusOptions contains the optional parameters for the BackupsClient.GetVolumeRestoreStatus -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - BackupsClientGetVolumeRestoreStatusOptions contains the optional parameters for the BackupsClient.GetVolumeRestoreStatus +// method. func (client *BackupsClient) GetVolumeRestoreStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientGetVolumeRestoreStatusOptions) (BackupsClientGetVolumeRestoreStatusResponse, error) { req, err := client.getVolumeRestoreStatusCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -403,7 +409,7 @@ func (client *BackupsClient) getVolumeRestoreStatusCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -419,12 +425,13 @@ func (client *BackupsClient) getVolumeRestoreStatusHandleResponse(resp *http.Res } // NewListPager - List all backups for a volume -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - BackupsClientListOptions contains the optional parameters for the BackupsClient.List method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - BackupsClientListOptions contains the optional parameters for the BackupsClient.NewListPager method. func (client *BackupsClient) NewListPager(resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientListOptions) *runtime.Pager[BackupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupsClientListResponse]{ More: func(page BackupsClientListResponse) bool { @@ -475,7 +482,7 @@ func (client *BackupsClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -490,16 +497,99 @@ func (client *BackupsClient) listHandleResponse(resp *http.Response) (BackupsCli return result, nil } +// BeginRestoreFiles - Restore the specified files from the specified backup to the active filesystem +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - backupName - The name of the backup +// - body - Restore payload supplied in the body of the operation. +// - options - BackupsClientBeginRestoreFilesOptions contains the optional parameters for the BackupsClient.BeginRestoreFiles +// method. +func (client *BackupsClient) BeginRestoreFiles(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupRestoreFiles, options *BackupsClientBeginRestoreFilesOptions) (*runtime.Poller[BackupsClientRestoreFilesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.restoreFiles(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BackupsClientRestoreFilesResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[BackupsClientRestoreFilesResponse](options.ResumeToken, client.pl, nil) + } +} + +// RestoreFiles - Restore the specified files from the specified backup to the active filesystem +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *BackupsClient) restoreFiles(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupRestoreFiles, options *BackupsClientBeginRestoreFilesOptions) (*http.Response, error) { + req, err := client.restoreFilesCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// restoreFilesCreateRequest creates the RestoreFiles request. +func (client *BackupsClient) restoreFilesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupRestoreFiles, options *BackupsClientBeginRestoreFilesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}/restoreFiles" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if volumeName == "" { + return nil, errors.New("parameter volumeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) + if backupName == "" { + return nil, errors.New("parameter backupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, body) +} + // BeginUpdate - Patch a backup for the volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// backupName - The name of the backup -// body - Backup object supplied in the body of the operation. -// options - BackupsClientBeginUpdateOptions contains the optional parameters for the BackupsClient.BeginUpdate method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - backupName - The name of the backup +// - body - Backup object supplied in the body of the operation. +// - options - BackupsClientBeginUpdateOptions contains the optional parameters for the BackupsClient.BeginUpdate method. func (client *BackupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupPatch, options *BackupsClientBeginUpdateOptions) (*runtime.Poller[BackupsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) @@ -516,7 +606,8 @@ func (client *BackupsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Patch a backup for the volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *BackupsClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupPatch, options *BackupsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) if err != nil { @@ -564,7 +655,7 @@ func (client *BackupsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go index 0914c0c868a4..3449d3bfead9 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_BackupStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_BackupStatus.json func ExampleBackupsClient_GetStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -32,11 +33,22 @@ func ExampleBackupsClient_GetStatus() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.BackupStatus = armnetapp.BackupStatus{ + // ErrorMessage: to.Ptr(""), + // Healthy: to.Ptr(true), + // LastTransferSize: to.Ptr[int64](100000), + // LastTransferType: to.Ptr(""), + // MirrorState: to.Ptr(armnetapp.MirrorStateMirrored), + // RelationshipStatus: to.Ptr(armnetapp.RelationshipStatusIdle), + // TotalTransferBytes: to.Ptr[int64](100000), + // UnhealthyReason: to.Ptr(""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_RestoreStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_RestoreStatus.json func ExampleBackupsClient_GetVolumeRestoreStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -51,11 +63,20 @@ func ExampleBackupsClient_GetVolumeRestoreStatus() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.RestoreStatus = armnetapp.RestoreStatus{ + // ErrorMessage: to.Ptr(""), + // Healthy: to.Ptr(true), + // MirrorState: to.Ptr(armnetapp.MirrorStateUninitialized), + // RelationshipStatus: to.Ptr(armnetapp.RelationshipStatusIdle), + // TotalTransferBytes: to.Ptr[int64](100000), + // UnhealthyReason: to.Ptr(""), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Backups_List.json func ExampleBackupsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,18 +89,35 @@ func ExampleBackupsClient_NewListPager() { } pager := client.NewListPager("myRG", "account1", "pool1", "volume1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.BackupsList = armnetapp.BackupsList{ + // Value: []*armnetapp.Backup{ + // { + // Name: to.Ptr("account1/pool1/volume1/backup1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/backups/backup1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.BackupProperties{ + // BackupType: to.Ptr(armnetapp.BackupTypeManual), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // Label: to.Ptr("myLabel"), + // ProvisioningState: to.Ptr("Succeeded"), + // Size: to.Ptr[int64](10011), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Backups_Get.json func ExampleBackupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,11 +132,25 @@ func ExampleBackupsClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.Backup = armnetapp.Backup{ + // Name: to.Ptr("account1/pool1/volume1/backup1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/backups/backup1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.BackupProperties{ + // BackupType: to.Ptr(armnetapp.BackupTypeManual), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // Label: to.Ptr("myLabel"), + // ProvisioningState: to.Ptr("Succeeded"), + // Size: to.Ptr[int64](10011), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Backups_Create.json func ExampleBackupsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -122,11 +174,25 @@ func ExampleBackupsClient_BeginCreate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.Backup = armnetapp.Backup{ + // Name: to.Ptr("account1/pool1/volume1/backup1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/backups/backup1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.BackupProperties{ + // BackupType: to.Ptr(armnetapp.BackupTypeManual), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // Label: to.Ptr("myLabel"), + // ProvisioningState: to.Ptr("Succeeded"), + // Size: to.Ptr[int64](10011), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Backups_Update.json func ExampleBackupsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +203,7 @@ func ExampleBackupsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupPatch{}, &armnetapp.BackupsClientBeginUpdateOptions{}) + poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupPatch{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -145,11 +211,25 @@ func ExampleBackupsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.Backup = armnetapp.Backup{ + // Name: to.Ptr("account1/pool1/volume1/backup1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/backups/backup1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.BackupProperties{ + // BackupType: to.Ptr(armnetapp.BackupTypeManual), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // Label: to.Ptr("myLabel"), + // ProvisioningState: to.Ptr("Succeeded"), + // Size: to.Ptr[int64](10011), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Backups_Delete.json func ExampleBackupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -169,3 +249,29 @@ func ExampleBackupsClient_BeginDelete() { log.Fatalf("failed to pull the result: %v", err) } } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Backups_SingleFileRestore.json +func ExampleBackupsClient_BeginRestoreFiles() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armnetapp.NewBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginRestoreFiles(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupRestoreFiles{ + DestinationVolumeID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), + FileList: []*string{ + to.Ptr("/dir1/customer1.db"), + to.Ptr("/dir1/customer2.db")}, + }, 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/netapp/armnetapp/constants.go b/sdk/resourcemanager/netapp/armnetapp/constants.go index 5e83b7ebaff0..0f381ccf4510 100644 --- a/sdk/resourcemanager/netapp/armnetapp/constants.go +++ b/sdk/resourcemanager/netapp/armnetapp/constants.go @@ -11,7 +11,7 @@ package armnetapp const ( moduleName = "armnetapp" - moduleVersion = "v3.0.0" + moduleVersion = "v4.0.0" ) // ActiveDirectoryStatus - Status of the Active Directory @@ -242,23 +242,22 @@ func PossibleEndpointTypeValues() []EndpointType { } } -// IdentityType - The identity type. -type IdentityType string +// FileAccessLogs - Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings +// present on the volume. +type FileAccessLogs string const ( - IdentityTypeNone IdentityType = "None" - IdentityTypeSystemAssigned IdentityType = "SystemAssigned" - IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned" - IdentityTypeUserAssigned IdentityType = "UserAssigned" + // FileAccessLogsDisabled - fileAccessLogs are not enabled + FileAccessLogsDisabled FileAccessLogs = "Disabled" + // FileAccessLogsEnabled - fileAccessLogs are enabled + FileAccessLogsEnabled FileAccessLogs = "Enabled" ) -// PossibleIdentityTypeValues returns the possible values for the IdentityType const type. -func PossibleIdentityTypeValues() []IdentityType { - return []IdentityType{ - IdentityTypeNone, - IdentityTypeSystemAssigned, - IdentityTypeSystemAssignedUserAssigned, - IdentityTypeUserAssigned, +// PossibleFileAccessLogsValues returns the possible values for the FileAccessLogs const type. +func PossibleFileAccessLogsValues() []FileAccessLogs { + return []FileAccessLogs{ + FileAccessLogsDisabled, + FileAccessLogsEnabled, } } @@ -324,6 +323,26 @@ func PossibleKeyVaultStatusValues() []KeyVaultStatus { } } +// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +type ManagedServiceIdentityType string + +const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeUserAssigned, + } +} + type MetricAggregationType string const ( diff --git a/sdk/resourcemanager/netapp/armnetapp/go.mod b/sdk/resourcemanager/netapp/armnetapp/go.mod index c7e03a251b2a..f382f75fd8e4 100644 --- a/sdk/resourcemanager/netapp/armnetapp/go.mod +++ b/sdk/resourcemanager/netapp/armnetapp/go.mod @@ -1,21 +1,21 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v3 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4 go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect - golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect - golang.org/x/text v0.3.7 // indirect + github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + golang.org/x/crypto v0.6.0 // indirect + golang.org/x/net v0.7.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect ) diff --git a/sdk/resourcemanager/netapp/armnetapp/go.sum b/sdk/resourcemanager/netapp/armnetapp/go.sum index 8828b17b1853..8ba445a8c4da 100644 --- a/sdk/resourcemanager/netapp/armnetapp/go.sum +++ b/sdk/resourcemanager/netapp/armnetapp/go.sum @@ -1,33 +1,31 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= +github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/netapp/armnetapp/models.go b/sdk/resourcemanager/netapp/armnetapp/models.go index 19c79426fbab..de8ddf3ebd24 100644 --- a/sdk/resourcemanager/netapp/armnetapp/models.go +++ b/sdk/resourcemanager/netapp/armnetapp/models.go @@ -16,8 +16,8 @@ type Account struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The identity of the resource. - Identity *Identity `json:"identity,omitempty"` + // The identity used for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` // NetApp Account properties Properties *AccountProperties `json:"properties,omitempty"` @@ -52,7 +52,7 @@ type AccountBackupsClientGetOptions struct { // placeholder for future optional parameters } -// AccountBackupsClientListOptions contains the optional parameters for the AccountBackupsClient.List method. +// AccountBackupsClientListOptions contains the optional parameters for the AccountBackupsClient.NewListPager method. type AccountBackupsClientListOptions struct { // placeholder for future optional parameters } @@ -144,12 +144,13 @@ type AccountsClientGetOptions struct { // placeholder for future optional parameters } -// AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.ListBySubscription method. +// AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.NewListBySubscriptionPager +// method. type AccountsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// AccountsClientListOptions contains the optional parameters for the AccountsClient.List method. +// AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. type AccountsClientListOptions struct { // placeholder for future optional parameters } @@ -202,6 +203,10 @@ type ActiveDirectory struct { // Plain text password of Active Directory domain administrator, value is masked in the response Password *string `json:"password,omitempty"` + // Comma separated list of IPv4 addresses of preferred servers for LDAP client. At most two comma separated IPv4 addresses + // can be passed. + PreferredServersForLdapClient *string `json:"preferredServersForLdapClient,omitempty"` + // Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares // for SQL). A list of unique usernames without domain specifier SecurityOperators []*string `json:"securityOperators,omitempty"` @@ -217,7 +222,7 @@ type ActiveDirectory struct { // NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes SmbServerName *string `json:"smbServerName,omitempty"` - // Username of Active Directory domain administrator + // A domain user account with permission to create machine accounts Username *string `json:"username,omitempty"` // READ-ONLY; Status of the Active Directory @@ -241,13 +246,16 @@ type Backup struct { // REQUIRED; Backup Properties Properties *BackupProperties `json:"properties,omitempty"` - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Resource name + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Resource type + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } @@ -283,7 +291,7 @@ type BackupPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.List method. +// BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. type BackupPoliciesClientListOptions struct { // placeholder for future optional parameters } @@ -399,6 +407,20 @@ type BackupProperties struct { VolumeName *string `json:"volumeName,omitempty" azure:"ro"` } +// BackupRestoreFiles - Restore payload for single file backup restore +type BackupRestoreFiles struct { + // REQUIRED; Resource Id of the destination volume on which the files need to be restored + DestinationVolumeID *string `json:"destinationVolumeId,omitempty"` + + // REQUIRED; List of files to be restored + FileList []*string `json:"fileList,omitempty"` + + // Destination folder where the files will be restored. The path name should start with a forward slash. If it is omitted + // from request then restore is done at the root folder of the destination volume by + // default + RestoreFilePath *string `json:"restoreFilePath,omitempty"` +} + // BackupStatus - Backup status type BackupStatus struct { // READ-ONLY; Displays error message if the backup is in an error state @@ -438,6 +460,12 @@ type BackupsClientBeginDeleteOptions struct { ResumeToken string } +// BackupsClientBeginRestoreFilesOptions contains the optional parameters for the BackupsClient.BeginRestoreFiles method. +type BackupsClientBeginRestoreFilesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // BackupsClientBeginUpdateOptions contains the optional parameters for the BackupsClient.BeginUpdate method. type BackupsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -460,7 +488,7 @@ type BackupsClientGetVolumeRestoreStatusOptions struct { // placeholder for future optional parameters } -// BackupsClientListOptions contains the optional parameters for the BackupsClient.List method. +// BackupsClientListOptions contains the optional parameters for the BackupsClient.NewListPager method. type BackupsClientListOptions struct { // placeholder for future optional parameters } @@ -471,6 +499,16 @@ type BackupsList struct { Value []*Backup `json:"value,omitempty"` } +// BreakFileLocksRequest - Break file locks request +type BreakFileLocksRequest struct { + // To clear file locks on a volume for a particular client + ClientIP *string `json:"clientIp,omitempty"` + + // Break File locks could be a disruptive operation for application as locks on the volume will be broken, if want to process, + // set to true. + ConfirmRunningDisruptiveOperation *bool `json:"confirmRunningDisruptiveOperation,omitempty"` +} + // BreakReplicationRequest - Break replication request type BreakReplicationRequest struct { // If replication is in status transferring and you want to force break the replication, set to true @@ -654,23 +692,6 @@ type HourlySchedule struct { UsedBytes *int64 `json:"usedBytes,omitempty"` } -// Identity for the resource. -type Identity struct { - // REQUIRED; The identity type. - Type *IdentityType `json:"type,omitempty"` - - // Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage - // account. The key is the ARM resource identifier of the identity. Only 1 - // User Assigned identity is permitted here. - UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` - - // READ-ONLY; The principal ID of resource identity. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` - - // READ-ONLY; The tenant ID of resource. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` -} - // KeyVaultProperties - Properties of key vault. type KeyVaultProperties struct { // REQUIRED; The name of KeyVault key. @@ -716,6 +737,26 @@ type LogSpecification struct { Name *string `json:"name,omitempty"` } +// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type ManagedServiceIdentity struct { + // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + Type *ManagedServiceIdentityType `json:"type,omitempty"` + + // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + // resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + // The dictionary values can be empty objects ({}) in + // requests. + UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` + + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` +} + // MetricSpecification - Metric specification of operation. type MetricSpecification struct { // Aggregation type could be Average. @@ -843,7 +884,7 @@ type OperationProperties struct { ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -929,7 +970,7 @@ type PoolsClientGetOptions struct { // placeholder for future optional parameters } -// PoolsClientListOptions contains the optional parameters for the PoolsClient.List method. +// PoolsClientListOptions contains the optional parameters for the PoolsClient.NewListPager method. type PoolsClientListOptions struct { // placeholder for future optional parameters } @@ -1066,7 +1107,7 @@ type ResourceQuotaLimitsClientGetOptions struct { // placeholder for future optional parameters } -// ResourceQuotaLimitsClientListOptions contains the optional parameters for the ResourceQuotaLimitsClient.List method. +// ResourceQuotaLimitsClientListOptions contains the optional parameters for the ResourceQuotaLimitsClient.NewListPager method. type ResourceQuotaLimitsClientListOptions struct { // placeholder for future optional parameters } @@ -1109,13 +1150,16 @@ type Snapshot struct { // Snapshot Properties Properties *SnapshotProperties `json:"properties,omitempty"` - // READ-ONLY; Resource Id + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Resource name + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Resource type + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string `json:"type,omitempty" azure:"ro"` } @@ -1141,7 +1185,7 @@ type SnapshotPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// SnapshotPoliciesClientListOptions contains the optional parameters for the SnapshotPoliciesClient.List method. +// SnapshotPoliciesClientListOptions contains the optional parameters for the SnapshotPoliciesClient.NewListPager method. type SnapshotPoliciesClientListOptions struct { // placeholder for future optional parameters } @@ -1282,7 +1326,7 @@ type SnapshotsClientGetOptions struct { // placeholder for future optional parameters } -// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.List method. +// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. type SnapshotsClientListOptions struct { // placeholder for future optional parameters } @@ -1451,7 +1495,7 @@ type SubvolumesClientGetOptions struct { // placeholder for future optional parameters } -// SubvolumesClientListByVolumeOptions contains the optional parameters for the SubvolumesClient.ListByVolume method. +// SubvolumesClientListByVolumeOptions contains the optional parameters for the SubvolumesClient.NewListByVolumePager method. type SubvolumesClientListByVolumeOptions struct { // placeholder for future optional parameters } @@ -1486,47 +1530,15 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } -// UserAssignedIdentity for the resource. +// UserAssignedIdentity - User assigned identity properties type UserAssignedIdentity struct { - // READ-ONLY; The client ID of the identity. + // READ-ONLY; The client ID of the assigned identity. ClientID *string `json:"clientId,omitempty" azure:"ro"` - // READ-ONLY; The principal ID of the identity. + // READ-ONLY; The principal ID of the assigned identity. PrincipalID *string `json:"principalId,omitempty" azure:"ro"` } -// Vault information -type Vault struct { - // REQUIRED; Vault Properties - Properties *VaultProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource Id - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type - Type *string `json:"type,omitempty" azure:"ro"` -} - -// VaultList - List of Vaults -type VaultList struct { - // A list of vaults - Value []*Vault `json:"value,omitempty"` -} - -// VaultProperties - Vault properties -type VaultProperties struct { - // Vault Name - VaultName *string `json:"vaultName,omitempty"` -} - -// VaultsClientListOptions contains the optional parameters for the VaultsClient.List method. -type VaultsClientListOptions struct { - // placeholder for future optional parameters -} - // Volume resource type Volume struct { // REQUIRED; The geo-location where the resource lives @@ -1567,9 +1579,6 @@ type VolumeBackupProperties struct { // Policy Enforced PolicyEnforced *bool `json:"policyEnforced,omitempty"` - - // Vault Resource ID - VaultID *string `json:"vaultId,omitempty"` } // VolumeBackups - Volume details using the backup policy @@ -1703,7 +1712,7 @@ type VolumeGroupsClientGetOptions struct { // placeholder for future optional parameters } -// VolumeGroupsClientListByNetAppAccountOptions contains the optional parameters for the VolumeGroupsClient.ListByNetAppAccount +// VolumeGroupsClientListByNetAppAccountOptions contains the optional parameters for the VolumeGroupsClient.NewListByNetAppAccountPager // method. type VolumeGroupsClientListByNetAppAccountOptions struct { // placeholder for future optional parameters @@ -1765,7 +1774,7 @@ type VolumePatchProperties struct { // The service level of the file system ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - // Maximum throughput in Mibps that can be achieved by this volume and this will be accepted as input only for manual qosType + // Maximum throughput in MiB/s that can be achieved by this volume and this will be accepted as input only for manual qosType // volume ThroughputMibps *float32 `json:"throughputMibps,omitempty"` @@ -1805,7 +1814,7 @@ type VolumeProperties struct { SubnetID *string `json:"subnetId,omitempty"` // REQUIRED; Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum - // size is 500 GiB. Upper limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. + // size is 100 GiB. Upper limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. UsageThreshold *int64 `json:"usageThreshold,omitempty"` // Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose @@ -1850,6 +1859,9 @@ type VolumeProperties struct { // Specifies if default quota is enabled for the volume. IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + // Specifies whether volume is a Large Volume or Regular Volume. + IsLargeVolume *bool `json:"isLargeVolume,omitempty"` + // Restoring IsRestoring *bool `json:"isRestoring,omitempty"` @@ -1927,9 +1939,16 @@ type VolumeProperties struct { // happening on this volume. This value will update every 5 minutes during cloning. CloneProgress *int32 `json:"cloneProgress,omitempty" azure:"ro"` + // READ-ONLY; Data store resource unique identifier + DataStoreResourceID []*string `json:"dataStoreResourceId,omitempty" azure:"ro"` + // READ-ONLY; Specifies if the volume is encrypted or not. Only available on volumes created or updated after 2022-01-01. Encrypted *bool `json:"encrypted,omitempty" azure:"ro"` + // READ-ONLY; Flag indicating whether file access logs are enabled for the volume, based on active diagnostic settings present + // on the volume. + FileAccessLogs *FileAccessLogs `json:"fileAccessLogs,omitempty" azure:"ro"` + // READ-ONLY; Unique FileSystem Identifier. FileSystemID *string `json:"fileSystemId,omitempty" azure:"ro"` @@ -1943,6 +1962,10 @@ type VolumeProperties struct { // READ-ONLY; Network Sibling Set ID for the the group of volumes sharing networking resources. NetworkSiblingSetID *string `json:"networkSiblingSetId,omitempty" azure:"ro"` + // READ-ONLY; The availability zone where the volume is provisioned. This refers to the logical availability zone where the + // volume resides. + ProvisionedAvailabilityZone *string `json:"provisionedAvailabilityZone,omitempty" azure:"ro"` + // READ-ONLY; Azure lifecycle management ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` @@ -1966,6 +1989,9 @@ type VolumePropertiesDataProtection struct { // Snapshot properties. Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` + + // VolumeRelocation properties + VolumeRelocation *VolumeRelocationProperties `json:"volumeRelocation,omitempty"` } // VolumePropertiesExportPolicy - Set of export policy rules @@ -2002,6 +2028,9 @@ type VolumeQuotaRule struct { type VolumeQuotaRulePatch struct { // Volume Quota Rule Properties Properties *VolumeQuotaRulesProperties `json:"properties,omitempty"` + + // Resource tags + Tags map[string]*string `json:"tags,omitempty"` } // VolumeQuotaRulesClientBeginCreateOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginCreate method. @@ -2027,7 +2056,7 @@ type VolumeQuotaRulesClientGetOptions struct { // placeholder for future optional parameters } -// VolumeQuotaRulesClientListByVolumeOptions contains the optional parameters for the VolumeQuotaRulesClient.ListByVolume +// VolumeQuotaRulesClientListByVolumeOptions contains the optional parameters for the VolumeQuotaRulesClient.NewListByVolumePager // method. type VolumeQuotaRulesClientListByVolumeOptions struct { // placeholder for future optional parameters @@ -2055,6 +2084,15 @@ type VolumeQuotaRulesProperties struct { ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } +// VolumeRelocationProperties - Volume relocation properties +type VolumeRelocationProperties struct { + // Has relocation been requested for this volume + RelocationRequested *bool `json:"relocationRequested,omitempty"` + + // READ-ONLY; Has relocation finished and is ready to be cleaned up + ReadyToBeFinalized *bool `json:"readyToBeFinalized,omitempty" azure:"ro"` +} + // VolumeRevert - revert a volume to the snapshot type VolumeRevert struct { // Resource id of the snapshot @@ -2074,6 +2112,14 @@ type VolumesClientBeginAuthorizeReplicationOptions struct { ResumeToken string } +// VolumesClientBeginBreakFileLocksOptions contains the optional parameters for the VolumesClient.BeginBreakFileLocks method. +type VolumesClientBeginBreakFileLocksOptions struct { + // Optional body to provide the ability to clear file locks with selected options + Body *BreakFileLocksRequest + // Resumes the LRO from the provided token. + ResumeToken string +} + // VolumesClientBeginBreakReplicationOptions contains the optional parameters for the VolumesClient.BeginBreakReplication // method. type VolumesClientBeginBreakReplicationOptions struct { @@ -2177,12 +2223,12 @@ type VolumesClientGetOptions struct { // placeholder for future optional parameters } -// VolumesClientListOptions contains the optional parameters for the VolumesClient.List method. +// VolumesClientListOptions contains the optional parameters for the VolumesClient.NewListPager method. type VolumesClientListOptions struct { // placeholder for future optional parameters } -// VolumesClientListReplicationsOptions contains the optional parameters for the VolumesClient.ListReplications method. +// VolumesClientListReplicationsOptions contains the optional parameters for the VolumesClient.NewListReplicationsPager method. type VolumesClientListReplicationsOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/netapp/armnetapp/models_serde.go b/sdk/resourcemanager/netapp/armnetapp/models_serde.go index 5da0f392a859..9c2b0d5956a5 100644 --- a/sdk/resourcemanager/netapp/armnetapp/models_serde.go +++ b/sdk/resourcemanager/netapp/armnetapp/models_serde.go @@ -18,7 +18,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type Account. func (a Account) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", a.Etag) populate(objectMap, "id", a.ID) populate(objectMap, "identity", a.Identity) @@ -77,7 +77,7 @@ func (a *Account) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountEncryption. func (a AccountEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", a.Identity) populate(objectMap, "keySource", a.KeySource) populate(objectMap, "keyVaultProperties", a.KeyVaultProperties) @@ -112,7 +112,7 @@ func (a *AccountEncryption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountList. func (a AccountList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -143,7 +143,7 @@ func (a *AccountList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountPatch. func (a AccountPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) @@ -190,7 +190,7 @@ func (a *AccountPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountProperties. func (a AccountProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "activeDirectories", a.ActiveDirectories) populate(objectMap, "disableShowmount", a.DisableShowmount) populate(objectMap, "encryption", a.Encryption) @@ -229,7 +229,7 @@ func (a *AccountProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ActiveDirectory. func (a ActiveDirectory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "activeDirectoryId", a.ActiveDirectoryID) populate(objectMap, "adName", a.AdName) populate(objectMap, "administrators", a.Administrators) @@ -245,6 +245,7 @@ func (a ActiveDirectory) MarshalJSON() ([]byte, error) { populate(objectMap, "ldapSigning", a.LdapSigning) populate(objectMap, "organizationalUnit", a.OrganizationalUnit) populate(objectMap, "password", a.Password) + populate(objectMap, "preferredServersForLdapClient", a.PreferredServersForLdapClient) populate(objectMap, "securityOperators", a.SecurityOperators) populate(objectMap, "serverRootCACertificate", a.ServerRootCACertificate) populate(objectMap, "site", a.Site) @@ -309,6 +310,9 @@ func (a *ActiveDirectory) UnmarshalJSON(data []byte) error { case "password": err = unpopulate(val, "Password", &a.Password) delete(rawMsg, key) + case "preferredServersForLdapClient": + err = unpopulate(val, "PreferredServersForLdapClient", &a.PreferredServersForLdapClient) + delete(rawMsg, key) case "securityOperators": err = unpopulate(val, "SecurityOperators", &a.SecurityOperators) delete(rawMsg, key) @@ -340,7 +344,7 @@ func (a *ActiveDirectory) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AuthorizeRequest. func (a AuthorizeRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "remoteVolumeResourceId", a.RemoteVolumeResourceID) return json.Marshal(objectMap) } @@ -367,11 +371,12 @@ func (a *AuthorizeRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Backup. func (b Backup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", b.ID) populate(objectMap, "location", b.Location) populate(objectMap, "name", b.Name) populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } @@ -397,6 +402,9 @@ func (b *Backup) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &b.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) @@ -410,7 +418,7 @@ func (b *Backup) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BackupPatch. func (b BackupPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", b.Properties) populate(objectMap, "tags", b.Tags) return json.Marshal(objectMap) @@ -441,7 +449,7 @@ func (b *BackupPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BackupPoliciesList. func (b BackupPoliciesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } @@ -468,7 +476,7 @@ func (b *BackupPoliciesList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BackupPolicy. func (b BackupPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", b.Etag) populate(objectMap, "id", b.ID) populate(objectMap, "location", b.Location) @@ -523,7 +531,7 @@ func (b *BackupPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BackupPolicyPatch. func (b BackupPolicyPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", b.ID) populate(objectMap, "location", b.Location) populate(objectMap, "name", b.Name) @@ -570,7 +578,7 @@ func (b *BackupPolicyPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BackupPolicyProperties. func (b BackupPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupPolicyId", b.BackupPolicyID) populate(objectMap, "dailyBackupsToKeep", b.DailyBackupsToKeep) populate(objectMap, "enabled", b.Enabled) @@ -625,7 +633,7 @@ func (b *BackupPolicyProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BackupProperties. func (b BackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupId", b.BackupID) populate(objectMap, "backupType", b.BackupType) populateTimeRFC3339(objectMap, "creationDate", b.CreationDate) @@ -682,9 +690,44 @@ func (b *BackupProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BackupRestoreFiles. +func (b BackupRestoreFiles) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationVolumeId", b.DestinationVolumeID) + populate(objectMap, "fileList", b.FileList) + populate(objectMap, "restoreFilePath", b.RestoreFilePath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupRestoreFiles. +func (b *BackupRestoreFiles) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationVolumeId": + err = unpopulate(val, "DestinationVolumeID", &b.DestinationVolumeID) + delete(rawMsg, key) + case "fileList": + err = unpopulate(val, "FileList", &b.FileList) + delete(rawMsg, key) + case "restoreFilePath": + err = unpopulate(val, "RestoreFilePath", &b.RestoreFilePath) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BackupStatus. func (b BackupStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errorMessage", b.ErrorMessage) populate(objectMap, "healthy", b.Healthy) populate(objectMap, "lastTransferSize", b.LastTransferSize) @@ -739,7 +782,7 @@ func (b *BackupStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BackupsList. func (b BackupsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } @@ -764,9 +807,40 @@ func (b *BackupsList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BreakFileLocksRequest. +func (b BreakFileLocksRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientIp", b.ClientIP) + populate(objectMap, "confirmRunningDisruptiveOperation", b.ConfirmRunningDisruptiveOperation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BreakFileLocksRequest. +func (b *BreakFileLocksRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientIp": + err = unpopulate(val, "ClientIP", &b.ClientIP) + delete(rawMsg, key) + case "confirmRunningDisruptiveOperation": + err = unpopulate(val, "ConfirmRunningDisruptiveOperation", &b.ConfirmRunningDisruptiveOperation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BreakReplicationRequest. func (b BreakReplicationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "forceBreakReplication", b.ForceBreakReplication) return json.Marshal(objectMap) } @@ -793,7 +867,7 @@ func (b *BreakReplicationRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CapacityPool. func (c CapacityPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", c.Etag) populate(objectMap, "id", c.ID) populate(objectMap, "location", c.Location) @@ -848,7 +922,7 @@ func (c *CapacityPool) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CapacityPoolList. func (c CapacityPoolList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -879,7 +953,7 @@ func (c *CapacityPoolList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CapacityPoolPatch. func (c CapacityPoolPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) @@ -926,7 +1000,7 @@ func (c *CapacityPoolPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CheckAvailabilityResponse. func (c CheckAvailabilityResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "isAvailable", c.IsAvailable) populate(objectMap, "message", c.Message) populate(objectMap, "reason", c.Reason) @@ -961,7 +1035,7 @@ func (c *CheckAvailabilityResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DailySchedule. func (d DailySchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "hour", d.Hour) populate(objectMap, "minute", d.Minute) populate(objectMap, "snapshotsToKeep", d.SnapshotsToKeep) @@ -1000,7 +1074,7 @@ func (d *DailySchedule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Dimension. func (d Dimension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "displayName", d.DisplayName) populate(objectMap, "name", d.Name) return json.Marshal(objectMap) @@ -1031,7 +1105,7 @@ func (d *Dimension) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EncryptionIdentity. func (e EncryptionIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "principalId", e.PrincipalID) populate(objectMap, "userAssignedIdentity", e.UserAssignedIdentity) return json.Marshal(objectMap) @@ -1062,7 +1136,7 @@ func (e *EncryptionIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExportPolicyRule. func (e ExportPolicyRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowedClients", e.AllowedClients) populate(objectMap, "chownMode", e.ChownMode) populate(objectMap, "cifs", e.Cifs) @@ -1145,7 +1219,7 @@ func (e *ExportPolicyRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FilePathAvailabilityRequest. func (f FilePathAvailabilityRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", f.Name) populate(objectMap, "subnetId", f.SubnetID) return json.Marshal(objectMap) @@ -1176,7 +1250,7 @@ func (f *FilePathAvailabilityRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HourlySchedule. func (h HourlySchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "minute", h.Minute) populate(objectMap, "snapshotsToKeep", h.SnapshotsToKeep) populate(objectMap, "usedBytes", h.UsedBytes) @@ -1209,48 +1283,9 @@ func (h *HourlySchedule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Identity. -func (i Identity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. -func (i *Identity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &i.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &i.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyName", k.KeyName) populate(objectMap, "keyVaultId", k.KeyVaultID) populate(objectMap, "keyVaultResourceId", k.KeyVaultResourceID) @@ -1293,7 +1328,7 @@ func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LdapSearchScopeOpt. func (l LdapSearchScopeOpt) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groupDN", l.GroupDN) populate(objectMap, "groupMembershipFilter", l.GroupMembershipFilter) populate(objectMap, "userDN", l.UserDN) @@ -1328,7 +1363,7 @@ func (l *LdapSearchScopeOpt) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListReplications. func (l ListReplications) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } @@ -1355,7 +1390,7 @@ func (l *ListReplications) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LogSpecification. func (l LogSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "displayName", l.DisplayName) populate(objectMap, "name", l.Name) return json.Marshal(objectMap) @@ -1384,9 +1419,48 @@ func (l *LogSpecification) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MetricSpecification. func (m MetricSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "aggregationType", m.AggregationType) populate(objectMap, "category", m.Category) populate(objectMap, "dimensions", m.Dimensions) @@ -1473,7 +1547,7 @@ func (m *MetricSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonthlySchedule. func (m MonthlySchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "daysOfMonth", m.DaysOfMonth) populate(objectMap, "hour", m.Hour) populate(objectMap, "minute", m.Minute) @@ -1516,7 +1590,7 @@ func (m *MonthlySchedule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MountTargetProperties. func (m MountTargetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "fileSystemId", m.FileSystemID) populate(objectMap, "ipAddress", m.IPAddress) populate(objectMap, "mountTargetId", m.MountTargetID) @@ -1555,7 +1629,7 @@ func (m *MountTargetProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "display", o.Display) populate(objectMap, "name", o.Name) populate(objectMap, "origin", o.Origin) @@ -1594,7 +1668,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -1633,7 +1707,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } @@ -1660,7 +1734,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationProperties. func (o OperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "serviceSpecification", o.ServiceSpecification) return json.Marshal(objectMap) } @@ -1687,7 +1761,7 @@ func (o *OperationProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PlacementKeyValuePairs. func (p PlacementKeyValuePairs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "key", p.Key) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) @@ -1718,7 +1792,7 @@ func (p *PlacementKeyValuePairs) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PoolChangeRequest. func (p PoolChangeRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "newPoolResourceId", p.NewPoolResourceID) return json.Marshal(objectMap) } @@ -1745,7 +1819,7 @@ func (p *PoolChangeRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PoolPatchProperties. func (p PoolPatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "coolAccess", p.CoolAccess) populate(objectMap, "qosType", p.QosType) populate(objectMap, "size", p.Size) @@ -1780,7 +1854,7 @@ func (p *PoolPatchProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PoolProperties. func (p PoolProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "coolAccess", p.CoolAccess) populate(objectMap, "encryptionType", p.EncryptionType) populate(objectMap, "poolId", p.PoolID) @@ -1839,7 +1913,7 @@ func (p *PoolProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type QuotaAvailabilityRequest. func (q QuotaAvailabilityRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", q.Name) populate(objectMap, "resourceGroup", q.ResourceGroup) populate(objectMap, "type", q.Type) @@ -1874,7 +1948,7 @@ func (q *QuotaAvailabilityRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReestablishReplicationRequest. func (r ReestablishReplicationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "sourceVolumeId", r.SourceVolumeID) return json.Marshal(objectMap) } @@ -1901,7 +1975,7 @@ func (r *ReestablishReplicationRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegionInfo. func (r RegionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "availabilityZoneMappings", r.AvailabilityZoneMappings) populate(objectMap, "storageToNetworkProximity", r.StorageToNetworkProximity) return json.Marshal(objectMap) @@ -1932,7 +2006,7 @@ func (r *RegionInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegionInfoAvailabilityZoneMappingsItem. func (r RegionInfoAvailabilityZoneMappingsItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "availabilityZone", r.AvailabilityZone) populate(objectMap, "isAvailable", r.IsAvailable) return json.Marshal(objectMap) @@ -1963,7 +2037,7 @@ func (r *RegionInfoAvailabilityZoneMappingsItem) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type RelocateVolumeRequest. func (r RelocateVolumeRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "creationToken", r.CreationToken) return json.Marshal(objectMap) } @@ -1990,7 +2064,7 @@ func (r *RelocateVolumeRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Replication. func (r Replication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "endpointType", r.EndpointType) populate(objectMap, "remoteVolumeRegion", r.RemoteVolumeRegion) populate(objectMap, "remoteVolumeResourceId", r.RemoteVolumeResourceID) @@ -2029,7 +2103,7 @@ func (r *Replication) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReplicationObject. func (r ReplicationObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "endpointType", r.EndpointType) populate(objectMap, "remoteVolumeRegion", r.RemoteVolumeRegion) populate(objectMap, "remoteVolumeResourceId", r.RemoteVolumeResourceID) @@ -2072,7 +2146,7 @@ func (r *ReplicationObject) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReplicationStatus. func (r ReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errorMessage", r.ErrorMessage) populate(objectMap, "healthy", r.Healthy) populate(objectMap, "mirrorState", r.MirrorState) @@ -2115,7 +2189,7 @@ func (r *ReplicationStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceNameAvailabilityRequest. func (r ResourceNameAvailabilityRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) populate(objectMap, "resourceGroup", r.ResourceGroup) populate(objectMap, "type", r.Type) @@ -2150,7 +2224,7 @@ func (r *ResourceNameAvailabilityRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RestoreStatus. func (r RestoreStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errorMessage", r.ErrorMessage) populate(objectMap, "healthy", r.Healthy) populate(objectMap, "mirrorState", r.MirrorState) @@ -2197,7 +2271,7 @@ func (r *RestoreStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. func (s ServiceSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "logSpecifications", s.LogSpecifications) populate(objectMap, "metricSpecifications", s.MetricSpecifications) return json.Marshal(objectMap) @@ -2228,11 +2302,12 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Snapshot. func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -2258,6 +2333,9 @@ func (s *Snapshot) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -2271,7 +2349,7 @@ func (s *Snapshot) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SnapshotPoliciesList. func (s SnapshotPoliciesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -2298,7 +2376,7 @@ func (s *SnapshotPoliciesList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SnapshotPolicy. func (s SnapshotPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", s.Etag) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) @@ -2353,7 +2431,7 @@ func (s *SnapshotPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SnapshotPolicyPatch. func (s SnapshotPolicyPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -2400,7 +2478,7 @@ func (s *SnapshotPolicyPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SnapshotPolicyProperties. func (s SnapshotPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dailySchedule", s.DailySchedule) populate(objectMap, "enabled", s.Enabled) populate(objectMap, "hourlySchedule", s.HourlySchedule) @@ -2447,7 +2525,7 @@ func (s *SnapshotPolicyProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SnapshotPolicyVolumeList. func (s SnapshotPolicyVolumeList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -2474,7 +2552,7 @@ func (s *SnapshotPolicyVolumeList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SnapshotProperties. func (s SnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "created", s.Created) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "snapshotId", s.SnapshotID) @@ -2509,7 +2587,7 @@ func (s *SnapshotProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SnapshotRestoreFiles. func (s SnapshotRestoreFiles) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "destinationPath", s.DestinationPath) populate(objectMap, "filePaths", s.FilePaths) return json.Marshal(objectMap) @@ -2540,7 +2618,7 @@ func (s *SnapshotRestoreFiles) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SnapshotsList. func (s SnapshotsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -2567,7 +2645,7 @@ func (s *SnapshotsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubscriptionQuotaItem. func (s SubscriptionQuotaItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -2610,7 +2688,7 @@ func (s *SubscriptionQuotaItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubscriptionQuotaItemList. func (s SubscriptionQuotaItemList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -2637,7 +2715,7 @@ func (s *SubscriptionQuotaItemList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubscriptionQuotaItemProperties. func (s SubscriptionQuotaItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "current", s.Current) populate(objectMap, "default", s.Default) return json.Marshal(objectMap) @@ -2668,7 +2746,7 @@ func (s *SubscriptionQuotaItemProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubvolumeInfo. func (s SubvolumeInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -2711,7 +2789,7 @@ func (s *SubvolumeInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubvolumeModel. func (s SubvolumeModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -2750,7 +2828,7 @@ func (s *SubvolumeModel) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubvolumeModelProperties. func (s SubvolumeModelProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "accessedTimeStamp", s.AccessedTimeStamp) populate(objectMap, "bytesUsed", s.BytesUsed) populateTimeRFC3339(objectMap, "changedTimeStamp", s.ChangedTimeStamp) @@ -2813,7 +2891,7 @@ func (s *SubvolumeModelProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubvolumePatchParams. func (s SubvolumePatchParams) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "path", s.Path) populate(objectMap, "size", s.Size) return json.Marshal(objectMap) @@ -2844,7 +2922,7 @@ func (s *SubvolumePatchParams) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubvolumePatchRequest. func (s SubvolumePatchRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } @@ -2871,7 +2949,7 @@ func (s *SubvolumePatchRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubvolumeProperties. func (s SubvolumeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "parentPath", s.ParentPath) populate(objectMap, "path", s.Path) populate(objectMap, "provisioningState", s.ProvisioningState) @@ -2910,7 +2988,7 @@ func (s *SubvolumeProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubvolumesList. func (s SubvolumesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -2941,7 +3019,7 @@ func (s *SubvolumesList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -2988,7 +3066,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", u.ClientID) populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) @@ -3017,102 +3095,9 @@ func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Vault. -func (v Vault) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Vault. -func (v *Vault) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &v.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &v.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &v.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &v.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VaultList. -func (v VaultList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultList. -func (v *VaultList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VaultProperties. -func (v VaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "vaultName", v.VaultName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultProperties. -func (v *VaultProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "vaultName": - err = unpopulate(val, "VaultName", &v.VaultName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Volume. func (v Volume) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", v.Etag) populate(objectMap, "id", v.ID) populate(objectMap, "location", v.Location) @@ -3171,11 +3156,10 @@ func (v *Volume) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeBackupProperties. func (v VolumeBackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupEnabled", v.BackupEnabled) populate(objectMap, "backupPolicyId", v.BackupPolicyID) populate(objectMap, "policyEnforced", v.PolicyEnforced) - populate(objectMap, "vaultId", v.VaultID) return json.Marshal(objectMap) } @@ -3197,9 +3181,6 @@ func (v *VolumeBackupProperties) UnmarshalJSON(data []byte) error { case "policyEnforced": err = unpopulate(val, "PolicyEnforced", &v.PolicyEnforced) delete(rawMsg, key) - case "vaultId": - err = unpopulate(val, "VaultID", &v.VaultID) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -3210,7 +3191,7 @@ func (v *VolumeBackupProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeBackups. func (v VolumeBackups) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupsCount", v.BackupsCount) populate(objectMap, "policyEnabled", v.PolicyEnabled) populate(objectMap, "volumeName", v.VolumeName) @@ -3245,7 +3226,7 @@ func (v *VolumeBackups) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeGroup. func (v VolumeGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", v.ID) populate(objectMap, "location", v.Location) populate(objectMap, "name", v.Name) @@ -3288,7 +3269,7 @@ func (v *VolumeGroup) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeGroupDetails. func (v VolumeGroupDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", v.ID) populate(objectMap, "location", v.Location) populate(objectMap, "name", v.Name) @@ -3331,7 +3312,7 @@ func (v *VolumeGroupDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeGroupList. func (v VolumeGroupList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) } @@ -3358,7 +3339,7 @@ func (v *VolumeGroupList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeGroupListProperties. func (v VolumeGroupListProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groupMetaData", v.GroupMetaData) populate(objectMap, "provisioningState", v.ProvisioningState) return json.Marshal(objectMap) @@ -3389,7 +3370,7 @@ func (v *VolumeGroupListProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeGroupMetaData. func (v VolumeGroupMetaData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "applicationIdentifier", v.ApplicationIdentifier) populate(objectMap, "applicationType", v.ApplicationType) populate(objectMap, "deploymentSpecId", v.DeploymentSpecID) @@ -3436,7 +3417,7 @@ func (v *VolumeGroupMetaData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeGroupProperties. func (v VolumeGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groupMetaData", v.GroupMetaData) populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "volumes", v.Volumes) @@ -3471,7 +3452,7 @@ func (v *VolumeGroupProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeGroupVolumeProperties. func (v VolumeGroupVolumeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", v.ID) populate(objectMap, "name", v.Name) populate(objectMap, "properties", v.Properties) @@ -3514,7 +3495,7 @@ func (v *VolumeGroupVolumeProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeList. func (v VolumeList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", v.NextLink) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) @@ -3545,7 +3526,7 @@ func (v *VolumeList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumePatch. func (v VolumePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", v.ID) populate(objectMap, "location", v.Location) populate(objectMap, "name", v.Name) @@ -3592,7 +3573,7 @@ func (v *VolumePatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumePatchProperties. func (v VolumePatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "coolAccess", v.CoolAccess) populate(objectMap, "coolnessPeriod", v.CoolnessPeriod) populate(objectMap, "dataProtection", v.DataProtection) @@ -3659,7 +3640,7 @@ func (v *VolumePatchProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumePatchPropertiesDataProtection. func (v VolumePatchPropertiesDataProtection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backup", v.Backup) populate(objectMap, "snapshot", v.Snapshot) return json.Marshal(objectMap) @@ -3690,7 +3671,7 @@ func (v *VolumePatchPropertiesDataProtection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumePatchPropertiesExportPolicy. func (v VolumePatchPropertiesExportPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "rules", v.Rules) return json.Marshal(objectMap) } @@ -3717,7 +3698,7 @@ func (v *VolumePatchPropertiesExportPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeProperties. func (v VolumeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "avsDataStore", v.AvsDataStore) populate(objectMap, "backupId", v.BackupID) populate(objectMap, "baremetalTenantId", v.BaremetalTenantID) @@ -3727,6 +3708,7 @@ func (v VolumeProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "coolnessPeriod", v.CoolnessPeriod) populate(objectMap, "creationToken", v.CreationToken) populate(objectMap, "dataProtection", v.DataProtection) + populate(objectMap, "dataStoreResourceId", v.DataStoreResourceID) populate(objectMap, "defaultGroupQuotaInKiBs", v.DefaultGroupQuotaInKiBs) populate(objectMap, "defaultUserQuotaInKiBs", v.DefaultUserQuotaInKiBs) populate(objectMap, "deleteBaseSnapshot", v.DeleteBaseSnapshot) @@ -3734,8 +3716,10 @@ func (v VolumeProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "encrypted", v.Encrypted) populate(objectMap, "encryptionKeySource", v.EncryptionKeySource) populate(objectMap, "exportPolicy", v.ExportPolicy) + populate(objectMap, "fileAccessLogs", v.FileAccessLogs) populate(objectMap, "fileSystemId", v.FileSystemID) populate(objectMap, "isDefaultQuotaEnabled", v.IsDefaultQuotaEnabled) + populate(objectMap, "isLargeVolume", v.IsLargeVolume) populate(objectMap, "isRestoring", v.IsRestoring) populate(objectMap, "kerberosEnabled", v.KerberosEnabled) populate(objectMap, "keyVaultPrivateEndpointResourceId", v.KeyVaultPrivateEndpointResourceID) @@ -3746,6 +3730,7 @@ func (v VolumeProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "networkSiblingSetId", v.NetworkSiblingSetID) populate(objectMap, "placementRules", v.PlacementRules) populate(objectMap, "protocolTypes", v.ProtocolTypes) + populate(objectMap, "provisionedAvailabilityZone", v.ProvisionedAvailabilityZone) populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup) populate(objectMap, "securityStyle", v.SecurityStyle) @@ -3804,6 +3789,9 @@ func (v *VolumeProperties) UnmarshalJSON(data []byte) error { case "dataProtection": err = unpopulate(val, "DataProtection", &v.DataProtection) delete(rawMsg, key) + case "dataStoreResourceId": + err = unpopulate(val, "DataStoreResourceID", &v.DataStoreResourceID) + delete(rawMsg, key) case "defaultGroupQuotaInKiBs": err = unpopulate(val, "DefaultGroupQuotaInKiBs", &v.DefaultGroupQuotaInKiBs) delete(rawMsg, key) @@ -3825,12 +3813,18 @@ func (v *VolumeProperties) UnmarshalJSON(data []byte) error { case "exportPolicy": err = unpopulate(val, "ExportPolicy", &v.ExportPolicy) delete(rawMsg, key) + case "fileAccessLogs": + err = unpopulate(val, "FileAccessLogs", &v.FileAccessLogs) + delete(rawMsg, key) case "fileSystemId": err = unpopulate(val, "FileSystemID", &v.FileSystemID) delete(rawMsg, key) case "isDefaultQuotaEnabled": err = unpopulate(val, "IsDefaultQuotaEnabled", &v.IsDefaultQuotaEnabled) delete(rawMsg, key) + case "isLargeVolume": + err = unpopulate(val, "IsLargeVolume", &v.IsLargeVolume) + delete(rawMsg, key) case "isRestoring": err = unpopulate(val, "IsRestoring", &v.IsRestoring) delete(rawMsg, key) @@ -3861,6 +3855,9 @@ func (v *VolumeProperties) UnmarshalJSON(data []byte) error { case "protocolTypes": err = unpopulate(val, "ProtocolTypes", &v.ProtocolTypes) delete(rawMsg, key) + case "provisionedAvailabilityZone": + err = unpopulate(val, "ProvisionedAvailabilityZone", &v.ProvisionedAvailabilityZone) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) delete(rawMsg, key) @@ -3928,10 +3925,11 @@ func (v *VolumeProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumePropertiesDataProtection. func (v VolumePropertiesDataProtection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backup", v.Backup) populate(objectMap, "replication", v.Replication) populate(objectMap, "snapshot", v.Snapshot) + populate(objectMap, "volumeRelocation", v.VolumeRelocation) return json.Marshal(objectMap) } @@ -3953,6 +3951,9 @@ func (v *VolumePropertiesDataProtection) UnmarshalJSON(data []byte) error { case "snapshot": err = unpopulate(val, "Snapshot", &v.Snapshot) delete(rawMsg, key) + case "volumeRelocation": + err = unpopulate(val, "VolumeRelocation", &v.VolumeRelocation) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -3963,7 +3964,7 @@ func (v *VolumePropertiesDataProtection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumePropertiesExportPolicy. func (v VolumePropertiesExportPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "rules", v.Rules) return json.Marshal(objectMap) } @@ -3990,7 +3991,7 @@ func (v *VolumePropertiesExportPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeQuotaRule. func (v VolumeQuotaRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", v.ID) populate(objectMap, "location", v.Location) populate(objectMap, "name", v.Name) @@ -4041,8 +4042,9 @@ func (v *VolumeQuotaRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeQuotaRulePatch. func (v VolumeQuotaRulePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) return json.Marshal(objectMap) } @@ -4058,6 +4060,9 @@ func (v *VolumeQuotaRulePatch) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &v.Properties) delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -4068,7 +4073,7 @@ func (v *VolumeQuotaRulePatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeQuotaRulesList. func (v VolumeQuotaRulesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) } @@ -4095,7 +4100,7 @@ func (v *VolumeQuotaRulesList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeQuotaRulesProperties. func (v VolumeQuotaRulesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "provisioningState", v.ProvisioningState) populate(objectMap, "quotaSizeInKiBs", v.QuotaSizeInKiBs) populate(objectMap, "quotaTarget", v.QuotaTarget) @@ -4132,9 +4137,40 @@ func (v *VolumeQuotaRulesProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type VolumeRelocationProperties. +func (v VolumeRelocationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "readyToBeFinalized", v.ReadyToBeFinalized) + populate(objectMap, "relocationRequested", v.RelocationRequested) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeRelocationProperties. +func (v *VolumeRelocationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "readyToBeFinalized": + err = unpopulate(val, "ReadyToBeFinalized", &v.ReadyToBeFinalized) + delete(rawMsg, key) + case "relocationRequested": + err = unpopulate(val, "RelocationRequested", &v.RelocationRequested) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VolumeRevert. func (v VolumeRevert) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "snapshotId", v.SnapshotID) return json.Marshal(objectMap) } @@ -4161,7 +4197,7 @@ func (v *VolumeRevert) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeSnapshotProperties. func (v VolumeSnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "snapshotPolicyId", v.SnapshotPolicyID) return json.Marshal(objectMap) } @@ -4188,7 +4224,7 @@ func (v *VolumeSnapshotProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WeeklySchedule. func (w WeeklySchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "day", w.Day) populate(objectMap, "hour", w.Hour) populate(objectMap, "minute", w.Minute) @@ -4229,7 +4265,7 @@ func (w *WeeklySchedule) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -4239,7 +4275,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/netapp/armnetapp/operations_client.go b/sdk/resourcemanager/netapp/armnetapp/operations_client.go index 915cc1716089..e94422d97d27 100644 --- a/sdk/resourcemanager/netapp/armnetapp/operations_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/operations_client.go @@ -28,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -50,8 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available Microsoft.NetApp Rest API operations -// Generated from API version 2022-05-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-09-01 +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -82,7 +83,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go index 6dd278df4e6e..27718bb293b2 100644 --- a/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/OperationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/OperationList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,13 +30,1561 @@ func ExampleOperationsClient_NewListPager() { } pager := client.NewListPager(nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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 = armnetapp.OperationListResult{ + // Value: []*armnetapp.Operation{ + // { + // Name: to.Ptr("Microsoft.NetApp/register/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Subscription Registration Action"), + // Operation: to.Ptr("Subscription Registration Action"), + // Provider: to.Ptr("Microsoft.NetApp"), + // Resource: to.Ptr("Subscription"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a volume resource."), + // Operation: to.Ptr("Read volume resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Writes a volume resource."), + // Operation: to.Ptr("Write volume resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/delete"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Deletes a volume resource."), + // Operation: to.Ptr("Delete volume resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/Revert/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Revert volume to specific snapshot"), + // Operation: to.Ptr("Revert volume resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/BreakReplication/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Break volume replication relations"), + // Operation: to.Ptr("Break volume replication resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ReplicationStatus/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads the statuses of the Volume Replication."), + // Operation: to.Ptr("Read Volume Replication Status."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ListReplications/action"), + // Display: &armnetapp.OperationDisplay{ + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ReInitializeReplication/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Attempts to re-initialize an uninitialized replication"), + // Operation: to.Ptr("Re-Initialize replication"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/providers/Microsoft.Insights/metricDefinitions/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Gets the available metrics for Volume resource."), + // Operation: to.Ptr("Read volume metric definitions."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("system"), + // Properties: &armnetapp.OperationProperties{ + // ServiceSpecification: &armnetapp.ServiceSpecification{ + // MetricSpecifications: []*armnetapp.MetricSpecification{ + // { + // Name: to.Ptr("AverageReadLatency"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Average read latency in milliseconds per operation"), + // DisplayName: to.Ptr("Average read latency"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("AverageReadLatency"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("MilliSeconds"), + // }, + // { + // Name: to.Ptr("AverageWriteLatency"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Average write latency in milliseconds per operation"), + // DisplayName: to.Ptr("Average write latency"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("AverageWriteLatency"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("MilliSeconds"), + // }, + // { + // Name: to.Ptr("VolumeLogicalSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Logical size of the volume (used bytes)"), + // DisplayName: to.Ptr("Volume Consumed Size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumeLogicalSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("VolumeSnapshotSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Size of all snapshots in volume"), + // DisplayName: to.Ptr("Volume snapshot size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumeSnapshotSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("ReadIops"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Read In/out operations per second"), + // DisplayName: to.Ptr("Read iops"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("ReadIops"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("CountPerSecond"), + // }, + // { + // Name: to.Ptr("WriteIops"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Write In/out operations per second"), + // DisplayName: to.Ptr("Write iops"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("WriteIops"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("CountPerSecond"), + // }, + // { + // Name: to.Ptr("VolumeAllocatedSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("The provisioned size of a volume"), + // DisplayName: to.Ptr("Volume allocated size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumeAllocatedSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("VolumeCoolTierSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Volume Footprint for Cool Tier"), + // DisplayName: to.Ptr("Volume cool tier size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumeCoolTierSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("VolumeCoolTierDataReadSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Data read in using GET per volume"), + // DisplayName: to.Ptr("Volume cool tier data read size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumeCoolTierDataReadSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("VolumeCoolTierDataWriteSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Data tiered out using PUT per volume"), + // DisplayName: to.Ptr("Volume cool tier data write size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumeCoolTierDataWriteSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("XregionReplicationLastTransferDuration"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("The amount of time in seconds it took for the last transfer to complete."), + // DisplayName: to.Ptr("Volume replication last transfer duration"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("XregionReplicationLastTransferDuration"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Seconds"), + // }, + // { + // Name: to.Ptr("XregionReplicationLastTransferSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("The total number of bytes transferred as part of the last transfer."), + // DisplayName: to.Ptr("Volume replication last transfer size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("XregionReplicationLastTransferSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("XregionReplicationHealthy"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Condition of the relationship, 1 or 0."), + // DisplayName: to.Ptr("Is volume replication status healthy"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("XregionReplicationHealthy"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Count"), + // }, + // { + // Name: to.Ptr("XregionReplicationLagTime"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("The amount of time in seconds by which the data on the mirror lags behind the source."), + // DisplayName: to.Ptr("Volume replication lag time"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("XregionReplicationLagTime"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Seconds"), + // }, + // { + // Name: to.Ptr("XregionReplicationTotalTransferBytes"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Cumulative bytes transferred for the relationship."), + // DisplayName: to.Ptr("Volume replication total transfer"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("XregionReplicationTotalTransferBytes"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("XregionReplicationRelationshipProgress"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Total amount of data transferred for the current transfer operation."), + // DisplayName: to.Ptr("Volume replication progress"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("XregionReplicationRelationshipProgress"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("XregionReplicationRelationshipTransferring"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Whether the status of the Volume Replication is 'transferring'."), + // DisplayName: to.Ptr("Is volume replication transferring"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("XregionReplicationRelationshipTransferring"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Count"), + // }, + // { + // Name: to.Ptr("CbsVolumeLogicalBackupBytes"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Total bytes backed up for this Volume."), + // DisplayName: to.Ptr("Volume Backup Bytes"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("CbsVolumeLogicalBackupBytes"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("CbsVolumeProtected"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Is backup enabled for the volume? 1 if yes, 0 if no."), + // DisplayName: to.Ptr("Is Volume Backup Enabled"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("CbsVolumeProtected"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Count"), + // }, + // { + // Name: to.Ptr("CbsVolumeBackupActive"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Is the backup policy suspended for the volume? 0 if yes, 1 if no."), + // DisplayName: to.Ptr("Is Volume Backup suspended"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("CbsVolumeBackupActive"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Count"), + // }, + // { + // Name: to.Ptr("CbsVolumeOperationTransferredBytes"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Total bytes transferred for last backup or restore operation."), + // DisplayName: to.Ptr("Volume Backup Last Transferred Bytes"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("CbsVolumeOperationTransferredBytes"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("CbsVolumeOperationComplete"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Did the last volume backup or restore operation complete successfully? 1 if yes, 0 if no."), + // DisplayName: to.Ptr("Is Volume Backup Operation Complete"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("CbsVolumeOperationComplete"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Count"), + // }, + // { + // Name: to.Ptr("VolumeConsumedSizePercentage"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("The percentage of the volume consumed including snapshots."), + // DisplayName: to.Ptr("Percentage Volume Consumed Size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumeConsumedSizePercentage"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Percent"), + // }, + // { + // Name: to.Ptr("OtherThroughput"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Other throughput (that is not read or write) in bytes per second"), + // DisplayName: to.Ptr("Other throughput"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("OtherThroughput"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("BytesPerSecond"), + // }, + // { + // Name: to.Ptr("ReadThroughput"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Read throughput in bytes per second"), + // DisplayName: to.Ptr("Read throughput"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("ReadThroughput"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("BytesPerSecond"), + // }, + // { + // Name: to.Ptr("TotalThroughput"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Sum of all throughput in bytes per second"), + // DisplayName: to.Ptr("Total throughput"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("TotalThroughput"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("BytesPerSecond"), + // }, + // { + // Name: to.Ptr("WriteThroughput"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Write throughput in bytes per second"), + // DisplayName: to.Ptr("Write throughput"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("WriteThroughput"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("BytesPerSecond"), + // }}, + // }, + // }, + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/providers/Microsoft.Insights/diagnosticSettings/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Gets the diagnostic setting for the resource."), + // Operation: to.Ptr("Read diagnostic setting."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/providers/Microsoft.Insights/diagnosticSettings/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Creates or updates the diagnostic setting for the resource."), + // Operation: to.Ptr("Write diagnostic setting."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/AuthorizeReplication/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Authorize the source volume replication"), + // Operation: to.Ptr("Authorize Replication"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ResyncReplication/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Resync the replication on the destination volume"), + // Operation: to.Ptr("Resync Replication"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/DeleteReplication/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Delete the replication on the destination volume"), + // Operation: to.Ptr("Delete Replication"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ReplicationStatus/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads the statuses of the Volume Replication."), + // Operation: to.Ptr("Read Volume Replication Status."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/MountTargets/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a mount target resource."), + // Operation: to.Ptr("Read mount target resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/BackupStatus/read"), + // Display: &armnetapp.OperationDisplay{ + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/RestoreStatus/read"), + // Display: &armnetapp.OperationDisplay{ + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/PoolChange/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Moves volume to another pool."), + // Operation: to.Ptr("Change pool for volume"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/RelocateVolume/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Relocate volume to a new stamp."), + // Operation: to.Ptr("Relocate volume to a new stamp."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/FinalizeRelocation/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Finalize relocation by cleaning up the old volume."), + // Operation: to.Ptr("Finalize relocation of volume."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/RevertRelocation/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Revert the relocation and revert back to the old volume."), + // Operation: to.Ptr("Revert the relocation of volume."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads an account resource."), + // Operation: to.Ptr("Read account resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Accounts resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Writes an account resource."), + // Operation: to.Ptr("Write account resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Accounts resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/delete"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Deletes a account resource."), + // Operation: to.Ptr("Delete account resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Accounts resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/RenewCredentials/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Renews MSI credentials of account, if account has MSI credentials that are due for renewal."), + // Operation: to.Ptr("Renew MSI credentials, if possible."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Accounts resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a pool resource."), + // Operation: to.Ptr("Read pool resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Pools resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Writes a pool resource."), + // Operation: to.Ptr("Write pool resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Pools resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/delete"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Deletes a pool resource."), + // Operation: to.Ptr("Delete pool resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Pools resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/providers/Microsoft.Insights/metricDefinitions/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Gets the available metrics for Volume resource."), + // Operation: to.Ptr("Read volume metric definitions."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Pools resource type"), + // }, + // Origin: to.Ptr("system"), + // Properties: &armnetapp.OperationProperties{ + // ServiceSpecification: &armnetapp.ServiceSpecification{ + // MetricSpecifications: []*armnetapp.MetricSpecification{ + // { + // Name: to.Ptr("VolumePoolAllocatedUsed"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Allocated used size of the pool"), + // DisplayName: to.Ptr("Pool Allocated To Volume Size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumePoolAllocatedUsed"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("VolumePoolTotalLogicalSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Sum of the logical size of all the volumes belonging to the pool"), + // DisplayName: to.Ptr("Pool Consumed Size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumePoolTotalLogicalSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage), + // to.Ptr(armnetapp.MetricAggregationType("Total"))}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("VolumePoolAllocatedSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Provisioned size of this pool"), + // DisplayName: to.Ptr("Pool Allocated Size"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumePoolAllocatedSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage), + // to.Ptr(armnetapp.MetricAggregationType("Total"))}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("VolumePoolTotalSnapshotSize"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Sum of snapshot size of all volumes in this pool"), + // DisplayName: to.Ptr("Total Snapshot size for the pool"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumePoolTotalSnapshotSize"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("Bytes"), + // }, + // { + // Name: to.Ptr("VolumePoolProvisionedThroughput"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Provisioned throughput of this pool"), + // DisplayName: to.Ptr("Provisioned throughput for the pool"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumePoolProvisionedThroughput"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("BytesPerSecond"), + // }, + // { + // Name: to.Ptr("VolumePoolAllocatedToVolumeThroughput"), + // AggregationType: to.Ptr("Average"), + // Dimensions: []*armnetapp.Dimension{ + // }, + // DisplayDescription: to.Ptr("Sum of the throughput of all the volumes belonging to the pool"), + // DisplayName: to.Ptr("Pool allocated throughput"), + // EnableRegionalMdmAccount: to.Ptr(true), + // FillGapWithZero: to.Ptr(false), + // InternalMetricName: to.Ptr("VolumePoolAllocatedToVolumeThroughput"), + // IsInternal: to.Ptr(false), + // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), + // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), + // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ + // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, + // SupportedTimeGrainTypes: []*string{ + // to.Ptr("PT5M"), + // to.Ptr("PT15M"), + // to.Ptr("PT30M"), + // to.Ptr("PT1H"), + // to.Ptr("PT6H"), + // to.Ptr("PT12H"), + // to.Ptr("P1D")}, + // Unit: to.Ptr("BytesPerSecond"), + // }}, + // }, + // }, + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/providers/Microsoft.Insights/logDefinitions/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Gets the log definitions for the resource."), + // Operation: to.Ptr("Read log definitions."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Pools resource type"), + // }, + // Origin: to.Ptr("system"), + // Properties: &armnetapp.OperationProperties{ + // ServiceSpecification: &armnetapp.ServiceSpecification{ + // LogSpecifications: []*armnetapp.LogSpecification{ + // { + // Name: to.Ptr("Autoscale"), + // DisplayName: to.Ptr("Capacity Pool Autoscaled"), + // }}, + // }, + // }, + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/providers/Microsoft.Insights/diagnosticSettings/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Gets the diagnostic setting for the resource."), + // Operation: to.Ptr("Read diagnostic setting."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Pools resource type"), + // }, + // Origin: to.Ptr("system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/providers/Microsoft.Insights/diagnosticSettings/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Creates or updates the diagnostic setting for the resource."), + // Operation: to.Ptr("Write diagnostic setting."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Pools resource type"), + // }, + // Origin: to.Ptr("system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a snapshot resource."), + // Operation: to.Ptr("Read snapshot resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Snapshots resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Writes a snapshot resource."), + // Operation: to.Ptr("Write snapshot resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Snapshots resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/delete"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Deletes a snapshot resource."), + // Operation: to.Ptr("Delete snapshot resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Snapshots resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/RestoreFiles/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Restores files from a snapshot resource"), + // Operation: to.Ptr("Single File Snapshot Restore"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Snapshots resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/read"), + // Display: &armnetapp.OperationDisplay{ + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Subvolume resource type."), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Write a subvolume resource."), + // Operation: to.Ptr("Write subvolume Resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Subvolume resource type."), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/delete"), + // Display: &armnetapp.OperationDisplay{ + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Subvolume resource type."), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/GetMetadata/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Read subvolume metadata resource."), + // Operation: to.Ptr("Subvolume Metadata resource."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Subvolume resource type."), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a snapshot policy resource."), + // Operation: to.Ptr("Read snapshot policy resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Snapshot Policies resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Writes a snapshot policy resource."), + // Operation: to.Ptr("Write snapshot policy resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Snapshot Policies resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/delete"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Deletes a snapshot policy resource."), + // Operation: to.Ptr("Delete snapshot policy resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Snapshot Policies resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/Volumes/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("List volumes connected to snapshot policy"), + // Operation: to.Ptr("List connected volumes"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Snapshot Policies resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/ListVolumes/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("List volumes connected to snapshot policy"), + // Operation: to.Ptr("List connected volumes"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Snapshot Policies resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a backup resource."), + // Operation: to.Ptr("Read backup resource."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Backup resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Writes a backup resource."), + // Operation: to.Ptr("Write backup resource."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Backup resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups/delete"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Deletes a backup resource."), + // Operation: to.Ptr("Delete backup resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Backup resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppIPSecPolicies/read"), + // Display: &armnetapp.OperationDisplay{ + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppIPSecPolicies/write"), + // Display: &armnetapp.OperationDisplay{ + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppIPSecPolicies/delete"), + // Display: &armnetapp.OperationDisplay{ + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppIPSecPolicies/Apply/action"), + // Display: &armnetapp.OperationDisplay{ + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a backup policy resource."), + // Operation: to.Ptr("Read backup policy resource."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Backup Policy resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Writes a backup policy resource."), + // Operation: to.Ptr("Write backup policy resource."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Backup Policy resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies/delete"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Deletes a backup policy resource."), + // Operation: to.Ptr("Delete backup policy resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Backup Policy resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/vaults/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a vault resource."), + // Operation: to.Ptr("Read vault resource."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Vault resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads an account backup resource."), + // Operation: to.Ptr("Read an account backup resource."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Account backup resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Writes an account backup resource."), + // Operation: to.Ptr("Write an account backup resource."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Account backup resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups/delete"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Deletes an account backup resource."), + // Operation: to.Ptr("Delete an account backup resource."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Account backup resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a volume group resource."), + // Operation: to.Ptr("Read volume group resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volume Group resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups/write"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Writes a volume group resource."), + // Operation: to.Ptr("Write volume group resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volume Group resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups/delete"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Deletes a volume group resource."), + // Operation: to.Ptr("Delete volume group resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volume Group resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/locations/quotaLimits/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a Quotalimit resource type."), + // Operation: to.Ptr("Read QuotaLimit resource type"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("QuotaLimit resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/Operations/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads an operation resources."), + // Operation: to.Ptr("Read operation resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Operations resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/locations/operationresults/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads an operation result resource."), + // Operation: to.Ptr("Read operation result resource"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Operation results resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/locations/read"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Reads a location wide operation."), + // Operation: to.Ptr("Read location wide operation"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Location wide operation"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/locations/checknameavailability/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Check if resource name is available"), + // Operation: to.Ptr("Check if resource name is available"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("NetApp resources"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/locations/checkfilepathavailability/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Check if file path is available"), + // Operation: to.Ptr("Check if file path is available"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Volumes resource type"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/unregister/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Unregisters Subscription with Microsoft.NetApp resource provider"), + // Operation: to.Ptr("Unregister Subscription for Azure NetApp Files"), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("Subscription"), + // }, + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.NetApp/locations/checkinventory/action"), + // Display: &armnetapp.OperationDisplay{ + // Description: to.Ptr("Checks ReservedCapacity inventory."), + // Operation: to.Ptr("Checks ReservedCapacity inventory."), + // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), + // Resource: to.Ptr("ReservedCapacity reservation resource."), + // }, + // Origin: to.Ptr("user,system"), + // }}, + // } } } diff --git a/sdk/resourcemanager/netapp/armnetapp/pools_client.go b/sdk/resourcemanager/netapp/armnetapp/pools_client.go index 30214f4791f9..37b2d7caa17a 100644 --- a/sdk/resourcemanager/netapp/armnetapp/pools_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/pools_client.go @@ -32,10 +32,9 @@ type PoolsClient struct { } // NewPoolsClient creates a new instance of PoolsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PoolsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +57,14 @@ func NewPoolsClient(subscriptionID string, credential azcore.TokenCredential, op // BeginCreateOrUpdate - Create or Update a capacity pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// body - Capacity pool object supplied in the body of the operation. -// options - PoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the PoolsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - body - Capacity pool object supplied in the body of the operation. +// - options - PoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the PoolsClient.BeginCreateOrUpdate +// method. func (client *PoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, body CapacityPool, options *PoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PoolsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, poolName, body, options) @@ -81,7 +81,8 @@ func (client *PoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGrou // CreateOrUpdate - Create or Update a capacity pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *PoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, body CapacityPool, options *PoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, poolName, body, options) if err != nil { @@ -121,7 +122,7 @@ func (client *PoolsClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -129,11 +130,12 @@ func (client *PoolsClient) createOrUpdateCreateRequest(ctx context.Context, reso // BeginDelete - Delete the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// options - PoolsClientBeginDeleteOptions contains the optional parameters for the PoolsClient.BeginDelete method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - options - PoolsClientBeginDeleteOptions contains the optional parameters for the PoolsClient.BeginDelete method. func (client *PoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, poolName string, options *PoolsClientBeginDeleteOptions) (*runtime.Poller[PoolsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, poolName, options) @@ -150,7 +152,8 @@ func (client *PoolsClient) BeginDelete(ctx context.Context, resourceGroupName st // Delete - Delete the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *PoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, options *PoolsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, options) if err != nil { @@ -190,18 +193,19 @@ func (client *PoolsClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get details of the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// options - PoolsClientGetOptions contains the optional parameters for the PoolsClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - options - PoolsClientGetOptions contains the optional parameters for the PoolsClient.Get method. func (client *PoolsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, options *PoolsClientGetOptions) (PoolsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, options) if err != nil { @@ -241,7 +245,7 @@ func (client *PoolsClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,10 +261,11 @@ func (client *PoolsClient) getHandleResponse(resp *http.Response) (PoolsClientGe } // NewListPager - List all capacity pools in the NetApp Account -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// options - PoolsClientListOptions contains the optional parameters for the PoolsClient.List method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - options - PoolsClientListOptions contains the optional parameters for the PoolsClient.NewListPager method. func (client *PoolsClient) NewListPager(resourceGroupName string, accountName string, options *PoolsClientListOptions) *runtime.Pager[PoolsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PoolsClientListResponse]{ More: func(page PoolsClientListResponse) bool { @@ -309,7 +314,7 @@ func (client *PoolsClient) listCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,12 +331,13 @@ func (client *PoolsClient) listHandleResponse(resp *http.Response) (PoolsClientL // BeginUpdate - Patch the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// body - Capacity pool object supplied in the body of the operation. -// options - PoolsClientBeginUpdateOptions contains the optional parameters for the PoolsClient.BeginUpdate method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - body - Capacity pool object supplied in the body of the operation. +// - options - PoolsClientBeginUpdateOptions contains the optional parameters for the PoolsClient.BeginUpdate method. func (client *PoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, body CapacityPoolPatch, options *PoolsClientBeginUpdateOptions) (*runtime.Poller[PoolsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, poolName, body, options) @@ -348,7 +354,8 @@ func (client *PoolsClient) BeginUpdate(ctx context.Context, resourceGroupName st // Update - Patch the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *PoolsClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, body CapacityPoolPatch, options *PoolsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, body, options) if err != nil { @@ -388,7 +395,7 @@ func (client *PoolsClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go index 79d77f12a576..0b6d0027986e 100644 --- a/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Pools_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Pools_List.json func ExamplePoolsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,18 +31,36 @@ func ExamplePoolsClient_NewListPager() { } pager := client.NewListPager("myRG", "account1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.CapacityPoolList = armnetapp.CapacityPoolList{ + // Value: []*armnetapp.CapacityPool{ + // { + // Name: to.Ptr("account1/pool1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.PoolProperties{ + // PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), + // ProvisioningState: to.Ptr("Succeeded"), + // QosType: to.Ptr(armnetapp.QosTypeAuto), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // Size: to.Ptr[int64](4398046511104), + // TotalThroughputMibps: to.Ptr[float32](281.474), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Pools_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Pools_Get.json func ExamplePoolsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,11 +75,27 @@ func ExamplePoolsClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.CapacityPool = armnetapp.CapacityPool{ + // Name: to.Ptr("account1/pool1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.PoolProperties{ + // PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), + // ProvisioningState: to.Ptr("Succeeded"), + // QosType: to.Ptr(armnetapp.QosTypeManual), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // Size: to.Ptr[int64](4398046511104), + // TotalThroughputMibps: to.Ptr[float32](281.474), + // UtilizedThroughputMibps: to.Ptr[float32](100.47), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Pools_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Pools_CreateOrUpdate.json func ExamplePoolsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,11 +121,26 @@ func ExamplePoolsClient_BeginCreateOrUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.CapacityPool = armnetapp.CapacityPool{ + // Name: to.Ptr("account1/pool1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.PoolProperties{ + // PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), + // ProvisioningState: to.Ptr("Succeeded"), + // QosType: to.Ptr(armnetapp.QosTypeAuto), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // Size: to.Ptr[int64](4398046511104), + // TotalThroughputMibps: to.Ptr[float32](281.474), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Pools_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Pools_Update.json func ExamplePoolsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -109,11 +159,27 @@ func ExamplePoolsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.CapacityPool = armnetapp.CapacityPool{ + // Name: to.Ptr("account1/pool1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.PoolProperties{ + // PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), + // ProvisioningState: to.Ptr("Succeeded"), + // QosType: to.Ptr(armnetapp.QosTypeManual), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // Size: to.Ptr[int64](4398046511104), + // TotalThroughputMibps: to.Ptr[float32](281.474), + // UtilizedThroughputMibps: to.Ptr[float32](100.47), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Pools_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Pools_Delete.json func ExamplePoolsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/netapp/armnetapp/resource_client.go b/sdk/resourcemanager/netapp/armnetapp/resource_client.go index 657eac540863..d01f24e4bf17 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resource_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/resource_client.go @@ -32,10 +32,9 @@ type ResourceClient struct { } // NewResourceClient creates a new instance of ResourceClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,11 +57,12 @@ func NewResourceClient(subscriptionID string, credential azcore.TokenCredential, // CheckFilePathAvailability - Check if a file path is available. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// location - The location -// body - File path availability request. -// options - ResourceClientCheckFilePathAvailabilityOptions contains the optional parameters for the ResourceClient.CheckFilePathAvailability -// method. +// +// Generated from API version 2022-09-01 +// - location - The name of Azure region. +// - body - File path availability request. +// - options - ResourceClientCheckFilePathAvailabilityOptions contains the optional parameters for the ResourceClient.CheckFilePathAvailability +// method. func (client *ResourceClient) CheckFilePathAvailability(ctx context.Context, location string, body FilePathAvailabilityRequest, options *ResourceClientCheckFilePathAvailabilityOptions) (ResourceClientCheckFilePathAvailabilityResponse, error) { req, err := client.checkFilePathAvailabilityCreateRequest(ctx, location, body, options) if err != nil { @@ -94,7 +94,7 @@ func (client *ResourceClient) checkFilePathAvailabilityCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -111,11 +111,12 @@ func (client *ResourceClient) checkFilePathAvailabilityHandleResponse(resp *http // CheckNameAvailability - Check if a resource name is available. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// location - The location -// body - Name availability request. -// options - ResourceClientCheckNameAvailabilityOptions contains the optional parameters for the ResourceClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-09-01 +// - location - The name of Azure region. +// - body - Name availability request. +// - options - ResourceClientCheckNameAvailabilityOptions contains the optional parameters for the ResourceClient.CheckNameAvailability +// method. func (client *ResourceClient) CheckNameAvailability(ctx context.Context, location string, body ResourceNameAvailabilityRequest, options *ResourceClientCheckNameAvailabilityOptions) (ResourceClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, location, body, options) if err != nil { @@ -147,7 +148,7 @@ func (client *ResourceClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -164,11 +165,12 @@ func (client *ResourceClient) checkNameAvailabilityHandleResponse(resp *http.Res // CheckQuotaAvailability - Check if a quota is available. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// location - The location -// body - Quota availability request. -// options - ResourceClientCheckQuotaAvailabilityOptions contains the optional parameters for the ResourceClient.CheckQuotaAvailability -// method. +// +// Generated from API version 2022-09-01 +// - location - The name of Azure region. +// - body - Quota availability request. +// - options - ResourceClientCheckQuotaAvailabilityOptions contains the optional parameters for the ResourceClient.CheckQuotaAvailability +// method. func (client *ResourceClient) CheckQuotaAvailability(ctx context.Context, location string, body QuotaAvailabilityRequest, options *ResourceClientCheckQuotaAvailabilityOptions) (ResourceClientCheckQuotaAvailabilityResponse, error) { req, err := client.checkQuotaAvailabilityCreateRequest(ctx, location, body, options) if err != nil { @@ -200,7 +202,7 @@ func (client *ResourceClient) checkQuotaAvailabilityCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -217,10 +219,11 @@ func (client *ResourceClient) checkQuotaAvailabilityHandleResponse(resp *http.Re // QueryRegionInfo - Provides storage to network proximity and logical zone mapping information. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// location - The location -// options - ResourceClientQueryRegionInfoOptions contains the optional parameters for the ResourceClient.QueryRegionInfo -// method. +// +// Generated from API version 2022-09-01 +// - location - The name of Azure region. +// - options - ResourceClientQueryRegionInfoOptions contains the optional parameters for the ResourceClient.QueryRegionInfo +// method. func (client *ResourceClient) QueryRegionInfo(ctx context.Context, location string, options *ResourceClientQueryRegionInfoOptions) (ResourceClientQueryRegionInfoResponse, error) { req, err := client.queryRegionInfoCreateRequest(ctx, location, options) if err != nil { @@ -252,7 +255,7 @@ func (client *ResourceClient) queryRegionInfoCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go index 23d98cd3c3ba..ed4780f19f7c 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/CheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/CheckNameAvailability.json func ExampleResourceClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -36,11 +37,15 @@ func ExampleResourceClient_CheckNameAvailability() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{ + // IsAvailable: to.Ptr(true), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/CheckFilePathAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/CheckFilePathAvailability.json func ExampleResourceClient_CheckFilePathAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -58,11 +63,15 @@ func ExampleResourceClient_CheckFilePathAvailability() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{ + // IsAvailable: to.Ptr(true), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/CheckQuotaAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/CheckQuotaAvailability.json func ExampleResourceClient_CheckQuotaAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -81,11 +90,15 @@ func ExampleResourceClient_CheckQuotaAvailability() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{ + // IsAvailable: to.Ptr(true), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/RegionInfo.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/RegionInfo.json func ExampleResourceClient_QueryRegionInfo() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -100,6 +113,15 @@ func ExampleResourceClient_QueryRegionInfo() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.RegionInfo = armnetapp.RegionInfo{ + // AvailabilityZoneMappings: []*armnetapp.RegionInfoAvailabilityZoneMappingsItem{ + // { + // AvailabilityZone: to.Ptr("1"), + // IsAvailable: to.Ptr(true), + // }}, + // StorageToNetworkProximity: to.Ptr(armnetapp.RegionStorageToNetworkProximityT2), + // } } diff --git a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go index 6f7f5176d9cd..c8a8ccd45df5 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go @@ -32,10 +32,9 @@ type ResourceQuotaLimitsClient struct { } // NewResourceQuotaLimitsClient creates a new instance of ResourceQuotaLimitsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewResourceQuotaLimitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceQuotaLimitsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,10 +57,11 @@ func NewResourceQuotaLimitsClient(subscriptionID string, credential azcore.Token // Get - Get the default and current subscription quota limit // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// location - The location -// quotaLimitName - The name of the Quota Limit -// options - ResourceQuotaLimitsClientGetOptions contains the optional parameters for the ResourceQuotaLimitsClient.Get method. +// +// Generated from API version 2022-09-01 +// - location - The name of Azure region. +// - quotaLimitName - The name of the Quota Limit +// - options - ResourceQuotaLimitsClientGetOptions contains the optional parameters for the ResourceQuotaLimitsClient.Get method. func (client *ResourceQuotaLimitsClient) Get(ctx context.Context, location string, quotaLimitName string, options *ResourceQuotaLimitsClientGetOptions) (ResourceQuotaLimitsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, location, quotaLimitName, options) if err != nil { @@ -97,7 +97,7 @@ func (client *ResourceQuotaLimitsClient) getCreateRequest(ctx context.Context, l return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,10 +113,11 @@ func (client *ResourceQuotaLimitsClient) getHandleResponse(resp *http.Response) } // NewListPager - Get the default and current limits for quotas -// Generated from API version 2022-05-01 -// location - The location -// options - ResourceQuotaLimitsClientListOptions contains the optional parameters for the ResourceQuotaLimitsClient.List -// method. +// +// Generated from API version 2022-09-01 +// - location - The name of Azure region. +// - options - ResourceQuotaLimitsClientListOptions contains the optional parameters for the ResourceQuotaLimitsClient.NewListPager +// method. func (client *ResourceQuotaLimitsClient) NewListPager(location string, options *ResourceQuotaLimitsClientListOptions) *runtime.Pager[ResourceQuotaLimitsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ResourceQuotaLimitsClientListResponse]{ More: func(page ResourceQuotaLimitsClientListResponse) bool { @@ -155,7 +156,7 @@ func (client *ResourceQuotaLimitsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go index 2897a1d6f831..fc7340b14f06 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/QuotaLimits_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/QuotaLimits_List.json func ExampleResourceQuotaLimitsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -29,18 +30,94 @@ func ExampleResourceQuotaLimitsClient_NewListPager() { } pager := client.NewListPager("eastus", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.SubscriptionQuotaItemList = armnetapp.SubscriptionQuotaItemList{ + // Value: []*armnetapp.SubscriptionQuotaItem{ + // { + // Name: to.Ptr("eastus/accountsPerSubscription"), + // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/accountsPerSubscription"), + // Properties: &armnetapp.SubscriptionQuotaItemProperties{ + // Default: to.Ptr[int32](10), + // Current: to.Ptr[int32](10), + // }, + // }, + // { + // Name: to.Ptr("eastus/poolsPerAccount"), + // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/poolsPerAccount"), + // Properties: &armnetapp.SubscriptionQuotaItemProperties{ + // Default: to.Ptr[int32](25), + // Current: to.Ptr[int32](25), + // }, + // }, + // { + // Name: to.Ptr("eastus/volumesPerPool"), + // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/volumesPerPool"), + // Properties: &armnetapp.SubscriptionQuotaItemProperties{ + // Default: to.Ptr[int32](500), + // Current: to.Ptr[int32](500), + // }, + // }, + // { + // Name: to.Ptr("eastus/snapshotsPerVolume"), + // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/snapshotsPerVolume"), + // Properties: &armnetapp.SubscriptionQuotaItemProperties{ + // Default: to.Ptr[int32](255), + // Current: to.Ptr[int32](255), + // }, + // }, + // { + // Name: to.Ptr("eastus/totalTiBsPerSubscription"), + // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalTiBsPerSubscription"), + // Properties: &armnetapp.SubscriptionQuotaItemProperties{ + // Default: to.Ptr[int32](25), + // Current: to.Ptr[int32](1000), + // }, + // }, + // { + // Name: to.Ptr("eastus/totalDPVolumesPerSubscription"), + // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalDPVolumesPerSubscription"), + // Properties: &armnetapp.SubscriptionQuotaItemProperties{ + // Default: to.Ptr[int32](10), + // Current: to.Ptr[int32](10), + // }, + // }, + // { + // Name: to.Ptr("eastus/totalVolumesPerSubscription"), + // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalVolumesPerSubscription"), + // Properties: &armnetapp.SubscriptionQuotaItemProperties{ + // Default: to.Ptr[int32](500), + // Current: to.Ptr[int32](500), + // }, + // }, + // { + // Name: to.Ptr("eastus/totalCoolAccessVolumesPerSubscription"), + // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalCoolAccessVolumesPerSubscription"), + // Properties: &armnetapp.SubscriptionQuotaItemProperties{ + // Default: to.Ptr[int32](10), + // Current: to.Ptr[int32](10), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/QuotaLimits_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/QuotaLimits_Get.json func ExampleResourceQuotaLimitsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -55,6 +132,16 @@ func ExampleResourceQuotaLimitsClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.SubscriptionQuotaItem = armnetapp.SubscriptionQuotaItem{ + // Name: to.Ptr("eastus/totalCoolAccessVolumesPerSubscription"), + // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalCoolAccessVolumesPerSubscription"), + // Properties: &armnetapp.SubscriptionQuotaItemProperties{ + // Default: to.Ptr[int32](10), + // Current: to.Ptr[int32](10), + // }, + // } } diff --git a/sdk/resourcemanager/netapp/armnetapp/response_types.go b/sdk/resourcemanager/netapp/armnetapp/response_types.go index 22fab5888606..60315af8efa7 100644 --- a/sdk/resourcemanager/netapp/armnetapp/response_types.go +++ b/sdk/resourcemanager/netapp/armnetapp/response_types.go @@ -9,7 +9,7 @@ package armnetapp -// AccountBackupsClientDeleteResponse contains the response from method AccountBackupsClient.Delete. +// AccountBackupsClientDeleteResponse contains the response from method AccountBackupsClient.BeginDelete. type AccountBackupsClientDeleteResponse struct { // placeholder for future response values } @@ -19,17 +19,17 @@ type AccountBackupsClientGetResponse struct { Backup } -// AccountBackupsClientListResponse contains the response from method AccountBackupsClient.List. +// AccountBackupsClientListResponse contains the response from method AccountBackupsClient.NewListPager. type AccountBackupsClientListResponse struct { BackupsList } -// AccountsClientCreateOrUpdateResponse contains the response from method AccountsClient.CreateOrUpdate. +// AccountsClientCreateOrUpdateResponse contains the response from method AccountsClient.BeginCreateOrUpdate. type AccountsClientCreateOrUpdateResponse struct { Account } -// AccountsClientDeleteResponse contains the response from method AccountsClient.Delete. +// AccountsClientDeleteResponse contains the response from method AccountsClient.BeginDelete. type AccountsClientDeleteResponse struct { // placeholder for future response values } @@ -39,32 +39,32 @@ type AccountsClientGetResponse struct { Account } -// AccountsClientListBySubscriptionResponse contains the response from method AccountsClient.ListBySubscription. +// AccountsClientListBySubscriptionResponse contains the response from method AccountsClient.NewListBySubscriptionPager. type AccountsClientListBySubscriptionResponse struct { AccountList } -// AccountsClientListResponse contains the response from method AccountsClient.List. +// AccountsClientListResponse contains the response from method AccountsClient.NewListPager. type AccountsClientListResponse struct { AccountList } -// AccountsClientRenewCredentialsResponse contains the response from method AccountsClient.RenewCredentials. +// AccountsClientRenewCredentialsResponse contains the response from method AccountsClient.BeginRenewCredentials. type AccountsClientRenewCredentialsResponse struct { // placeholder for future response values } -// AccountsClientUpdateResponse contains the response from method AccountsClient.Update. +// AccountsClientUpdateResponse contains the response from method AccountsClient.BeginUpdate. type AccountsClientUpdateResponse struct { Account } -// BackupPoliciesClientCreateResponse contains the response from method BackupPoliciesClient.Create. +// BackupPoliciesClientCreateResponse contains the response from method BackupPoliciesClient.BeginCreate. type BackupPoliciesClientCreateResponse struct { BackupPolicy } -// BackupPoliciesClientDeleteResponse contains the response from method BackupPoliciesClient.Delete. +// BackupPoliciesClientDeleteResponse contains the response from method BackupPoliciesClient.BeginDelete. type BackupPoliciesClientDeleteResponse struct { // placeholder for future response values } @@ -74,22 +74,22 @@ type BackupPoliciesClientGetResponse struct { BackupPolicy } -// BackupPoliciesClientListResponse contains the response from method BackupPoliciesClient.List. +// BackupPoliciesClientListResponse contains the response from method BackupPoliciesClient.NewListPager. type BackupPoliciesClientListResponse struct { BackupPoliciesList } -// BackupPoliciesClientUpdateResponse contains the response from method BackupPoliciesClient.Update. +// BackupPoliciesClientUpdateResponse contains the response from method BackupPoliciesClient.BeginUpdate. type BackupPoliciesClientUpdateResponse struct { BackupPolicy } -// BackupsClientCreateResponse contains the response from method BackupsClient.Create. +// BackupsClientCreateResponse contains the response from method BackupsClient.BeginCreate. type BackupsClientCreateResponse struct { Backup } -// BackupsClientDeleteResponse contains the response from method BackupsClient.Delete. +// BackupsClientDeleteResponse contains the response from method BackupsClient.BeginDelete. type BackupsClientDeleteResponse struct { // placeholder for future response values } @@ -109,27 +109,32 @@ type BackupsClientGetVolumeRestoreStatusResponse struct { RestoreStatus } -// BackupsClientListResponse contains the response from method BackupsClient.List. +// BackupsClientListResponse contains the response from method BackupsClient.NewListPager. type BackupsClientListResponse struct { BackupsList } -// BackupsClientUpdateResponse contains the response from method BackupsClient.Update. +// BackupsClientRestoreFilesResponse contains the response from method BackupsClient.BeginRestoreFiles. +type BackupsClientRestoreFilesResponse struct { + // placeholder for future response values +} + +// BackupsClientUpdateResponse contains the response from method BackupsClient.BeginUpdate. type BackupsClientUpdateResponse struct { Backup } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } -// PoolsClientCreateOrUpdateResponse contains the response from method PoolsClient.CreateOrUpdate. +// PoolsClientCreateOrUpdateResponse contains the response from method PoolsClient.BeginCreateOrUpdate. type PoolsClientCreateOrUpdateResponse struct { CapacityPool } -// PoolsClientDeleteResponse contains the response from method PoolsClient.Delete. +// PoolsClientDeleteResponse contains the response from method PoolsClient.BeginDelete. type PoolsClientDeleteResponse struct { // placeholder for future response values } @@ -139,12 +144,12 @@ type PoolsClientGetResponse struct { CapacityPool } -// PoolsClientListResponse contains the response from method PoolsClient.List. +// PoolsClientListResponse contains the response from method PoolsClient.NewListPager. type PoolsClientListResponse struct { CapacityPoolList } -// PoolsClientUpdateResponse contains the response from method PoolsClient.Update. +// PoolsClientUpdateResponse contains the response from method PoolsClient.BeginUpdate. type PoolsClientUpdateResponse struct { CapacityPool } @@ -174,7 +179,7 @@ type ResourceQuotaLimitsClientGetResponse struct { SubscriptionQuotaItem } -// ResourceQuotaLimitsClientListResponse contains the response from method ResourceQuotaLimitsClient.List. +// ResourceQuotaLimitsClientListResponse contains the response from method ResourceQuotaLimitsClient.NewListPager. type ResourceQuotaLimitsClientListResponse struct { SubscriptionQuotaItemList } @@ -184,7 +189,7 @@ type SnapshotPoliciesClientCreateResponse struct { SnapshotPolicy } -// SnapshotPoliciesClientDeleteResponse contains the response from method SnapshotPoliciesClient.Delete. +// SnapshotPoliciesClientDeleteResponse contains the response from method SnapshotPoliciesClient.BeginDelete. type SnapshotPoliciesClientDeleteResponse struct { // placeholder for future response values } @@ -194,7 +199,7 @@ type SnapshotPoliciesClientGetResponse struct { SnapshotPolicy } -// SnapshotPoliciesClientListResponse contains the response from method SnapshotPoliciesClient.List. +// SnapshotPoliciesClientListResponse contains the response from method SnapshotPoliciesClient.NewListPager. type SnapshotPoliciesClientListResponse struct { SnapshotPoliciesList } @@ -204,17 +209,17 @@ type SnapshotPoliciesClientListVolumesResponse struct { SnapshotPolicyVolumeList } -// SnapshotPoliciesClientUpdateResponse contains the response from method SnapshotPoliciesClient.Update. +// SnapshotPoliciesClientUpdateResponse contains the response from method SnapshotPoliciesClient.BeginUpdate. type SnapshotPoliciesClientUpdateResponse struct { SnapshotPolicy } -// SnapshotsClientCreateResponse contains the response from method SnapshotsClient.Create. +// SnapshotsClientCreateResponse contains the response from method SnapshotsClient.BeginCreate. type SnapshotsClientCreateResponse struct { Snapshot } -// SnapshotsClientDeleteResponse contains the response from method SnapshotsClient.Delete. +// SnapshotsClientDeleteResponse contains the response from method SnapshotsClient.BeginDelete. type SnapshotsClientDeleteResponse struct { // placeholder for future response values } @@ -224,32 +229,32 @@ type SnapshotsClientGetResponse struct { Snapshot } -// SnapshotsClientListResponse contains the response from method SnapshotsClient.List. +// SnapshotsClientListResponse contains the response from method SnapshotsClient.NewListPager. type SnapshotsClientListResponse struct { SnapshotsList } -// SnapshotsClientRestoreFilesResponse contains the response from method SnapshotsClient.RestoreFiles. +// SnapshotsClientRestoreFilesResponse contains the response from method SnapshotsClient.BeginRestoreFiles. type SnapshotsClientRestoreFilesResponse struct { // placeholder for future response values } -// SnapshotsClientUpdateResponse contains the response from method SnapshotsClient.Update. +// SnapshotsClientUpdateResponse contains the response from method SnapshotsClient.BeginUpdate. type SnapshotsClientUpdateResponse struct { Snapshot } -// SubvolumesClientCreateResponse contains the response from method SubvolumesClient.Create. +// SubvolumesClientCreateResponse contains the response from method SubvolumesClient.BeginCreate. type SubvolumesClientCreateResponse struct { SubvolumeInfo } -// SubvolumesClientDeleteResponse contains the response from method SubvolumesClient.Delete. +// SubvolumesClientDeleteResponse contains the response from method SubvolumesClient.BeginDelete. type SubvolumesClientDeleteResponse struct { // placeholder for future response values } -// SubvolumesClientGetMetadataResponse contains the response from method SubvolumesClient.GetMetadata. +// SubvolumesClientGetMetadataResponse contains the response from method SubvolumesClient.BeginGetMetadata. type SubvolumesClientGetMetadataResponse struct { SubvolumeModel } @@ -259,27 +264,22 @@ type SubvolumesClientGetResponse struct { SubvolumeInfo } -// SubvolumesClientListByVolumeResponse contains the response from method SubvolumesClient.ListByVolume. +// SubvolumesClientListByVolumeResponse contains the response from method SubvolumesClient.NewListByVolumePager. type SubvolumesClientListByVolumeResponse struct { SubvolumesList } -// SubvolumesClientUpdateResponse contains the response from method SubvolumesClient.Update. +// SubvolumesClientUpdateResponse contains the response from method SubvolumesClient.BeginUpdate. type SubvolumesClientUpdateResponse struct { SubvolumeInfo } -// VaultsClientListResponse contains the response from method VaultsClient.List. -type VaultsClientListResponse struct { - VaultList -} - -// VolumeGroupsClientCreateResponse contains the response from method VolumeGroupsClient.Create. +// VolumeGroupsClientCreateResponse contains the response from method VolumeGroupsClient.BeginCreate. type VolumeGroupsClientCreateResponse struct { VolumeGroupDetails } -// VolumeGroupsClientDeleteResponse contains the response from method VolumeGroupsClient.Delete. +// VolumeGroupsClientDeleteResponse contains the response from method VolumeGroupsClient.BeginDelete. type VolumeGroupsClientDeleteResponse struct { // placeholder for future response values } @@ -289,17 +289,17 @@ type VolumeGroupsClientGetResponse struct { VolumeGroupDetails } -// VolumeGroupsClientListByNetAppAccountResponse contains the response from method VolumeGroupsClient.ListByNetAppAccount. +// VolumeGroupsClientListByNetAppAccountResponse contains the response from method VolumeGroupsClient.NewListByNetAppAccountPager. type VolumeGroupsClientListByNetAppAccountResponse struct { VolumeGroupList } -// VolumeQuotaRulesClientCreateResponse contains the response from method VolumeQuotaRulesClient.Create. +// VolumeQuotaRulesClientCreateResponse contains the response from method VolumeQuotaRulesClient.BeginCreate. type VolumeQuotaRulesClientCreateResponse struct { VolumeQuotaRule } -// VolumeQuotaRulesClientDeleteResponse contains the response from method VolumeQuotaRulesClient.Delete. +// VolumeQuotaRulesClientDeleteResponse contains the response from method VolumeQuotaRulesClient.BeginDelete. type VolumeQuotaRulesClientDeleteResponse struct { // placeholder for future response values } @@ -309,42 +309,47 @@ type VolumeQuotaRulesClientGetResponse struct { VolumeQuotaRule } -// VolumeQuotaRulesClientListByVolumeResponse contains the response from method VolumeQuotaRulesClient.ListByVolume. +// VolumeQuotaRulesClientListByVolumeResponse contains the response from method VolumeQuotaRulesClient.NewListByVolumePager. type VolumeQuotaRulesClientListByVolumeResponse struct { VolumeQuotaRulesList } -// VolumeQuotaRulesClientUpdateResponse contains the response from method VolumeQuotaRulesClient.Update. +// VolumeQuotaRulesClientUpdateResponse contains the response from method VolumeQuotaRulesClient.BeginUpdate. type VolumeQuotaRulesClientUpdateResponse struct { VolumeQuotaRule } -// VolumesClientAuthorizeReplicationResponse contains the response from method VolumesClient.AuthorizeReplication. +// VolumesClientAuthorizeReplicationResponse contains the response from method VolumesClient.BeginAuthorizeReplication. type VolumesClientAuthorizeReplicationResponse struct { // placeholder for future response values } -// VolumesClientBreakReplicationResponse contains the response from method VolumesClient.BreakReplication. +// VolumesClientBreakFileLocksResponse contains the response from method VolumesClient.BeginBreakFileLocks. +type VolumesClientBreakFileLocksResponse struct { + // placeholder for future response values +} + +// VolumesClientBreakReplicationResponse contains the response from method VolumesClient.BeginBreakReplication. type VolumesClientBreakReplicationResponse struct { // placeholder for future response values } -// VolumesClientCreateOrUpdateResponse contains the response from method VolumesClient.CreateOrUpdate. +// VolumesClientCreateOrUpdateResponse contains the response from method VolumesClient.BeginCreateOrUpdate. type VolumesClientCreateOrUpdateResponse struct { Volume } -// VolumesClientDeleteReplicationResponse contains the response from method VolumesClient.DeleteReplication. +// VolumesClientDeleteReplicationResponse contains the response from method VolumesClient.BeginDeleteReplication. type VolumesClientDeleteReplicationResponse struct { // placeholder for future response values } -// VolumesClientDeleteResponse contains the response from method VolumesClient.Delete. +// VolumesClientDeleteResponse contains the response from method VolumesClient.BeginDelete. type VolumesClientDeleteResponse struct { // placeholder for future response values } -// VolumesClientFinalizeRelocationResponse contains the response from method VolumesClient.FinalizeRelocation. +// VolumesClientFinalizeRelocationResponse contains the response from method VolumesClient.BeginFinalizeRelocation. type VolumesClientFinalizeRelocationResponse struct { // placeholder for future response values } @@ -354,32 +359,32 @@ type VolumesClientGetResponse struct { Volume } -// VolumesClientListReplicationsResponse contains the response from method VolumesClient.ListReplications. +// VolumesClientListReplicationsResponse contains the response from method VolumesClient.NewListReplicationsPager. type VolumesClientListReplicationsResponse struct { ListReplications } -// VolumesClientListResponse contains the response from method VolumesClient.List. +// VolumesClientListResponse contains the response from method VolumesClient.NewListPager. type VolumesClientListResponse struct { VolumeList } -// VolumesClientPoolChangeResponse contains the response from method VolumesClient.PoolChange. +// VolumesClientPoolChangeResponse contains the response from method VolumesClient.BeginPoolChange. type VolumesClientPoolChangeResponse struct { // placeholder for future response values } -// VolumesClientReInitializeReplicationResponse contains the response from method VolumesClient.ReInitializeReplication. +// VolumesClientReInitializeReplicationResponse contains the response from method VolumesClient.BeginReInitializeReplication. type VolumesClientReInitializeReplicationResponse struct { // placeholder for future response values } -// VolumesClientReestablishReplicationResponse contains the response from method VolumesClient.ReestablishReplication. +// VolumesClientReestablishReplicationResponse contains the response from method VolumesClient.BeginReestablishReplication. type VolumesClientReestablishReplicationResponse struct { // placeholder for future response values } -// VolumesClientRelocateResponse contains the response from method VolumesClient.Relocate. +// VolumesClientRelocateResponse contains the response from method VolumesClient.BeginRelocate. type VolumesClientRelocateResponse struct { // placeholder for future response values } @@ -389,27 +394,27 @@ type VolumesClientReplicationStatusResponse struct { ReplicationStatus } -// VolumesClientResetCifsPasswordResponse contains the response from method VolumesClient.ResetCifsPassword. +// VolumesClientResetCifsPasswordResponse contains the response from method VolumesClient.BeginResetCifsPassword. type VolumesClientResetCifsPasswordResponse struct { // placeholder for future response values } -// VolumesClientResyncReplicationResponse contains the response from method VolumesClient.ResyncReplication. +// VolumesClientResyncReplicationResponse contains the response from method VolumesClient.BeginResyncReplication. type VolumesClientResyncReplicationResponse struct { // placeholder for future response values } -// VolumesClientRevertRelocationResponse contains the response from method VolumesClient.RevertRelocation. +// VolumesClientRevertRelocationResponse contains the response from method VolumesClient.BeginRevertRelocation. type VolumesClientRevertRelocationResponse struct { // placeholder for future response values } -// VolumesClientRevertResponse contains the response from method VolumesClient.Revert. +// VolumesClientRevertResponse contains the response from method VolumesClient.BeginRevert. type VolumesClientRevertResponse struct { // placeholder for future response values } -// VolumesClientUpdateResponse contains the response from method VolumesClient.Update. +// VolumesClientUpdateResponse contains the response from method VolumesClient.BeginUpdate. type VolumesClientUpdateResponse struct { Volume } diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go index 785465a8a8ab..5b2be90b0d60 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go @@ -32,10 +32,9 @@ type SnapshotPoliciesClient struct { } // NewSnapshotPoliciesClient creates a new instance of SnapshotPoliciesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSnapshotPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +57,13 @@ func NewSnapshotPoliciesClient(subscriptionID string, credential azcore.TokenCre // Create - Create a snapshot policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// snapshotPolicyName - The name of the snapshot policy -// body - Snapshot policy object supplied in the body of the operation. -// options - SnapshotPoliciesClientCreateOptions contains the optional parameters for the SnapshotPoliciesClient.Create method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - snapshotPolicyName - The name of the snapshot policy +// - body - Snapshot policy object supplied in the body of the operation. +// - options - SnapshotPoliciesClientCreateOptions contains the optional parameters for the SnapshotPoliciesClient.Create method. func (client *SnapshotPoliciesClient) Create(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, body SnapshotPolicy, options *SnapshotPoliciesClientCreateOptions) (SnapshotPoliciesClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, body, options) if err != nil { @@ -103,7 +103,7 @@ func (client *SnapshotPoliciesClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -120,12 +120,13 @@ func (client *SnapshotPoliciesClient) createHandleResponse(resp *http.Response) // BeginDelete - Delete snapshot policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// snapshotPolicyName - The name of the snapshot policy -// options - SnapshotPoliciesClientBeginDeleteOptions contains the optional parameters for the SnapshotPoliciesClient.BeginDelete -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - snapshotPolicyName - The name of the snapshot policy +// - options - SnapshotPoliciesClientBeginDeleteOptions contains the optional parameters for the SnapshotPoliciesClient.BeginDelete +// method. func (client *SnapshotPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, options *SnapshotPoliciesClientBeginDeleteOptions) (*runtime.Poller[SnapshotPoliciesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, snapshotPolicyName, options) @@ -142,7 +143,8 @@ func (client *SnapshotPoliciesClient) BeginDelete(ctx context.Context, resourceG // Delete - Delete snapshot policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *SnapshotPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, options *SnapshotPoliciesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, options) if err != nil { @@ -182,18 +184,19 @@ func (client *SnapshotPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get a snapshot Policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// snapshotPolicyName - The name of the snapshot policy -// options - SnapshotPoliciesClientGetOptions contains the optional parameters for the SnapshotPoliciesClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - snapshotPolicyName - The name of the snapshot policy +// - options - SnapshotPoliciesClientGetOptions contains the optional parameters for the SnapshotPoliciesClient.Get method. func (client *SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, options *SnapshotPoliciesClientGetOptions) (SnapshotPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, options) if err != nil { @@ -233,7 +236,7 @@ func (client *SnapshotPoliciesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,10 +252,12 @@ func (client *SnapshotPoliciesClient) getHandleResponse(resp *http.Response) (Sn } // NewListPager - List snapshot policy -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// options - SnapshotPoliciesClientListOptions contains the optional parameters for the SnapshotPoliciesClient.List method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - options - SnapshotPoliciesClientListOptions contains the optional parameters for the SnapshotPoliciesClient.NewListPager +// method. func (client *SnapshotPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *SnapshotPoliciesClientListOptions) *runtime.Pager[SnapshotPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SnapshotPoliciesClientListResponse]{ More: func(page SnapshotPoliciesClientListResponse) bool { @@ -295,7 +300,7 @@ func (client *SnapshotPoliciesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,12 +317,13 @@ func (client *SnapshotPoliciesClient) listHandleResponse(resp *http.Response) (S // ListVolumes - Get volumes associated with snapshot policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// snapshotPolicyName - The name of the snapshot policy -// options - SnapshotPoliciesClientListVolumesOptions contains the optional parameters for the SnapshotPoliciesClient.ListVolumes -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - snapshotPolicyName - The name of the snapshot policy +// - options - SnapshotPoliciesClientListVolumesOptions contains the optional parameters for the SnapshotPoliciesClient.ListVolumes +// method. func (client *SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, options *SnapshotPoliciesClientListVolumesOptions) (SnapshotPoliciesClientListVolumesResponse, error) { req, err := client.listVolumesCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, options) if err != nil { @@ -357,7 +363,7 @@ func (client *SnapshotPoliciesClient) listVolumesCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -374,13 +380,14 @@ func (client *SnapshotPoliciesClient) listVolumesHandleResponse(resp *http.Respo // BeginUpdate - Patch a snapshot policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// snapshotPolicyName - The name of the snapshot policy -// body - Snapshot policy object supplied in the body of the operation. -// options - SnapshotPoliciesClientBeginUpdateOptions contains the optional parameters for the SnapshotPoliciesClient.BeginUpdate -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - snapshotPolicyName - The name of the snapshot policy +// - body - Snapshot policy object supplied in the body of the operation. +// - options - SnapshotPoliciesClientBeginUpdateOptions contains the optional parameters for the SnapshotPoliciesClient.BeginUpdate +// method. func (client *SnapshotPoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, body SnapshotPolicyPatch, options *SnapshotPoliciesClientBeginUpdateOptions) (*runtime.Poller[SnapshotPoliciesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, snapshotPolicyName, body, options) @@ -397,7 +404,8 @@ func (client *SnapshotPoliciesClient) BeginUpdate(ctx context.Context, resourceG // Update - Patch a snapshot policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *SnapshotPoliciesClient) update(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, body SnapshotPolicyPatch, options *SnapshotPoliciesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, body, options) if err != nil { @@ -437,7 +445,7 @@ func (client *SnapshotPoliciesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go index 60f252ef2239..26ac9b0252a8 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/SnapshotPolicies_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/SnapshotPolicies_List.json func ExampleSnapshotPoliciesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,18 +31,53 @@ func ExampleSnapshotPoliciesClient_NewListPager() { } pager := client.NewListPager("myRG", "account1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.SnapshotPoliciesList = armnetapp.SnapshotPoliciesList{ + // Value: []*armnetapp.SnapshotPolicy{ + // { + // Name: to.Ptr("account1/snapshotPolicy1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.SnapshotPolicyProperties{ + // DailySchedule: &armnetapp.DailySchedule{ + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](30), + // SnapshotsToKeep: to.Ptr[int32](4), + // }, + // Enabled: to.Ptr(true), + // HourlySchedule: &armnetapp.HourlySchedule{ + // Minute: to.Ptr[int32](50), + // SnapshotsToKeep: to.Ptr[int32](2), + // }, + // MonthlySchedule: &armnetapp.MonthlySchedule{ + // DaysOfMonth: to.Ptr("10,11,12"), + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](15), + // SnapshotsToKeep: to.Ptr[int32](5), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // WeeklySchedule: &armnetapp.WeeklySchedule{ + // Day: to.Ptr("Wednesday"), + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](45), + // SnapshotsToKeep: to.Ptr[int32](3), + // }, + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/SnapshotPolicies_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/SnapshotPolicies_Get.json func ExampleSnapshotPoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,11 +92,43 @@ func ExampleSnapshotPoliciesClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.SnapshotPolicy = armnetapp.SnapshotPolicy{ + // Name: to.Ptr("account1/snapshotPolicy1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.SnapshotPolicyProperties{ + // DailySchedule: &armnetapp.DailySchedule{ + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](30), + // SnapshotsToKeep: to.Ptr[int32](4), + // }, + // Enabled: to.Ptr(true), + // HourlySchedule: &armnetapp.HourlySchedule{ + // Minute: to.Ptr[int32](50), + // SnapshotsToKeep: to.Ptr[int32](2), + // }, + // MonthlySchedule: &armnetapp.MonthlySchedule{ + // DaysOfMonth: to.Ptr("10,11,12"), + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](15), + // SnapshotsToKeep: to.Ptr[int32](5), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // WeeklySchedule: &armnetapp.WeeklySchedule{ + // Day: to.Ptr("Wednesday"), + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](45), + // SnapshotsToKeep: to.Ptr[int32](3), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/SnapshotPolicies_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/SnapshotPolicies_Create.json func ExampleSnapshotPoliciesClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,11 +169,43 @@ func ExampleSnapshotPoliciesClient_Create() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.SnapshotPolicy = armnetapp.SnapshotPolicy{ + // Name: to.Ptr("account1/snapshotPolicy1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.SnapshotPolicyProperties{ + // DailySchedule: &armnetapp.DailySchedule{ + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](30), + // SnapshotsToKeep: to.Ptr[int32](4), + // }, + // Enabled: to.Ptr(true), + // HourlySchedule: &armnetapp.HourlySchedule{ + // Minute: to.Ptr[int32](50), + // SnapshotsToKeep: to.Ptr[int32](2), + // }, + // MonthlySchedule: &armnetapp.MonthlySchedule{ + // DaysOfMonth: to.Ptr("10,11,12"), + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](15), + // SnapshotsToKeep: to.Ptr[int32](5), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // WeeklySchedule: &armnetapp.WeeklySchedule{ + // Day: to.Ptr("Wednesday"), + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](45), + // SnapshotsToKeep: to.Ptr[int32](3), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/SnapshotPolicies_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/SnapshotPolicies_Update.json func ExampleSnapshotPoliciesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -150,11 +250,43 @@ func ExampleSnapshotPoliciesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.SnapshotPolicy = armnetapp.SnapshotPolicy{ + // Name: to.Ptr("account1/snapshotPolicy1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.SnapshotPolicyProperties{ + // DailySchedule: &armnetapp.DailySchedule{ + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](30), + // SnapshotsToKeep: to.Ptr[int32](4), + // }, + // Enabled: to.Ptr(true), + // HourlySchedule: &armnetapp.HourlySchedule{ + // Minute: to.Ptr[int32](50), + // SnapshotsToKeep: to.Ptr[int32](2), + // }, + // MonthlySchedule: &armnetapp.MonthlySchedule{ + // DaysOfMonth: to.Ptr("10,11,12"), + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](15), + // SnapshotsToKeep: to.Ptr[int32](5), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // WeeklySchedule: &armnetapp.WeeklySchedule{ + // Day: to.Ptr("Wednesday"), + // Hour: to.Ptr[int32](14), + // Minute: to.Ptr[int32](45), + // SnapshotsToKeep: to.Ptr[int32](3), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/SnapshotPolicies_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/SnapshotPolicies_Delete.json func ExampleSnapshotPoliciesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +307,7 @@ func ExampleSnapshotPoliciesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/SnapshotPolicies_ListVolumes.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/SnapshotPolicies_ListVolumes.json func ExampleSnapshotPoliciesClient_ListVolumes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -190,6 +322,25 @@ func ExampleSnapshotPoliciesClient_ListVolumes() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.SnapshotPolicyVolumeList = armnetapp.SnapshotPolicyVolumeList{ + // Value: []*armnetapp.Volume{ + // { + // Name: to.Ptr("account1/pool1/volume1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("some-amazing-filepath"), + // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](128), + // UsageThreshold: to.Ptr[int64](107374182400), + // }, + // }}, + // } } diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go b/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go index fef3c845a58f..884873c20a5d 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go @@ -32,10 +32,9 @@ type SnapshotsClient struct { } // NewSnapshotsClient creates a new instance of SnapshotsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +57,15 @@ func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreate - Create the specified snapshot within the given volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// snapshotName - The name of the snapshot -// body - Snapshot object supplied in the body of the operation. -// options - SnapshotsClientBeginCreateOptions contains the optional parameters for the SnapshotsClient.BeginCreate method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - snapshotName - The name of the snapshot +// - body - Snapshot object supplied in the body of the operation. +// - options - SnapshotsClientBeginCreateOptions contains the optional parameters for the SnapshotsClient.BeginCreate method. func (client *SnapshotsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body Snapshot, options *SnapshotsClientBeginCreateOptions) (*runtime.Poller[SnapshotsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, body, options) @@ -82,7 +82,8 @@ func (client *SnapshotsClient) BeginCreate(ctx context.Context, resourceGroupNam // Create - Create the specified snapshot within the given volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *SnapshotsClient) create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body Snapshot, options *SnapshotsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, body, options) if err != nil { @@ -130,7 +131,7 @@ func (client *SnapshotsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -138,13 +139,14 @@ func (client *SnapshotsClient) createCreateRequest(ctx context.Context, resource // BeginDelete - Delete snapshot // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// snapshotName - The name of the snapshot -// options - SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - snapshotName - The name of the snapshot +// - options - SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*runtime.Poller[SnapshotsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, options) @@ -161,7 +163,8 @@ func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Delete snapshot // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *SnapshotsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, options) if err != nil { @@ -209,20 +212,21 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get details of the specified snapshot // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// snapshotName - The name of the snapshot -// options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - snapshotName - The name of the snapshot +// - options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, options *SnapshotsClientGetOptions) (SnapshotsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, options) if err != nil { @@ -270,7 +274,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,12 +290,13 @@ func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (Snapshots } // NewListPager - List all snapshots associated with the volume -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.List method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. func (client *SnapshotsClient) NewListPager(resourceGroupName string, accountName string, poolName string, volumeName string, options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListResponse]{ More: func(page SnapshotsClientListResponse) bool { @@ -342,7 +347,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,15 +364,16 @@ func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (Snapshot // BeginRestoreFiles - Restore the specified files from the specified snapshot to the active filesystem // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// snapshotName - The name of the snapshot -// body - Restore payload supplied in the body of the operation. -// options - SnapshotsClientBeginRestoreFilesOptions contains the optional parameters for the SnapshotsClient.BeginRestoreFiles -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - snapshotName - The name of the snapshot +// - body - Restore payload supplied in the body of the operation. +// - options - SnapshotsClientBeginRestoreFilesOptions contains the optional parameters for the SnapshotsClient.BeginRestoreFiles +// method. func (client *SnapshotsClient) BeginRestoreFiles(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body SnapshotRestoreFiles, options *SnapshotsClientBeginRestoreFilesOptions) (*runtime.Poller[SnapshotsClientRestoreFilesResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.restoreFiles(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, body, options) @@ -382,7 +388,8 @@ func (client *SnapshotsClient) BeginRestoreFiles(ctx context.Context, resourceGr // RestoreFiles - Restore the specified files from the specified snapshot to the active filesystem // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *SnapshotsClient) restoreFiles(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body SnapshotRestoreFiles, options *SnapshotsClientBeginRestoreFilesOptions) (*http.Response, error) { req, err := client.restoreFilesCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, body, options) if err != nil { @@ -430,22 +437,23 @@ func (client *SnapshotsClient) restoreFilesCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, body) } // BeginUpdate - Patch a snapshot // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// snapshotName - The name of the snapshot -// body - Snapshot object supplied in the body of the operation. -// options - SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. -func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body interface{}, options *SnapshotsClientBeginUpdateOptions) (*runtime.Poller[SnapshotsClientUpdateResponse], error) { +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - snapshotName - The name of the snapshot +// - body - Snapshot object supplied in the body of the operation. +// - options - SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. +func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body any, options *SnapshotsClientBeginUpdateOptions) (*runtime.Poller[SnapshotsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, body, options) if err != nil { @@ -461,8 +469,9 @@ func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Patch a snapshot // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -func (client *SnapshotsClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body interface{}, options *SnapshotsClientBeginUpdateOptions) (*http.Response, error) { +// +// Generated from API version 2022-09-01 +func (client *SnapshotsClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body any, options *SnapshotsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, body, options) if err != nil { return nil, err @@ -478,7 +487,7 @@ func (client *SnapshotsClient) update(ctx context.Context, resourceGroupName str } // updateCreateRequest creates the Update request. -func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body interface{}, options *SnapshotsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body any, options *SnapshotsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -509,7 +518,7 @@ func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go index 5d008df17787..52f6a80a7e10 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Snapshots_List.json func ExampleSnapshotsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,18 +31,33 @@ func ExampleSnapshotsClient_NewListPager() { } pager := client.NewListPager("myRG", "account1", "pool1", "volume1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.SnapshotsList = armnetapp.SnapshotsList{ + // Value: []*armnetapp.Snapshot{ + // { + // Name: to.Ptr("account1/pool1/volume1/snapshot1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.SnapshotProperties{ + // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // ProvisioningState: to.Ptr("Succeeded"), + // SnapshotID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Snapshots_Get.json func ExampleSnapshotsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,11 +72,23 @@ func ExampleSnapshotsClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.Snapshot = armnetapp.Snapshot{ + // Name: to.Ptr("account1/pool1/volume1/snapshot1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.SnapshotProperties{ + // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // ProvisioningState: to.Ptr("Succeeded"), + // SnapshotID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Snapshots_Create.json func ExampleSnapshotsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,7 +111,7 @@ func ExampleSnapshotsClient_BeginCreate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Snapshots_Update.json func ExampleSnapshotsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,7 +122,7 @@ func ExampleSnapshotsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", map[string]interface{}{}, nil) + poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", map[string]any{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -102,11 +130,23 @@ func ExampleSnapshotsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.Snapshot = armnetapp.Snapshot{ + // Name: to.Ptr("account1/pool1/volume1/snapshot1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.SnapshotProperties{ + // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // ProvisioningState: to.Ptr("Succeeded"), + // SnapshotID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Snapshots_Delete.json func ExampleSnapshotsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -127,7 +167,7 @@ func ExampleSnapshotsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_SingleFileRestore.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Snapshots_SingleFileRestore.json func ExampleSnapshotsClient_BeginRestoreFiles() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go index 9cced2fc0128..5ffaa9268a4b 100644 --- a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go @@ -32,10 +32,9 @@ type SubvolumesClient struct { } // NewSubvolumesClient creates a new instance of SubvolumesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSubvolumesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubvolumesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +57,15 @@ func NewSubvolumesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Creates a subvolume in the path or clones the subvolume mentioned in the parentPath // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// subvolumeName - The name of the subvolume. -// body - Subvolume object supplied in the body of the operation. -// options - SubvolumesClientBeginCreateOptions contains the optional parameters for the SubvolumesClient.BeginCreate method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - subvolumeName - The name of the subvolume. +// - body - Subvolume object supplied in the body of the operation. +// - options - SubvolumesClientBeginCreateOptions contains the optional parameters for the SubvolumesClient.BeginCreate method. func (client *SubvolumesClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, body SubvolumeInfo, options *SubvolumesClientBeginCreateOptions) (*runtime.Poller[SubvolumesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, options) @@ -82,7 +82,8 @@ func (client *SubvolumesClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Creates a subvolume in the path or clones the subvolume mentioned in the parentPath // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *SubvolumesClient) create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, body SubvolumeInfo, options *SubvolumesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, options) if err != nil { @@ -130,7 +131,7 @@ func (client *SubvolumesClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -138,13 +139,14 @@ func (client *SubvolumesClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Delete subvolume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// subvolumeName - The name of the subvolume. -// options - SubvolumesClientBeginDeleteOptions contains the optional parameters for the SubvolumesClient.BeginDelete method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - subvolumeName - The name of the subvolume. +// - options - SubvolumesClientBeginDeleteOptions contains the optional parameters for the SubvolumesClient.BeginDelete method. func (client *SubvolumesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, options *SubvolumesClientBeginDeleteOptions) (*runtime.Poller[SubvolumesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, options) @@ -161,7 +163,8 @@ func (client *SubvolumesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete subvolume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *SubvolumesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, options *SubvolumesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, options) if err != nil { @@ -209,20 +212,21 @@ func (client *SubvolumesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Returns the path associated with the subvolumeName provided // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// subvolumeName - The name of the subvolume. -// options - SubvolumesClientGetOptions contains the optional parameters for the SubvolumesClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - subvolumeName - The name of the subvolume. +// - options - SubvolumesClientGetOptions contains the optional parameters for the SubvolumesClient.Get method. func (client *SubvolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, options *SubvolumesClientGetOptions) (SubvolumesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, options) if err != nil { @@ -270,7 +274,7 @@ func (client *SubvolumesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,14 +291,15 @@ func (client *SubvolumesClient) getHandleResponse(resp *http.Response) (Subvolum // BeginGetMetadata - Get details of the specified subvolume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// subvolumeName - The name of the subvolume. -// options - SubvolumesClientBeginGetMetadataOptions contains the optional parameters for the SubvolumesClient.BeginGetMetadata -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - subvolumeName - The name of the subvolume. +// - options - SubvolumesClientBeginGetMetadataOptions contains the optional parameters for the SubvolumesClient.BeginGetMetadata +// method. func (client *SubvolumesClient) BeginGetMetadata(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, options *SubvolumesClientBeginGetMetadataOptions) (*runtime.Poller[SubvolumesClientGetMetadataResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.getMetadata(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, options) @@ -311,7 +316,8 @@ func (client *SubvolumesClient) BeginGetMetadata(ctx context.Context, resourceGr // GetMetadata - Get details of the specified subvolume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *SubvolumesClient) getMetadata(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, options *SubvolumesClientBeginGetMetadataOptions) (*http.Response, error) { req, err := client.getMetadataCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, options) if err != nil { @@ -359,19 +365,21 @@ func (client *SubvolumesClient) getMetadataCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListByVolumePager - Returns a list of the subvolumes in the volume -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - SubvolumesClientListByVolumeOptions contains the optional parameters for the SubvolumesClient.ListByVolume method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - SubvolumesClientListByVolumeOptions contains the optional parameters for the SubvolumesClient.NewListByVolumePager +// method. func (client *SubvolumesClient) NewListByVolumePager(resourceGroupName string, accountName string, poolName string, volumeName string, options *SubvolumesClientListByVolumeOptions) *runtime.Pager[SubvolumesClientListByVolumeResponse] { return runtime.NewPager(runtime.PagingHandler[SubvolumesClientListByVolumeResponse]{ More: func(page SubvolumesClientListByVolumeResponse) bool { @@ -428,7 +436,7 @@ func (client *SubvolumesClient) listByVolumeCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -445,14 +453,15 @@ func (client *SubvolumesClient) listByVolumeHandleResponse(resp *http.Response) // BeginUpdate - Patch a subvolume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// subvolumeName - The name of the subvolume. -// body - Subvolume object supplied in the body of the operation. -// options - SubvolumesClientBeginUpdateOptions contains the optional parameters for the SubvolumesClient.BeginUpdate method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - subvolumeName - The name of the subvolume. +// - body - Subvolume object supplied in the body of the operation. +// - options - SubvolumesClientBeginUpdateOptions contains the optional parameters for the SubvolumesClient.BeginUpdate method. func (client *SubvolumesClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, body SubvolumePatchRequest, options *SubvolumesClientBeginUpdateOptions) (*runtime.Poller[SubvolumesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, options) @@ -469,7 +478,8 @@ func (client *SubvolumesClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Patch a subvolume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *SubvolumesClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, body SubvolumePatchRequest, options *SubvolumesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, options) if err != nil { @@ -517,7 +527,7 @@ func (client *SubvolumesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go index 629a6c2fd149..c570ee9e4ce7 100644 --- a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Subvolumes_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Subvolumes_List.json func ExampleSubvolumesClient_NewListByVolumePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,18 +31,30 @@ func ExampleSubvolumesClient_NewListByVolumePager() { } pager := client.NewListByVolumePager("myRG", "account1", "pool1", "volume1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.SubvolumesList = armnetapp.SubvolumesList{ + // Value: []*armnetapp.SubvolumeInfo{ + // { + // Name: to.Ptr("account1/pool1/volume1/subvolume1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1"), + // Properties: &armnetapp.SubvolumeProperties{ + // Path: to.Ptr("/pathToSubvol"), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Subvolumes_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Subvolumes_Get.json func ExampleSubvolumesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,11 +69,20 @@ func ExampleSubvolumesClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.SubvolumeInfo = armnetapp.SubvolumeInfo{ + // Name: to.Ptr("account1/pool1/volume1/subvolume1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1"), + // Properties: &armnetapp.SubvolumeProperties{ + // Path: to.Ptr("/pathToSubvol"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Subvolumes_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Subvolumes_Create.json func ExampleSubvolumesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,11 +105,21 @@ func ExampleSubvolumesClient_BeginCreate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.SubvolumeInfo = armnetapp.SubvolumeInfo{ + // Name: to.Ptr("account1/pool1/volume1/subvolume1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1"), + // Properties: &armnetapp.SubvolumeProperties{ + // Path: to.Ptr("/subvolumePath"), + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Subvolumes_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Subvolumes_Update.json func ExampleSubvolumesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -110,11 +142,20 @@ func ExampleSubvolumesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.SubvolumeInfo = armnetapp.SubvolumeInfo{ + // Name: to.Ptr("account1/pool1/volume1/subvolume1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolume1"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1"), + // Properties: &armnetapp.SubvolumeProperties{ + // Path: to.Ptr("/subvolumePath"), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Subvolumes_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Subvolumes_Delete.json func ExampleSubvolumesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -135,7 +176,7 @@ func ExampleSubvolumesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Subvolumes_Metadata.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Subvolumes_Metadata.json func ExampleSubvolumesClient_BeginGetMetadata() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -154,6 +195,22 @@ func ExampleSubvolumesClient_BeginGetMetadata() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.SubvolumeModel = armnetapp.SubvolumeModel{ + // Name: to.Ptr("account1/pool1/volume1/subvolume1/metadata"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/metadata"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1/metadata"), + // Properties: &armnetapp.SubvolumeModelProperties{ + // Path: to.Ptr("/pathToSubvol"), + // AccessedTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // BytesUsed: to.Ptr[int64](5), + // ChangedTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // CreationTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // ModifiedTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), + // Permissions: to.Ptr("777"), + // Size: to.Ptr[int64](5), + // }, + // } } diff --git a/sdk/resourcemanager/netapp/armnetapp/time_rfc3339.go b/sdk/resourcemanager/netapp/armnetapp/time_rfc3339.go index 033b682d917d..232d6772fe39 100644 --- a/sdk/resourcemanager/netapp/armnetapp/time_rfc3339.go +++ b/sdk/resourcemanager/netapp/armnetapp/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/netapp/armnetapp/vaults_client.go b/sdk/resourcemanager/netapp/armnetapp/vaults_client.go deleted file mode 100644 index 99128354a66c..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/vaults_client.go +++ /dev/null @@ -1,119 +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 armnetapp - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// VaultsClient contains the methods for the Vaults group. -// Don't use this type directly, use NewVaultsClient() instead. -type VaultsClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewVaultsClient creates a new instance of VaultsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewVaultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VaultsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &VaultsClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - List vaults for a Netapp Account -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// options - VaultsClientListOptions contains the optional parameters for the VaultsClient.List method. -func (client *VaultsClient) NewListPager(resourceGroupName string, accountName string, options *VaultsClientListOptions) *runtime.Pager[VaultsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[VaultsClientListResponse]{ - More: func(page VaultsClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *VaultsClientListResponse) (VaultsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options) - if err != nil { - return VaultsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return VaultsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VaultsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *VaultsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *VaultsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/vaults" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *VaultsClient) listHandleResponse(resp *http.Response) (VaultsClientListResponse, error) { - result := VaultsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VaultList); err != nil { - return VaultsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/vaults_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/vaults_client_example_test.go deleted file mode 100644 index 9ef6f8fdde9d..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/vaults_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Vaults_List.json -func ExampleVaultsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVaultsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myRG", "account1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go index ea2512698938..2ec05fb5932a 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go @@ -32,10 +32,9 @@ type VolumeGroupsClient struct { } // NewVolumeGroupsClient creates a new instance of VolumeGroupsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVolumeGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VolumeGroupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +57,14 @@ func NewVolumeGroupsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Create a volume group along with specified volumes // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// volumeGroupName - The name of the volumeGroup -// body - Volume Group object supplied in the body of the operation. -// options - VolumeGroupsClientBeginCreateOptions contains the optional parameters for the VolumeGroupsClient.BeginCreate -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - volumeGroupName - The name of the volumeGroup +// - body - Volume Group object supplied in the body of the operation. +// - options - VolumeGroupsClientBeginCreateOptions contains the optional parameters for the VolumeGroupsClient.BeginCreate +// method. func (client *VolumeGroupsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, body VolumeGroupDetails, options *VolumeGroupsClientBeginCreateOptions) (*runtime.Poller[VolumeGroupsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, volumeGroupName, body, options) @@ -79,7 +79,8 @@ func (client *VolumeGroupsClient) BeginCreate(ctx context.Context, resourceGroup // Create - Create a volume group along with specified volumes // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumeGroupsClient) create(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, body VolumeGroupDetails, options *VolumeGroupsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, volumeGroupName, body, options) if err != nil { @@ -119,7 +120,7 @@ func (client *VolumeGroupsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -127,12 +128,13 @@ func (client *VolumeGroupsClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Delete the specified volume group only if there are no volumes under volume group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// volumeGroupName - The name of the volumeGroup -// options - VolumeGroupsClientBeginDeleteOptions contains the optional parameters for the VolumeGroupsClient.BeginDelete -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - volumeGroupName - The name of the volumeGroup +// - options - VolumeGroupsClientBeginDeleteOptions contains the optional parameters for the VolumeGroupsClient.BeginDelete +// method. func (client *VolumeGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, options *VolumeGroupsClientBeginDeleteOptions) (*runtime.Poller[VolumeGroupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, volumeGroupName, options) @@ -147,7 +149,8 @@ func (client *VolumeGroupsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete the specified volume group only if there are no volumes under volume group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumeGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, options *VolumeGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, volumeGroupName, options) if err != nil { @@ -187,18 +190,19 @@ func (client *VolumeGroupsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get details of the specified volume group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// volumeGroupName - The name of the volumeGroup -// options - VolumeGroupsClientGetOptions contains the optional parameters for the VolumeGroupsClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - volumeGroupName - The name of the volumeGroup +// - options - VolumeGroupsClientGetOptions contains the optional parameters for the VolumeGroupsClient.Get method. func (client *VolumeGroupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, options *VolumeGroupsClientGetOptions) (VolumeGroupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, volumeGroupName, options) if err != nil { @@ -238,7 +242,7 @@ func (client *VolumeGroupsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,11 +258,12 @@ func (client *VolumeGroupsClient) getHandleResponse(resp *http.Response) (Volume } // NewListByNetAppAccountPager - List all volume groups for given account -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// options - VolumeGroupsClientListByNetAppAccountOptions contains the optional parameters for the VolumeGroupsClient.ListByNetAppAccount -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - options - VolumeGroupsClientListByNetAppAccountOptions contains the optional parameters for the VolumeGroupsClient.NewListByNetAppAccountPager +// method. func (client *VolumeGroupsClient) NewListByNetAppAccountPager(resourceGroupName string, accountName string, options *VolumeGroupsClientListByNetAppAccountOptions) *runtime.Pager[VolumeGroupsClientListByNetAppAccountResponse] { return runtime.NewPager(runtime.PagingHandler[VolumeGroupsClientListByNetAppAccountResponse]{ More: func(page VolumeGroupsClientListByNetAppAccountResponse) bool { @@ -301,7 +306,7 @@ func (client *VolumeGroupsClient) listByNetAppAccountCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go index 7b8cceacaa36..c6277c05f021 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeGroups_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeGroups_List.json func ExampleVolumeGroupsClient_NewListByNetAppAccountPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,18 +31,37 @@ func ExampleVolumeGroupsClient_NewListByNetAppAccountPager() { } pager := client.NewListByNetAppAccountPager("myRG", "account1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.VolumeGroupList = armnetapp.VolumeGroupList{ + // Value: []*armnetapp.VolumeGroup{ + // { + // Name: to.Ptr("group1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups"), + // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/volumeGroups/group1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.VolumeGroupListProperties{ + // GroupMetaData: &armnetapp.VolumeGroupMetaData{ + // ApplicationIdentifier: to.Ptr("DEV"), + // ApplicationType: to.Ptr(armnetapp.ApplicationTypeSAPHANA), + // GroupDescription: to.Ptr("Volume group"), + // VolumesCount: to.Ptr[int64](5), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeGroups_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeGroups_Get.json func ExampleVolumeGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,11 +76,103 @@ func ExampleVolumeGroupsClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.VolumeGroupDetails = armnetapp.VolumeGroupDetails{ + // Name: to.Ptr("group1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups"), + // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/volumeGroups/group1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.VolumeGroupProperties{ + // GroupMetaData: &armnetapp.VolumeGroupMetaData{ + // ApplicationIdentifier: to.Ptr("DEV"), + // ApplicationType: to.Ptr(armnetapp.ApplicationTypeSAPHANA), + // GroupDescription: to.Ptr("Volume group"), + // VolumesCount: to.Ptr[int64](5), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // Volumes: []*armnetapp.VolumeGroupVolumeProperties{ + // { + // Name: to.Ptr("account1/pool1/test-data-mnt00001"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-data-mnt00001"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("test-data-mnt00001"), + // ProvisioningState: to.Ptr("Succeeded"), + // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](10), + // UsageThreshold: to.Ptr[int64](107374182400), + // VolumeSpecName: to.Ptr("data"), + // }, + // }, + // { + // Name: to.Ptr("account1/pool1/test-log-mnt00001"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-log-mnt00001"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("test-log-mnt00001"), + // ProvisioningState: to.Ptr("Succeeded"), + // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](10), + // UsageThreshold: to.Ptr[int64](107374182400), + // VolumeSpecName: to.Ptr("log"), + // }, + // }, + // { + // Name: to.Ptr("account1/pool1/test-shared"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-shared"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("test-shared"), + // ProvisioningState: to.Ptr("Succeeded"), + // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](10), + // UsageThreshold: to.Ptr[int64](107374182400), + // VolumeSpecName: to.Ptr("shared"), + // }, + // }, + // { + // Name: to.Ptr("account1/pool1/test-data-backup"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-data-backup"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("test-log-backup"), + // ProvisioningState: to.Ptr("Succeeded"), + // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](10), + // UsageThreshold: to.Ptr[int64](107374182400), + // VolumeSpecName: to.Ptr("data-backup"), + // }, + // }, + // { + // Name: to.Ptr("account1/pool1/test-log-backup"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-log-backup"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("test-data-backup"), + // ProvisioningState: to.Ptr("Succeeded"), + // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](10), + // UsageThreshold: to.Ptr[int64](107374182400), + // VolumeSpecName: to.Ptr("log-backup"), + // }, + // }}, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeGroups_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeGroups_Create.json func ExampleVolumeGroupsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -77,15 +189,15 @@ func ExampleVolumeGroupsClient_BeginCreate() { GroupMetaData: &armnetapp.VolumeGroupMetaData{ ApplicationIdentifier: to.Ptr("DEV"), ApplicationType: to.Ptr(armnetapp.ApplicationTypeSAPHANA), - DeploymentSpecID: to.Ptr("fb04dbeb-005d-2703-197e-6208dfadb5d9"), + DeploymentSpecID: to.Ptr("20542149-bfca-5618-1879-9863dc6767f1"), GroupDescription: to.Ptr("Volume group"), }, Volumes: []*armnetapp.VolumeGroupVolumeProperties{ { - Name: to.Ptr("testVol1"), + Name: to.Ptr("test-data-mnt00001"), Properties: &armnetapp.VolumeProperties{ CapacityPoolResourceID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - CreationToken: to.Ptr("testVol1"), + CreationToken: to.Ptr("test-data-mnt00001"), ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), @@ -95,10 +207,10 @@ func ExampleVolumeGroupsClient_BeginCreate() { }, }, { - Name: to.Ptr("testVol2"), + Name: to.Ptr("test-log-mnt00001"), Properties: &armnetapp.VolumeProperties{ CapacityPoolResourceID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - CreationToken: to.Ptr("testVol2"), + CreationToken: to.Ptr("test-log-mnt00001"), ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), @@ -108,10 +220,10 @@ func ExampleVolumeGroupsClient_BeginCreate() { }, }, { - Name: to.Ptr("testVol3"), + Name: to.Ptr("test-shared"), Properties: &armnetapp.VolumeProperties{ CapacityPoolResourceID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - CreationToken: to.Ptr("testVol3"), + CreationToken: to.Ptr("test-shared"), ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), @@ -131,7 +243,7 @@ func ExampleVolumeGroupsClient_BeginCreate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeGroups_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeGroups_Delete.json func ExampleVolumeGroupsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go index 2f4e51d26ae4..4cdeab662d11 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go @@ -32,10 +32,9 @@ type VolumeQuotaRulesClient struct { } // NewVolumeQuotaRulesClient creates a new instance of VolumeQuotaRulesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVolumeQuotaRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VolumeQuotaRulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,15 +57,16 @@ func NewVolumeQuotaRulesClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Create the specified quota rule within the given volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// volumeQuotaRuleName - The name of volume quota rule -// body - Quota rule object supplied in the body of the operation. -// options - VolumeQuotaRulesClientBeginCreateOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginCreate -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - volumeQuotaRuleName - The name of volume quota rule +// - body - Quota rule object supplied in the body of the operation. +// - options - VolumeQuotaRulesClientBeginCreateOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginCreate +// method. func (client *VolumeQuotaRulesClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, body VolumeQuotaRule, options *VolumeQuotaRulesClientBeginCreateOptions) (*runtime.Poller[VolumeQuotaRulesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, options) @@ -83,7 +83,8 @@ func (client *VolumeQuotaRulesClient) BeginCreate(ctx context.Context, resourceG // Create - Create the specified quota rule within the given volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumeQuotaRulesClient) create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, body VolumeQuotaRule, options *VolumeQuotaRulesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, options) if err != nil { @@ -131,7 +132,7 @@ func (client *VolumeQuotaRulesClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -139,14 +140,15 @@ func (client *VolumeQuotaRulesClient) createCreateRequest(ctx context.Context, r // BeginDelete - Delete quota rule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// volumeQuotaRuleName - The name of volume quota rule -// options - VolumeQuotaRulesClientBeginDeleteOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginDelete -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - volumeQuotaRuleName - The name of volume quota rule +// - options - VolumeQuotaRulesClientBeginDeleteOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginDelete +// method. func (client *VolumeQuotaRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, options *VolumeQuotaRulesClientBeginDeleteOptions) (*runtime.Poller[VolumeQuotaRulesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, options) @@ -163,7 +165,8 @@ func (client *VolumeQuotaRulesClient) BeginDelete(ctx context.Context, resourceG // Delete - Delete quota rule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumeQuotaRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, options *VolumeQuotaRulesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, options) if err != nil { @@ -173,7 +176,7 @@ func (client *VolumeQuotaRulesClient) deleteOperation(ctx context.Context, resou if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -211,20 +214,21 @@ func (client *VolumeQuotaRulesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get details of the specified quota rule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// volumeQuotaRuleName - The name of volume quota rule -// options - VolumeQuotaRulesClientGetOptions contains the optional parameters for the VolumeQuotaRulesClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - volumeQuotaRuleName - The name of volume quota rule +// - options - VolumeQuotaRulesClientGetOptions contains the optional parameters for the VolumeQuotaRulesClient.Get method. func (client *VolumeQuotaRulesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, options *VolumeQuotaRulesClientGetOptions) (VolumeQuotaRulesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, options) if err != nil { @@ -272,7 +276,7 @@ func (client *VolumeQuotaRulesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,13 +292,14 @@ func (client *VolumeQuotaRulesClient) getHandleResponse(resp *http.Response) (Vo } // NewListByVolumePager - List all quota rules associated with the volume -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumeQuotaRulesClientListByVolumeOptions contains the optional parameters for the VolumeQuotaRulesClient.ListByVolume -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumeQuotaRulesClientListByVolumeOptions contains the optional parameters for the VolumeQuotaRulesClient.NewListByVolumePager +// method. func (client *VolumeQuotaRulesClient) NewListByVolumePager(resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumeQuotaRulesClientListByVolumeOptions) *runtime.Pager[VolumeQuotaRulesClientListByVolumeResponse] { return runtime.NewPager(runtime.PagingHandler[VolumeQuotaRulesClientListByVolumeResponse]{ More: func(page VolumeQuotaRulesClientListByVolumeResponse) bool { @@ -345,7 +350,7 @@ func (client *VolumeQuotaRulesClient) listByVolumeCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -362,15 +367,16 @@ func (client *VolumeQuotaRulesClient) listByVolumeHandleResponse(resp *http.Resp // BeginUpdate - Patch a quota rule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// volumeQuotaRuleName - The name of volume quota rule -// body - Quota rule object supplied in the body of the operation. -// options - VolumeQuotaRulesClientBeginUpdateOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginUpdate -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - volumeQuotaRuleName - The name of volume quota rule +// - body - Quota rule object supplied in the body of the operation. +// - options - VolumeQuotaRulesClientBeginUpdateOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginUpdate +// method. func (client *VolumeQuotaRulesClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, body VolumeQuotaRulePatch, options *VolumeQuotaRulesClientBeginUpdateOptions) (*runtime.Poller[VolumeQuotaRulesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, options) @@ -387,7 +393,8 @@ func (client *VolumeQuotaRulesClient) BeginUpdate(ctx context.Context, resourceG // Update - Patch a quota rule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumeQuotaRulesClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, body VolumeQuotaRulePatch, options *VolumeQuotaRulesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, options) if err != nil { @@ -435,7 +442,7 @@ func (client *VolumeQuotaRulesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go index 9927b5d40278..1e03af7958f4 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeQuotaRules_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeQuotaRules_List.json func ExampleVolumeQuotaRulesClient_NewListByVolumePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,18 +31,34 @@ func ExampleVolumeQuotaRulesClient_NewListByVolumePager() { } pager := client.NewListByVolumePager("myRG", "account-9957", "pool-5210", "volume-6387", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.VolumeQuotaRulesList = armnetapp.VolumeQuotaRulesList{ + // Value: []*armnetapp.VolumeQuotaRule{ + // { + // Name: to.Ptr("account-9957/pool-5210/volume-6387/rule-0004"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/volumeQuotaRules"), + // ID: to.Ptr("/subscriptions/5275316f-a498-48d6-b324-2cbfdc4311b9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-9957/capacityPools/pool-5210/volumes/volume-6387/volumeQuotaRules/rule-0004"), + // Location: to.Ptr("westus"), + // Properties: &armnetapp.VolumeQuotaRulesProperties{ + // ProvisioningState: to.Ptr(armnetapp.ProvisioningStateSucceeded), + // QuotaSizeInKiBs: to.Ptr[int64](100005), + // QuotaTarget: to.Ptr("1821"), + // QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeQuotaRules_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeQuotaRules_Get.json func ExampleVolumeQuotaRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,11 +73,24 @@ func ExampleVolumeQuotaRulesClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.VolumeQuotaRule = armnetapp.VolumeQuotaRule{ + // Name: to.Ptr("account-9957/pool-5210/volume-6387/rule-0004"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/volumeQuotaRules"), + // ID: to.Ptr("/subscriptions/5275316f-a498-48d6-b324-2cbfdc4311b9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-9957/capacityPools/pool-5210/volumes/volume-6387/volumeQuotaRules/rule-0004"), + // Location: to.Ptr("westus"), + // Properties: &armnetapp.VolumeQuotaRulesProperties{ + // ProvisioningState: to.Ptr(armnetapp.ProvisioningStateSucceeded), + // QuotaSizeInKiBs: to.Ptr[int64](100005), + // QuotaTarget: to.Ptr("1821"), + // QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeQuotaRules_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeQuotaRules_Create.json func ExampleVolumeQuotaRulesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,11 +116,24 @@ func ExampleVolumeQuotaRulesClient_BeginCreate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.VolumeQuotaRule = armnetapp.VolumeQuotaRule{ + // Name: to.Ptr("account-9957/pool-5210/volume-6387/rule-0004"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/volumeQuotaRules"), + // ID: to.Ptr("/subscriptions/5275316f-a498-48d6-b324-2cbfdc4311b9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-9957/capacityPools/pool-5210/volumes/volume-6387/volumeQuotaRules/rule-0004"), + // Location: to.Ptr("westus"), + // Properties: &armnetapp.VolumeQuotaRulesProperties{ + // ProvisioningState: to.Ptr(armnetapp.ProvisioningStateSucceeded), + // QuotaSizeInKiBs: to.Ptr[int64](100005), + // QuotaTarget: to.Ptr("1821"), + // QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeQuotaRules_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeQuotaRules_Update.json func ExampleVolumeQuotaRulesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -113,11 +156,24 @@ func ExampleVolumeQuotaRulesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.VolumeQuotaRule = armnetapp.VolumeQuotaRule{ + // Name: to.Ptr("account-9957/pool-5210/volume-6387/rule-0004"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/volumeQuotaRules"), + // ID: to.Ptr("/subscriptions/5275316f-a498-48d6-b324-2cbfdc4311b9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-9957/capacityPools/pool-5210/volumes/volume-6387/volumeQuotaRules/rule-0004"), + // Location: to.Ptr("westus"), + // Properties: &armnetapp.VolumeQuotaRulesProperties{ + // ProvisioningState: to.Ptr(armnetapp.ProvisioningStateSucceeded), + // QuotaSizeInKiBs: to.Ptr[int64](100005), + // QuotaTarget: to.Ptr("1821"), + // QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeQuotaRules_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeQuotaRules_Delete.json func ExampleVolumeQuotaRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/netapp/armnetapp/volumes_client.go b/sdk/resourcemanager/netapp/armnetapp/volumes_client.go index 3424e1660335..80d9389b5fbc 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumes_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumes_client.go @@ -33,10 +33,9 @@ type VolumesClient struct { } // NewVolumesClient creates a new instance of VolumesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVolumesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VolumesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -59,14 +58,15 @@ func NewVolumesClient(subscriptionID string, credential azcore.TokenCredential, // BeginAuthorizeReplication - Authorize the replication connection on the source volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// body - Authorize request object supplied in the body of the operation. -// options - VolumesClientBeginAuthorizeReplicationOptions contains the optional parameters for the VolumesClient.BeginAuthorizeReplication -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - body - Authorize request object supplied in the body of the operation. +// - options - VolumesClientBeginAuthorizeReplicationOptions contains the optional parameters for the VolumesClient.BeginAuthorizeReplication +// method. func (client *VolumesClient) BeginAuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest, options *VolumesClientBeginAuthorizeReplicationOptions) (*runtime.Poller[VolumesClientAuthorizeReplicationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.authorizeReplication(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) @@ -83,7 +83,8 @@ func (client *VolumesClient) BeginAuthorizeReplication(ctx context.Context, reso // AuthorizeReplication - Authorize the replication connection on the source volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) authorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest, options *VolumesClientBeginAuthorizeReplicationOptions) (*http.Response, error) { req, err := client.authorizeReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { @@ -127,20 +128,100 @@ func (client *VolumesClient) authorizeReplicationCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, body) } +// BeginBreakFileLocks - Break all the file locks on a volume +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginBreakFileLocksOptions contains the optional parameters for the VolumesClient.BeginBreakFileLocks +// method. +func (client *VolumesClient) BeginBreakFileLocks(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginBreakFileLocksOptions) (*runtime.Poller[VolumesClientBreakFileLocksResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.breakFileLocks(ctx, resourceGroupName, accountName, poolName, volumeName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientBreakFileLocksResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[VolumesClientBreakFileLocksResponse](options.ResumeToken, client.pl, nil) + } +} + +// BreakFileLocks - Break all the file locks on a volume +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01 +func (client *VolumesClient) breakFileLocks(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginBreakFileLocksOptions) (*http.Response, error) { + req, err := client.breakFileLocksCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// breakFileLocksCreateRequest creates the BreakFileLocks request. +func (client *VolumesClient) breakFileLocksCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginBreakFileLocksOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakFileLocks" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if volumeName == "" { + return nil, errors.New("parameter volumeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil +} + // BeginBreakReplication - Break the replication connection on the destination volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientBeginBreakReplicationOptions contains the optional parameters for the VolumesClient.BeginBreakReplication -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginBreakReplicationOptions contains the optional parameters for the VolumesClient.BeginBreakReplication +// method. func (client *VolumesClient) BeginBreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginBreakReplicationOptions) (*runtime.Poller[VolumesClientBreakReplicationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.breakReplication(ctx, resourceGroupName, accountName, poolName, volumeName, options) @@ -157,7 +238,8 @@ func (client *VolumesClient) BeginBreakReplication(ctx context.Context, resource // BreakReplication - Break the replication connection on the destination volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) breakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginBreakReplicationOptions) (*http.Response, error) { req, err := client.breakReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -201,7 +283,7 @@ func (client *VolumesClient) breakReplicationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.Body != nil { return req, runtime.MarshalAsJSON(req, *options.Body) @@ -211,14 +293,15 @@ func (client *VolumesClient) breakReplicationCreateRequest(ctx context.Context, // BeginCreateOrUpdate - Create or update the specified volume within the capacity pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// body - Volume object supplied in the body of the operation. -// options - VolumesClientBeginCreateOrUpdateOptions contains the optional parameters for the VolumesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - body - Volume object supplied in the body of the operation. +// - options - VolumesClientBeginCreateOrUpdateOptions contains the optional parameters for the VolumesClient.BeginCreateOrUpdate +// method. func (client *VolumesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body Volume, options *VolumesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VolumesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) @@ -235,7 +318,8 @@ func (client *VolumesClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Create or update the specified volume within the capacity pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body Volume, options *VolumesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { @@ -279,7 +363,7 @@ func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -287,12 +371,13 @@ func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Delete the specified volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientBeginDeleteOptions contains the optional parameters for the VolumesClient.BeginDelete method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginDeleteOptions contains the optional parameters for the VolumesClient.BeginDelete method. func (client *VolumesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginDeleteOptions) (*runtime.Poller[VolumesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, poolName, volumeName, options) @@ -309,7 +394,8 @@ func (client *VolumesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete the specified volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -356,20 +442,21 @@ func (client *VolumesClient) deleteCreateRequest(ctx context.Context, resourceGr if options != nil && options.ForceDelete != nil { reqQP.Set("forceDelete", strconv.FormatBool(*options.ForceDelete)) } - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteReplication - Delete the replication connection on the destination volume, and send release to the source replication // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientBeginDeleteReplicationOptions contains the optional parameters for the VolumesClient.BeginDeleteReplication -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginDeleteReplicationOptions contains the optional parameters for the VolumesClient.BeginDeleteReplication +// method. func (client *VolumesClient) BeginDeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginDeleteReplicationOptions) (*runtime.Poller[VolumesClientDeleteReplicationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteReplication(ctx, resourceGroupName, accountName, poolName, volumeName, options) @@ -386,7 +473,8 @@ func (client *VolumesClient) BeginDeleteReplication(ctx context.Context, resourc // DeleteReplication - Delete the replication connection on the destination volume, and send release to the source replication // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) deleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginDeleteReplicationOptions) (*http.Response, error) { req, err := client.deleteReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -430,20 +518,21 @@ func (client *VolumesClient) deleteReplicationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginFinalizeRelocation - Finalizes the relocation of the volume and cleans up the old volume. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientBeginFinalizeRelocationOptions contains the optional parameters for the VolumesClient.BeginFinalizeRelocation -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginFinalizeRelocationOptions contains the optional parameters for the VolumesClient.BeginFinalizeRelocation +// method. func (client *VolumesClient) BeginFinalizeRelocation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginFinalizeRelocationOptions) (*runtime.Poller[VolumesClientFinalizeRelocationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.finalizeRelocation(ctx, resourceGroupName, accountName, poolName, volumeName, options) @@ -458,7 +547,8 @@ func (client *VolumesClient) BeginFinalizeRelocation(ctx context.Context, resour // FinalizeRelocation - Finalizes the relocation of the volume and cleans up the old volume. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) finalizeRelocation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginFinalizeRelocationOptions) (*http.Response, error) { req, err := client.finalizeRelocationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -502,19 +592,20 @@ func (client *VolumesClient) finalizeRelocationCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get the details of the specified volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientGetOptions contains the optional parameters for the VolumesClient.Get method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientGetOptions contains the optional parameters for the VolumesClient.Get method. func (client *VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientGetOptions) (VolumesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -558,7 +649,7 @@ func (client *VolumesClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -574,11 +665,12 @@ func (client *VolumesClient) getHandleResponse(resp *http.Response) (VolumesClie } // NewListPager - List all volumes within the capacity pool -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// options - VolumesClientListOptions contains the optional parameters for the VolumesClient.List method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - options - VolumesClientListOptions contains the optional parameters for the VolumesClient.NewListPager method. func (client *VolumesClient) NewListPager(resourceGroupName string, accountName string, poolName string, options *VolumesClientListOptions) *runtime.Pager[VolumesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VolumesClientListResponse]{ More: func(page VolumesClientListResponse) bool { @@ -631,7 +723,7 @@ func (client *VolumesClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -647,13 +739,14 @@ func (client *VolumesClient) listHandleResponse(resp *http.Response) (VolumesCli } // NewListReplicationsPager - List all replications for a specified volume -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientListReplicationsOptions contains the optional parameters for the VolumesClient.ListReplications -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientListReplicationsOptions contains the optional parameters for the VolumesClient.NewListReplicationsPager +// method. func (client *VolumesClient) NewListReplicationsPager(resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientListReplicationsOptions) *runtime.Pager[VolumesClientListReplicationsResponse] { return runtime.NewPager(runtime.PagingHandler[VolumesClientListReplicationsResponse]{ More: func(page VolumesClientListReplicationsResponse) bool { @@ -704,7 +797,7 @@ func (client *VolumesClient) listReplicationsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -721,13 +814,14 @@ func (client *VolumesClient) listReplicationsHandleResponse(resp *http.Response) // BeginPoolChange - Moves volume to another pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// body - Move volume to the pool supplied in the body of the operation. -// options - VolumesClientBeginPoolChangeOptions contains the optional parameters for the VolumesClient.BeginPoolChange method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - body - Move volume to the pool supplied in the body of the operation. +// - options - VolumesClientBeginPoolChangeOptions contains the optional parameters for the VolumesClient.BeginPoolChange method. func (client *VolumesClient) BeginPoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest, options *VolumesClientBeginPoolChangeOptions) (*runtime.Poller[VolumesClientPoolChangeResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.poolChange(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) @@ -744,7 +838,8 @@ func (client *VolumesClient) BeginPoolChange(ctx context.Context, resourceGroupN // PoolChange - Moves volume to another pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) poolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest, options *VolumesClientBeginPoolChangeOptions) (*http.Response, error) { req, err := client.poolChangeCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { @@ -788,20 +883,21 @@ func (client *VolumesClient) poolChangeCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, body) } // BeginReInitializeReplication - Re-Initializes the replication connection on the destination volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientBeginReInitializeReplicationOptions contains the optional parameters for the VolumesClient.BeginReInitializeReplication -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginReInitializeReplicationOptions contains the optional parameters for the VolumesClient.BeginReInitializeReplication +// method. func (client *VolumesClient) BeginReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginReInitializeReplicationOptions) (*runtime.Poller[VolumesClientReInitializeReplicationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.reInitializeReplication(ctx, resourceGroupName, accountName, poolName, volumeName, options) @@ -818,7 +914,8 @@ func (client *VolumesClient) BeginReInitializeReplication(ctx context.Context, r // ReInitializeReplication - Re-Initializes the replication connection on the destination volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) reInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginReInitializeReplicationOptions) (*http.Response, error) { req, err := client.reInitializeReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -862,7 +959,7 @@ func (client *VolumesClient) reInitializeReplicationCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -870,14 +967,15 @@ func (client *VolumesClient) reInitializeReplicationCreateRequest(ctx context.Co // BeginReestablishReplication - Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc // or policy-based snapshots // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// body - body for the id of the source volume. -// options - VolumesClientBeginReestablishReplicationOptions contains the optional parameters for the VolumesClient.BeginReestablishReplication -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - body - body for the id of the source volume. +// - options - VolumesClientBeginReestablishReplicationOptions contains the optional parameters for the VolumesClient.BeginReestablishReplication +// method. func (client *VolumesClient) BeginReestablishReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body ReestablishReplicationRequest, options *VolumesClientBeginReestablishReplicationOptions) (*runtime.Poller[VolumesClientReestablishReplicationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.reestablishReplication(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) @@ -895,7 +993,8 @@ func (client *VolumesClient) BeginReestablishReplication(ctx context.Context, re // ReestablishReplication - Re-establish a previously deleted replication between 2 volumes that have a common ad-hoc or policy-based // snapshots // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) reestablishReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body ReestablishReplicationRequest, options *VolumesClientBeginReestablishReplicationOptions) (*http.Response, error) { req, err := client.reestablishReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { @@ -939,19 +1038,20 @@ func (client *VolumesClient) reestablishReplicationCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, body) } // BeginRelocate - Relocates volume to a new stamp // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientBeginRelocateOptions contains the optional parameters for the VolumesClient.BeginRelocate method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginRelocateOptions contains the optional parameters for the VolumesClient.BeginRelocate method. func (client *VolumesClient) BeginRelocate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginRelocateOptions) (*runtime.Poller[VolumesClientRelocateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.relocate(ctx, resourceGroupName, accountName, poolName, volumeName, options) @@ -966,7 +1066,8 @@ func (client *VolumesClient) BeginRelocate(ctx context.Context, resourceGroupNam // Relocate - Relocates volume to a new stamp // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) relocate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginRelocateOptions) (*http.Response, error) { req, err := client.relocateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -1010,7 +1111,7 @@ func (client *VolumesClient) relocateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.Body != nil { return req, runtime.MarshalAsJSON(req, *options.Body) @@ -1020,13 +1121,14 @@ func (client *VolumesClient) relocateCreateRequest(ctx context.Context, resource // ReplicationStatus - Get the status of the replication // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientReplicationStatusOptions contains the optional parameters for the VolumesClient.ReplicationStatus -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientReplicationStatusOptions contains the optional parameters for the VolumesClient.ReplicationStatus +// method. func (client *VolumesClient) ReplicationStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientReplicationStatusOptions) (VolumesClientReplicationStatusResponse, error) { req, err := client.replicationStatusCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -1070,7 +1172,7 @@ func (client *VolumesClient) replicationStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1087,13 +1189,14 @@ func (client *VolumesClient) replicationStatusHandleResponse(resp *http.Response // BeginResetCifsPassword - Reset cifs password from volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientBeginResetCifsPasswordOptions contains the optional parameters for the VolumesClient.BeginResetCifsPassword -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginResetCifsPasswordOptions contains the optional parameters for the VolumesClient.BeginResetCifsPassword +// method. func (client *VolumesClient) BeginResetCifsPassword(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginResetCifsPasswordOptions) (*runtime.Poller[VolumesClientResetCifsPasswordResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.resetCifsPassword(ctx, resourceGroupName, accountName, poolName, volumeName, options) @@ -1108,7 +1211,8 @@ func (client *VolumesClient) BeginResetCifsPassword(ctx context.Context, resourc // ResetCifsPassword - Reset cifs password from volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) resetCifsPassword(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginResetCifsPasswordOptions) (*http.Response, error) { req, err := client.resetCifsPasswordCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -1152,7 +1256,7 @@ func (client *VolumesClient) resetCifsPasswordCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1160,13 +1264,14 @@ func (client *VolumesClient) resetCifsPasswordCreateRequest(ctx context.Context, // BeginResyncReplication - Resync the connection on the destination volume. If the operation is ran on the source volume // it will reverse-resync the connection and sync from destination to source. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientBeginResyncReplicationOptions contains the optional parameters for the VolumesClient.BeginResyncReplication -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginResyncReplicationOptions contains the optional parameters for the VolumesClient.BeginResyncReplication +// method. func (client *VolumesClient) BeginResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginResyncReplicationOptions) (*runtime.Poller[VolumesClientResyncReplicationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.resyncReplication(ctx, resourceGroupName, accountName, poolName, volumeName, options) @@ -1184,7 +1289,8 @@ func (client *VolumesClient) BeginResyncReplication(ctx context.Context, resourc // ResyncReplication - Resync the connection on the destination volume. If the operation is ran on the source volume it will // reverse-resync the connection and sync from destination to source. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) resyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginResyncReplicationOptions) (*http.Response, error) { req, err := client.resyncReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -1228,20 +1334,21 @@ func (client *VolumesClient) resyncReplicationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginRevert - Revert a volume to the snapshot specified in the body // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// body - Object for snapshot to revert supplied in the body of the operation. -// options - VolumesClientBeginRevertOptions contains the optional parameters for the VolumesClient.BeginRevert method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - body - Object for snapshot to revert supplied in the body of the operation. +// - options - VolumesClientBeginRevertOptions contains the optional parameters for the VolumesClient.BeginRevert method. func (client *VolumesClient) BeginRevert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert, options *VolumesClientBeginRevertOptions) (*runtime.Poller[VolumesClientRevertResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.revert(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) @@ -1258,7 +1365,8 @@ func (client *VolumesClient) BeginRevert(ctx context.Context, resourceGroupName // Revert - Revert a volume to the snapshot specified in the body // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert, options *VolumesClientBeginRevertOptions) (*http.Response, error) { req, err := client.revertCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { @@ -1302,7 +1410,7 @@ func (client *VolumesClient) revertCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, body) } @@ -1310,13 +1418,14 @@ func (client *VolumesClient) revertCreateRequest(ctx context.Context, resourceGr // BeginRevertRelocation - Reverts the volume relocation process, cleans up the new volume and starts using the former-existing // volume. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// options - VolumesClientBeginRevertRelocationOptions contains the optional parameters for the VolumesClient.BeginRevertRelocation -// method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientBeginRevertRelocationOptions contains the optional parameters for the VolumesClient.BeginRevertRelocation +// method. func (client *VolumesClient) BeginRevertRelocation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginRevertRelocationOptions) (*runtime.Poller[VolumesClientRevertRelocationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.revertRelocation(ctx, resourceGroupName, accountName, poolName, volumeName, options) @@ -1332,7 +1441,8 @@ func (client *VolumesClient) BeginRevertRelocation(ctx context.Context, resource // RevertRelocation - Reverts the volume relocation process, cleans up the new volume and starts using the former-existing // volume. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) revertRelocation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginRevertRelocationOptions) (*http.Response, error) { req, err := client.revertRelocationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { @@ -1376,20 +1486,21 @@ func (client *VolumesClient) revertRelocationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginUpdate - Patch the specified volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceGroupName - The name of the resource group. -// accountName - The name of the NetApp account -// poolName - The name of the capacity pool -// volumeName - The name of the volume -// body - Volume object supplied in the body of the operation. -// options - VolumesClientBeginUpdateOptions contains the optional parameters for the VolumesClient.BeginUpdate method. +// +// Generated from API version 2022-09-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - body - Volume object supplied in the body of the operation. +// - options - VolumesClientBeginUpdateOptions contains the optional parameters for the VolumesClient.BeginUpdate method. func (client *VolumesClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumePatch, options *VolumesClientBeginUpdateOptions) (*runtime.Poller[VolumesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) @@ -1406,7 +1517,8 @@ func (client *VolumesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Patch the specified volume // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 +// +// Generated from API version 2022-09-01 func (client *VolumesClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumePatch, options *VolumesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { @@ -1450,7 +1562,7 @@ func (client *VolumesClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") + reqQP.Set("api-version", "2022-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go index bd928ef42d61..e459a64e495e 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go @@ -5,6 +5,7 @@ // 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 armnetapp_test @@ -14,10 +15,10 @@ import ( "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/netapp/armnetapp/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_List.json func ExampleVolumesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,18 +31,40 @@ func ExampleVolumesClient_NewListPager() { } pager := client.NewListPager("myRG", "account1", "pool1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.VolumeList = armnetapp.VolumeList{ + // Value: []*armnetapp.Volume{ + // { + // Name: to.Ptr("account1/pool1/volume1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("some-amazing-filepath"), + // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), + // NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard), + // NetworkSiblingSetID: to.Ptr("0f434a03-ce0b-4935-81af-d98652ffb1c4"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // StorageToNetworkProximity: to.Ptr(armnetapp.VolumeStorageToNetworkProximityT2), + // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](128), + // UsageThreshold: to.Ptr[int64](107374182400), + // }, + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_Get.json func ExampleVolumesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,11 +79,30 @@ func ExampleVolumesClient_Get() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.Volume = armnetapp.Volume{ + // Name: to.Ptr("account1/pool1/volume1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("some-amazing-filepath"), + // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), + // NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard), + // NetworkSiblingSetID: to.Ptr("0f434a03-ce0b-4935-81af-d98652ffb1c4"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // StorageToNetworkProximity: to.Ptr(armnetapp.VolumeStorageToNetworkProximityT2), + // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](128), + // UsageThreshold: to.Ptr[int64](107374182400), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_CreateOrUpdate.json func ExampleVolumesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -74,12 +116,10 @@ func ExampleVolumesClient_BeginCreateOrUpdate() { poller, err := client.BeginCreateOrUpdate(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.Volume{ Location: to.Ptr("eastus"), Properties: &armnetapp.VolumeProperties{ - CreationToken: to.Ptr("my-unique-file-path"), - EncryptionKeySource: to.Ptr(armnetapp.EncryptionKeySourceMicrosoftKeyVault), - ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - ThroughputMibps: to.Ptr[float32](128), - UsageThreshold: to.Ptr[int64](107374182400), + CreationToken: to.Ptr("my-unique-file-path"), + ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + UsageThreshold: to.Ptr[int64](107374182400), }, }, nil) if err != nil { @@ -89,11 +129,28 @@ func ExampleVolumesClient_BeginCreateOrUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.Volume = armnetapp.Volume{ + // Name: to.Ptr("account1/pool1/volume1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("some-amazing-filepath"), + // EncryptionKeySource: to.Ptr(armnetapp.EncryptionKeySourceMicrosoftNetApp), + // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](128), + // UsageThreshold: to.Ptr[int64](107374182400), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_Update.json func ExampleVolumesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -112,11 +169,35 @@ func ExampleVolumesClient_BeginUpdate() { if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item + // 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.Volume = armnetapp.Volume{ + // Name: to.Ptr("account1/pool1/volume1"), + // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), + // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), + // Location: to.Ptr("eastus"), + // Properties: &armnetapp.VolumeProperties{ + // CreationToken: to.Ptr("some-amazing-filepath"), + // DataProtection: &armnetapp.VolumePropertiesDataProtection{ + // Snapshot: &armnetapp.VolumeSnapshotProperties{ + // SnapshotPolicyID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRP/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), + // }, + // }, + // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), + // NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard), + // NetworkSiblingSetID: to.Ptr("0f434a03-ce0b-4935-81af-d98652ffb1c4"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), + // StorageToNetworkProximity: to.Ptr(armnetapp.VolumeStorageToNetworkProximityT2), + // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), + // ThroughputMibps: to.Ptr[float32](128), + // UsageThreshold: to.Ptr[int64](107374182400), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_Delete.json func ExampleVolumesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +218,7 @@ func ExampleVolumesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_Revert.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_Revert.json func ExampleVolumesClient_BeginRevert() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -160,7 +241,7 @@ func ExampleVolumesClient_BeginRevert() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ResetCifsPassword.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_ResetCifsPassword.json func ExampleVolumesClient_BeginResetCifsPassword() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -181,7 +262,32 @@ func ExampleVolumesClient_BeginResetCifsPassword() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_BreakReplication.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_BreakFileLocks.json +func ExampleVolumesClient_BeginBreakFileLocks() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginBreakFileLocks(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginBreakFileLocksOptions{Body: &armnetapp.BreakFileLocksRequest{ + ClientIP: to.Ptr("101.102.103.104"), + ConfirmRunningDisruptiveOperation: to.Ptr(true), + }, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_BreakReplication.json func ExampleVolumesClient_BeginBreakReplication() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -205,7 +311,7 @@ func ExampleVolumesClient_BeginBreakReplication() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ReestablishReplication.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_ReestablishReplication.json func ExampleVolumesClient_BeginReestablishReplication() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -228,7 +334,7 @@ func ExampleVolumesClient_BeginReestablishReplication() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ReplicationStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_ReplicationStatus.json func ExampleVolumesClient_ReplicationStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -243,11 +349,19 @@ func ExampleVolumesClient_ReplicationStatus() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // 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.ReplicationStatus = armnetapp.ReplicationStatus{ + // ErrorMessage: to.Ptr(""), + // Healthy: to.Ptr(true), + // MirrorState: to.Ptr(armnetapp.MirrorStateMirrored), + // RelationshipStatus: to.Ptr(armnetapp.RelationshipStatusIdle), + // TotalProgress: to.Ptr("1048576"), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ListReplications.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_ListReplications.json func ExampleVolumesClient_NewListReplicationsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -260,18 +374,27 @@ func ExampleVolumesClient_NewListReplicationsPager() { } pager := client.NewListReplicationsPager("myRG", "account1", "pool1", "volume1", nil) for pager.More() { - nextResult, err := pager.NextPage(ctx) + page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } - for _, v := range nextResult.Value { - // TODO: use page item + 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.ListReplications = armnetapp.ListReplications{ + // Value: []*armnetapp.Replication{ + // { + // RemoteVolumeRegion: to.Ptr("westus"), + // RemoteVolumeResourceID: to.Ptr("/subscriptions/36e85c76-e720-473e-881f-e2fe72f462d0/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-5999/capacityPools/pool-0977/volumes/volume-4508"), + // ReplicationSchedule: to.Ptr(armnetapp.ReplicationScheduleDaily), + // }}, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ResyncReplication.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_ResyncReplication.json func ExampleVolumesClient_BeginResyncReplication() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -292,7 +415,7 @@ func ExampleVolumesClient_BeginResyncReplication() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_DeleteReplication.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_DeleteReplication.json func ExampleVolumesClient_BeginDeleteReplication() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -313,7 +436,7 @@ func ExampleVolumesClient_BeginDeleteReplication() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_AuthorizeReplication.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_AuthorizeReplication.json func ExampleVolumesClient_BeginAuthorizeReplication() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -336,7 +459,7 @@ func ExampleVolumesClient_BeginAuthorizeReplication() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ReInitializeReplication.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_ReInitializeReplication.json func ExampleVolumesClient_BeginReInitializeReplication() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -357,7 +480,7 @@ func ExampleVolumesClient_BeginReInitializeReplication() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_PoolChange.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_PoolChange.json func ExampleVolumesClient_BeginPoolChange() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -380,7 +503,7 @@ func ExampleVolumesClient_BeginPoolChange() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_Relocate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_Relocate.json func ExampleVolumesClient_BeginRelocate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -401,7 +524,7 @@ func ExampleVolumesClient_BeginRelocate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_FinalizeRelocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_FinalizeRelocation.json func ExampleVolumesClient_BeginFinalizeRelocation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -422,7 +545,7 @@ func ExampleVolumesClient_BeginFinalizeRelocation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_RevertRelocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/Volumes_RevertRelocation.json func ExampleVolumesClient_BeginRevertRelocation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { From f269353023c39cdda122112b6bf41524e8b2dfd3 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Mon, 13 Mar 2023 10:39:38 +0800 Subject: [PATCH 2/7] Update CHANGELOG.md --- sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md index 96970c993ea1..b5d5014dcdaa 100644 --- a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md +++ b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md @@ -3,7 +3,6 @@ ## 4.0.0 (2023-03-24) ### Breaking Changes -- Function `*SnapshotsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, string, interface{}, *SnapshotsClientBeginUpdateOptions)` to `(context.Context, string, string, string, string, string, any, *SnapshotsClientBeginUpdateOptions)` - Type of `Account.Identity` has been changed from `*Identity` to `*ManagedServiceIdentity` - Type alias `IdentityType` has been removed - Function `NewVaultsClient` has been removed From f8bf619d6cc809662539e39b9d85827cccc81f4c Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Wed, 22 Mar 2023 10:56:40 +0800 Subject: [PATCH 3/7] client factory --- .../netapp/armnetapp/CHANGELOG.md | 5 +- .../netapp/armnetapp/README.md | 17 +- .../netapp/armnetapp/accountbackups_client.go | 33 ++-- .../accountbackups_client_example_test.go | 12 +- .../netapp/armnetapp/accounts_client.go | 61 +++---- .../armnetapp/accounts_client_example_test.go | 28 +-- .../netapp/armnetapp/backuppolicies_client.go | 49 +++--- .../backuppolicies_client_example_test.go | 20 +-- .../netapp/armnetapp/backups_client.go | 65 +++---- .../armnetapp/backups_client_example_test.go | 32 ++-- .../netapp/armnetapp/client_factory.go | 109 ++++++++++++ .../netapp/armnetapp/operations_client.go | 21 +-- .../operations_client_example_test.go | 4 +- .../netapp/armnetapp/pools_client.go | 49 +++--- .../armnetapp/pools_client_example_test.go | 20 +-- .../netapp/armnetapp/resource_client.go | 33 ++-- .../armnetapp/resource_client_example_test.go | 16 +- .../armnetapp/resourcequotalimits_client.go | 25 +-- ...resourcequotalimits_client_example_test.go | 8 +- .../armnetapp/snapshotpolicies_client.go | 49 +++--- .../snapshotpolicies_client_example_test.go | 24 +-- .../netapp/armnetapp/snapshots_client.go | 57 +++---- .../snapshots_client_example_test.go | 24 +-- .../netapp/armnetapp/subvolumes_client.go | 57 +++---- .../subvolumes_client_example_test.go | 24 +-- .../netapp/armnetapp/volumegroups_client.go | 41 ++--- .../volumegroups_client_example_test.go | 16 +- .../armnetapp/volumequotarules_client.go | 49 +++--- .../volumequotarules_client_example_test.go | 20 +-- .../netapp/armnetapp/volumes_client.go | 161 ++++++++---------- .../armnetapp/volumes_client_example_test.go | 80 ++++----- 31 files changed, 587 insertions(+), 622 deletions(-) create mode 100644 sdk/resourcemanager/netapp/armnetapp/client_factory.go diff --git a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md index b5d5014dcdaa..e8d8aefc1dc9 100644 --- a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md +++ b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md @@ -16,8 +16,9 @@ ### Features Added -- New type alias `FileAccessLogs` with values `FileAccessLogsDisabled`, `FileAccessLogsEnabled` -- New type alias `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` +- New struct `ClientFactory` which is a client factory used to create any client in this module +- New enum type `FileAccessLogs` with values `FileAccessLogsDisabled`, `FileAccessLogsEnabled` +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` - New function `*BackupsClient.BeginRestoreFiles(context.Context, string, string, string, string, string, BackupRestoreFiles, *BackupsClientBeginRestoreFilesOptions) (*runtime.Poller[BackupsClientRestoreFilesResponse], error)` - New function `*VolumesClient.BeginBreakFileLocks(context.Context, string, string, string, string, *VolumesClientBeginBreakFileLocksOptions) (*runtime.Poller[VolumesClientBreakFileLocksResponse], error)` - New struct `BackupRestoreFiles` diff --git a/sdk/resourcemanager/netapp/armnetapp/README.md b/sdk/resourcemanager/netapp/armnetapp/README.md index 1070c8ddbf3b..71ad33c198d3 100644 --- a/sdk/resourcemanager/netapp/armnetapp/README.md +++ b/sdk/resourcemanager/netapp/armnetapp/README.md @@ -33,12 +33,12 @@ cred, err := azidentity.NewDefaultAzureCredential(nil) For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). -## Clients +## Client Factory -Azure NetApp Files modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential. +Azure Compute modules consist of one or more clients. We provide a client factory which could be used to create any client in this module. ```go -client, err := armnetapp.NewBackupsClient(, cred, nil) +clientFactory, err := armnetapp.NewClientFactory(, cred, nil) ``` You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). @@ -49,9 +49,18 @@ options := arm.ClientOptions { Cloud: cloud.AzureChina, }, } -client, err := armnetapp.NewBackupsClient(, cred, &options) +client, err := armnetapp.NewClientFactory(, cred, &options) +``` + +## Clients + +A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. + +```go +client := clientFactory.NewBackupsClient() ``` + ## Major Version Upgrade Go uses [semantic import versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) to ensure a good backward compatibility for modules. For Azure Go management SDK, we usually upgrade module version according to cooresponding service's API version. Regarding it could be a complicated experience for major version upgrade, we will try our best to keep the SDK API stable and release new version in backward compatible way. However, if any unavoidable breaking changes and a new major version releases for SDK modules, you could use these commands under your module folder to upgrade: diff --git a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go index 6c87297f175c..323fcbf9e321 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // AccountBackupsClient contains the methods for the AccountBackups group. // Don't use this type directly, use NewAccountBackupsClient() instead. type AccountBackupsClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewAccountBackupsClient creates a new instance of AccountBackupsClient with the specified values. @@ -36,21 +33,13 @@ type AccountBackupsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAccountBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountBackupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".AccountBackupsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &AccountBackupsClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -70,11 +59,11 @@ func (client *AccountBackupsClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AccountBackupsClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountBackupsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[AccountBackupsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[AccountBackupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -87,7 +76,7 @@ func (client *AccountBackupsClient) deleteOperation(ctx context.Context, resourc if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -116,7 +105,7 @@ func (client *AccountBackupsClient) deleteCreateRequest(ctx context.Context, res return nil, errors.New("parameter backupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -139,7 +128,7 @@ func (client *AccountBackupsClient) Get(ctx context.Context, resourceGroupName s if err != nil { return AccountBackupsClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountBackupsClientGetResponse{}, err } @@ -168,7 +157,7 @@ func (client *AccountBackupsClient) getCreateRequest(ctx context.Context, resour return nil, errors.New("parameter backupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -204,7 +193,7 @@ func (client *AccountBackupsClient) NewListPager(resourceGroupName string, accou if err != nil { return AccountBackupsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountBackupsClientListResponse{}, err } @@ -231,7 +220,7 @@ func (client *AccountBackupsClient) listCreateRequest(ctx context.Context, resou return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go index 10779412e2ad..0c84122f0ef6 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go @@ -24,11 +24,11 @@ func ExampleAccountBackupsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myRG", "account1", nil) + pager := clientFactory.NewAccountBackupsClient().NewListPager("myRG", "account1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -65,11 +65,11 @@ func ExampleAccountBackupsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", "backup1", nil) + res, err := clientFactory.NewAccountBackupsClient().Get(ctx, "myRG", "account1", "backup1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -98,11 +98,11 @@ func ExampleAccountBackupsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "resourceGroup", "accountName", "backupName", nil) + poller, err := clientFactory.NewAccountBackupsClient().BeginDelete(ctx, "resourceGroup", "accountName", "backupName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/accounts_client.go b/sdk/resourcemanager/netapp/armnetapp/accounts_client.go index 60b1427bbcba..0d317484aaeb 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accounts_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/accounts_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // AccountsClient contains the methods for the Accounts group. // Don't use this type directly, use NewAccountsClient() instead. type AccountsClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewAccountsClient creates a new instance of AccountsClient with the specified values. @@ -36,21 +33,13 @@ type AccountsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".AccountsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &AccountsClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -70,11 +59,11 @@ func (client *AccountsClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AccountsClientCreateOrUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[AccountsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[AccountsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -87,7 +76,7 @@ func (client *AccountsClient) createOrUpdate(ctx context.Context, resourceGroupN if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -112,7 +101,7 @@ func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -136,11 +125,11 @@ func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AccountsClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[AccountsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[AccountsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -153,7 +142,7 @@ func (client *AccountsClient) deleteOperation(ctx context.Context, resourceGroup if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -178,7 +167,7 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -200,7 +189,7 @@ func (client *AccountsClient) Get(ctx context.Context, resourceGroupName string, if err != nil { return AccountsClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountsClientGetResponse{}, err } @@ -225,7 +214,7 @@ func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -266,7 +255,7 @@ func (client *AccountsClient) NewListPager(resourceGroupName string, options *Ac if err != nil { return AccountsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountsClientListResponse{}, err } @@ -289,7 +278,7 @@ func (client *AccountsClient) listCreateRequest(ctx context.Context, resourceGro return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -330,7 +319,7 @@ func (client *AccountsClient) NewListBySubscriptionPager(options *AccountsClient if err != nil { return AccountsClientListBySubscriptionResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountsClientListBySubscriptionResponse{}, err } @@ -349,7 +338,7 @@ func (client *AccountsClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -385,11 +374,11 @@ func (client *AccountsClient) BeginRenewCredentials(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AccountsClientRenewCredentialsResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientRenewCredentialsResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[AccountsClientRenewCredentialsResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[AccountsClientRenewCredentialsResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -404,7 +393,7 @@ func (client *AccountsClient) renewCredentials(ctx context.Context, resourceGrou if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -429,7 +418,7 @@ func (client *AccountsClient) renewCredentialsCreateRequest(ctx context.Context, return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -453,11 +442,11 @@ func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AccountsClientUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[AccountsClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[AccountsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -470,7 +459,7 @@ func (client *AccountsClient) update(ctx context.Context, resourceGroupName stri if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -495,7 +484,7 @@ func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go index 502ffce0488c..13cfd36e3bec 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go @@ -25,11 +25,11 @@ func ExampleAccountsClient_NewListBySubscriptionPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListBySubscriptionPager(nil) + pager := clientFactory.NewAccountsClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -62,11 +62,11 @@ func ExampleAccountsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", nil) + res, err := clientFactory.NewAccountsClient().Get(ctx, "myRG", "account1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -105,11 +105,11 @@ func ExampleAccountsClient_BeginCreateOrUpdate_accountsCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myRG", "account1", armnetapp.Account{ + poller, err := clientFactory.NewAccountsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", armnetapp.Account{ Location: to.Ptr("eastus"), Properties: &armnetapp.AccountProperties{}, }, nil) @@ -141,11 +141,11 @@ func ExampleAccountsClient_BeginCreateOrUpdate_accountsCreateOrUpdateWithActiveD log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myRG", "account1", armnetapp.Account{ + poller, err := clientFactory.NewAccountsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", armnetapp.Account{ Location: to.Ptr("eastus"), Properties: &armnetapp.AccountProperties{ ActiveDirectories: []*armnetapp.ActiveDirectory{ @@ -204,11 +204,11 @@ func ExampleAccountsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myRG", "account1", nil) + poller, err := clientFactory.NewAccountsClient().BeginDelete(ctx, "myRG", "account1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -225,11 +225,11 @@ func ExampleAccountsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", armnetapp.AccountPatch{ + poller, err := clientFactory.NewAccountsClient().BeginUpdate(ctx, "myRG", "account1", armnetapp.AccountPatch{ Tags: map[string]*string{ "Tag1": to.Ptr("Value1"), }, @@ -262,11 +262,11 @@ func ExampleAccountsClient_BeginRenewCredentials() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewAccountsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRenewCredentials(ctx, "myRG", "account1", nil) + poller, err := clientFactory.NewAccountsClient().BeginRenewCredentials(ctx, "myRG", "account1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go index aee42da4a0fe..17d2bcf7538d 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // BackupPoliciesClient contains the methods for the BackupPolicies group. // Don't use this type directly, use NewBackupPoliciesClient() instead. type BackupPoliciesClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewBackupPoliciesClient creates a new instance of BackupPoliciesClient with the specified values. @@ -36,21 +33,13 @@ type BackupPoliciesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewBackupPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupPoliciesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".BackupPoliciesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &BackupPoliciesClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -71,11 +60,11 @@ func (client *BackupPoliciesClient) BeginCreate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BackupPoliciesClientCreateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupPoliciesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[BackupPoliciesClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[BackupPoliciesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -88,7 +77,7 @@ func (client *BackupPoliciesClient) create(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -117,7 +106,7 @@ func (client *BackupPoliciesClient) createCreateRequest(ctx context.Context, res return nil, errors.New("parameter backupPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupPolicyName}", url.PathEscape(backupPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -143,11 +132,11 @@ func (client *BackupPoliciesClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BackupPoliciesClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupPoliciesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[BackupPoliciesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[BackupPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -160,7 +149,7 @@ func (client *BackupPoliciesClient) deleteOperation(ctx context.Context, resourc if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -189,7 +178,7 @@ func (client *BackupPoliciesClient) deleteCreateRequest(ctx context.Context, res return nil, errors.New("parameter backupPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupPolicyName}", url.PathEscape(backupPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -212,7 +201,7 @@ func (client *BackupPoliciesClient) Get(ctx context.Context, resourceGroupName s if err != nil { return BackupPoliciesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupPoliciesClientGetResponse{}, err } @@ -241,7 +230,7 @@ func (client *BackupPoliciesClient) getCreateRequest(ctx context.Context, resour return nil, errors.New("parameter backupPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupPolicyName}", url.PathEscape(backupPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -277,7 +266,7 @@ func (client *BackupPoliciesClient) NewListPager(resourceGroupName string, accou if err != nil { return BackupPoliciesClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupPoliciesClientListResponse{}, err } @@ -304,7 +293,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, resou return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -340,11 +329,11 @@ func (client *BackupPoliciesClient) BeginUpdate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BackupPoliciesClientUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupPoliciesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[BackupPoliciesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[BackupPoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -357,7 +346,7 @@ func (client *BackupPoliciesClient) update(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -386,7 +375,7 @@ func (client *BackupPoliciesClient) updateCreateRequest(ctx context.Context, res return nil, errors.New("parameter backupPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupPolicyName}", url.PathEscape(backupPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go index 72b5b74116a4..bc10752983ca 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go @@ -25,11 +25,11 @@ func ExampleBackupPoliciesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myRG", "account1", nil) + pager := clientFactory.NewBackupPoliciesClient().NewListPager("myRG", "account1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -66,11 +66,11 @@ func ExampleBackupPoliciesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", "backupPolicyName", nil) + res, err := clientFactory.NewBackupPoliciesClient().Get(ctx, "myRG", "account1", "backupPolicyName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -105,11 +105,11 @@ func ExampleBackupPoliciesClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicy{ + poller, err := clientFactory.NewBackupPoliciesClient().BeginCreate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicy{ Location: to.Ptr("westus"), Properties: &armnetapp.BackupPolicyProperties{ DailyBackupsToKeep: to.Ptr[int32](10), @@ -150,11 +150,11 @@ func ExampleBackupPoliciesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicyPatch{ + poller, err := clientFactory.NewBackupPoliciesClient().BeginUpdate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicyPatch{ Location: to.Ptr("westus"), Properties: &armnetapp.BackupPolicyProperties{ DailyBackupsToKeep: to.Ptr[int32](5), @@ -202,11 +202,11 @@ func ExampleBackupPoliciesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "resourceGroup", "accountName", "backupPolicyName", nil) + poller, err := clientFactory.NewBackupPoliciesClient().BeginDelete(ctx, "resourceGroup", "accountName", "backupPolicyName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/backups_client.go b/sdk/resourcemanager/netapp/armnetapp/backups_client.go index 886cef2bc065..5452bf0d7ca6 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/backups_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // BackupsClient contains the methods for the Backups group. // Don't use this type directly, use NewBackupsClient() instead. type BackupsClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewBackupsClient creates a new instance of BackupsClient with the specified values. @@ -36,21 +33,13 @@ type BackupsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".BackupsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &BackupsClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -72,11 +61,11 @@ func (client *BackupsClient) BeginCreate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BackupsClientCreateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[BackupsClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[BackupsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -89,7 +78,7 @@ func (client *BackupsClient) create(ctx context.Context, resourceGroupName strin if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -126,7 +115,7 @@ func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter backupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -153,11 +142,11 @@ func (client *BackupsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BackupsClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[BackupsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[BackupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -170,7 +159,7 @@ func (client *BackupsClient) deleteOperation(ctx context.Context, resourceGroupN if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -207,7 +196,7 @@ func (client *BackupsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter backupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -232,7 +221,7 @@ func (client *BackupsClient) Get(ctx context.Context, resourceGroupName string, if err != nil { return BackupsClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupsClientGetResponse{}, err } @@ -269,7 +258,7 @@ func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, errors.New("parameter backupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -303,7 +292,7 @@ func (client *BackupsClient) GetStatus(ctx context.Context, resourceGroupName st if err != nil { return BackupsClientGetStatusResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupsClientGetStatusResponse{}, err } @@ -336,7 +325,7 @@ func (client *BackupsClient) getStatusCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -371,7 +360,7 @@ func (client *BackupsClient) GetVolumeRestoreStatus(ctx context.Context, resourc if err != nil { return BackupsClientGetVolumeRestoreStatusResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupsClientGetVolumeRestoreStatusResponse{}, err } @@ -404,7 +393,7 @@ func (client *BackupsClient) getVolumeRestoreStatusCreateRequest(ctx context.Con return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -442,7 +431,7 @@ func (client *BackupsClient) NewListPager(resourceGroupName string, accountName if err != nil { return BackupsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupsClientListResponse{}, err } @@ -477,7 +466,7 @@ func (client *BackupsClient) listCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -515,11 +504,11 @@ func (client *BackupsClient) BeginRestoreFiles(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BackupsClientRestoreFilesResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientRestoreFilesResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[BackupsClientRestoreFilesResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[BackupsClientRestoreFilesResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -532,7 +521,7 @@ func (client *BackupsClient) restoreFiles(ctx context.Context, resourceGroupName if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -569,7 +558,7 @@ func (client *BackupsClient) restoreFilesCreateRequest(ctx context.Context, reso return nil, errors.New("parameter backupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -596,11 +585,11 @@ func (client *BackupsClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BackupsClientUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[BackupsClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[BackupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -613,7 +602,7 @@ func (client *BackupsClient) update(ctx context.Context, resourceGroupName strin if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -650,7 +639,7 @@ func (client *BackupsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter backupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go index 3449d3bfead9..aee0f8f8caca 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go @@ -25,11 +25,11 @@ func ExampleBackupsClient_GetStatus() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) + res, err := clientFactory.NewBackupsClient().GetStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -55,11 +55,11 @@ func ExampleBackupsClient_GetVolumeRestoreStatus() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetVolumeRestoreStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) + res, err := clientFactory.NewBackupsClient().GetVolumeRestoreStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -83,11 +83,11 @@ func ExampleBackupsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myRG", "account1", "pool1", "volume1", nil) + pager := clientFactory.NewBackupsClient().NewListPager("myRG", "account1", "pool1", "volume1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -124,11 +124,11 @@ func ExampleBackupsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", "pool1", "volume1", "backup1", nil) + res, err := clientFactory.NewBackupsClient().Get(ctx, "myRG", "account1", "pool1", "volume1", "backup1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -157,11 +157,11 @@ func ExampleBackupsClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.Backup{ + poller, err := clientFactory.NewBackupsClient().BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.Backup{ Location: to.Ptr("eastus"), Properties: &armnetapp.BackupProperties{ Label: to.Ptr("myLabel"), @@ -199,11 +199,11 @@ func ExampleBackupsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupPatch{}, nil) + poller, err := clientFactory.NewBackupsClient().BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupPatch{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -236,11 +236,11 @@ func ExampleBackupsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "resourceGroup", "accountName", "poolName", "volumeName", "backupName", nil) + poller, err := clientFactory.NewBackupsClient().BeginDelete(ctx, "resourceGroup", "accountName", "poolName", "volumeName", "backupName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -257,11 +257,11 @@ func ExampleBackupsClient_BeginRestoreFiles() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRestoreFiles(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupRestoreFiles{ + poller, err := clientFactory.NewBackupsClient().BeginRestoreFiles(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupRestoreFiles{ DestinationVolumeID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), FileList: []*string{ to.Ptr("/dir1/customer1.db"), diff --git a/sdk/resourcemanager/netapp/armnetapp/client_factory.go b/sdk/resourcemanager/netapp/armnetapp/client_factory.go new file mode 100644 index 000000000000..bbbdde7e9002 --- /dev/null +++ b/sdk/resourcemanager/netapp/armnetapp/client_factory.go @@ -0,0 +1,109 @@ +//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 armnetapp + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + subscriptionID string + credential azcore.TokenCredential + options *arm.ClientOptions +} + +// NewClientFactory creates a new instance of ClientFactory with the specified values. +// The parameter values will be propagated to any client created from this factory. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + subscriptionID: subscriptionID, credential: credential, + options: options.Clone(), + }, nil +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewResourceClient() *ResourceClient { + subClient, _ := NewResourceClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewResourceQuotaLimitsClient() *ResourceQuotaLimitsClient { + subClient, _ := NewResourceQuotaLimitsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAccountsClient() *AccountsClient { + subClient, _ := NewAccountsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPoolsClient() *PoolsClient { + subClient, _ := NewPoolsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVolumesClient() *VolumesClient { + subClient, _ := NewVolumesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { + subClient, _ := NewSnapshotsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSnapshotPoliciesClient() *SnapshotPoliciesClient { + subClient, _ := NewSnapshotPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewBackupsClient() *BackupsClient { + subClient, _ := NewBackupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAccountBackupsClient() *AccountBackupsClient { + subClient, _ := NewAccountBackupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewBackupPoliciesClient() *BackupPoliciesClient { + subClient, _ := NewBackupPoliciesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVolumeQuotaRulesClient() *VolumeQuotaRulesClient { + subClient, _ := NewVolumeQuotaRulesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVolumeGroupsClient() *VolumeGroupsClient { + subClient, _ := NewVolumeGroupsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSubvolumesClient() *SubvolumesClient { + subClient, _ := NewSubvolumesClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/sdk/resourcemanager/netapp/armnetapp/operations_client.go b/sdk/resourcemanager/netapp/armnetapp/operations_client.go index e94422d97d27..af86d77b47c3 100644 --- a/sdk/resourcemanager/netapp/armnetapp/operations_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/operations_client.go @@ -13,8 +13,6 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -23,28 +21,19 @@ import ( // OperationsClient contains the methods for the Operations group. // Don't use this type directly, use NewOperationsClient() instead. type OperationsClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewOperationsClient creates a new instance of OperationsClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".OperationsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &OperationsClient{ - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -63,7 +52,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption if err != nil { return OperationsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationsClientListResponse{}, err } @@ -78,7 +67,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption // listCreateRequest creates the List request. func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.NetApp/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go index 27718bb293b2..e31d576ed601 100644 --- a/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go @@ -24,11 +24,11 @@ func ExampleOperationsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewOperationsClient(cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { diff --git a/sdk/resourcemanager/netapp/armnetapp/pools_client.go b/sdk/resourcemanager/netapp/armnetapp/pools_client.go index 37b2d7caa17a..861088b40ab6 100644 --- a/sdk/resourcemanager/netapp/armnetapp/pools_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/pools_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // PoolsClient contains the methods for the Pools group. // Don't use this type directly, use NewPoolsClient() instead. type PoolsClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewPoolsClient creates a new instance of PoolsClient with the specified values. @@ -36,21 +33,13 @@ type PoolsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PoolsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".PoolsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &PoolsClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -71,11 +60,11 @@ func (client *PoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PoolsClientCreateOrUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PoolsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[PoolsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PoolsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -88,7 +77,7 @@ func (client *PoolsClient) createOrUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -117,7 +106,7 @@ func (client *PoolsClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, errors.New("parameter poolName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -142,11 +131,11 @@ func (client *PoolsClient) BeginDelete(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PoolsClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PoolsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[PoolsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PoolsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -159,7 +148,7 @@ func (client *PoolsClient) deleteOperation(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -188,7 +177,7 @@ func (client *PoolsClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter poolName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -211,7 +200,7 @@ func (client *PoolsClient) Get(ctx context.Context, resourceGroupName string, ac if err != nil { return PoolsClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return PoolsClientGetResponse{}, err } @@ -240,7 +229,7 @@ func (client *PoolsClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, errors.New("parameter poolName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -282,7 +271,7 @@ func (client *PoolsClient) NewListPager(resourceGroupName string, accountName st if err != nil { return PoolsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return PoolsClientListResponse{}, err } @@ -309,7 +298,7 @@ func (client *PoolsClient) listCreateRequest(ctx context.Context, resourceGroupN return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -344,11 +333,11 @@ func (client *PoolsClient) BeginUpdate(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PoolsClientUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PoolsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[PoolsClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PoolsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -361,7 +350,7 @@ func (client *PoolsClient) update(ctx context.Context, resourceGroupName string, if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -390,7 +379,7 @@ func (client *PoolsClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter poolName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go index 0b6d0027986e..5e70e07f0508 100644 --- a/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go @@ -25,11 +25,11 @@ func ExamplePoolsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewPoolsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myRG", "account1", nil) + pager := clientFactory.NewPoolsClient().NewListPager("myRG", "account1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -67,11 +67,11 @@ func ExamplePoolsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewPoolsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", "pool1", nil) + res, err := clientFactory.NewPoolsClient().Get(ctx, "myRG", "account1", "pool1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -102,11 +102,11 @@ func ExamplePoolsClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewPoolsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myRG", "account1", "pool1", armnetapp.CapacityPool{ + poller, err := clientFactory.NewPoolsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", "pool1", armnetapp.CapacityPool{ Location: to.Ptr("eastus"), Properties: &armnetapp.PoolProperties{ QosType: to.Ptr(armnetapp.QosTypeAuto), @@ -147,11 +147,11 @@ func ExamplePoolsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewPoolsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", armnetapp.CapacityPoolPatch{}, nil) + poller, err := clientFactory.NewPoolsClient().BeginUpdate(ctx, "myRG", "account1", "pool1", armnetapp.CapacityPoolPatch{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -186,11 +186,11 @@ func ExamplePoolsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewPoolsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myRG", "account1", "pool1", nil) + poller, err := clientFactory.NewPoolsClient().BeginDelete(ctx, "myRG", "account1", "pool1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/resource_client.go b/sdk/resourcemanager/netapp/armnetapp/resource_client.go index d01f24e4bf17..288a86fc7a2c 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resource_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/resource_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // ResourceClient contains the methods for the NetAppResource group. // Don't use this type directly, use NewResourceClient() instead. type ResourceClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewResourceClient creates a new instance of ResourceClient with the specified values. @@ -36,21 +33,13 @@ type ResourceClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".ResourceClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &ResourceClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -68,7 +57,7 @@ func (client *ResourceClient) CheckFilePathAvailability(ctx context.Context, loc if err != nil { return ResourceClientCheckFilePathAvailabilityResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceClientCheckFilePathAvailabilityResponse{}, err } @@ -89,7 +78,7 @@ func (client *ResourceClient) checkFilePathAvailabilityCreateRequest(ctx context return nil, errors.New("parameter location cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -122,7 +111,7 @@ func (client *ResourceClient) CheckNameAvailability(ctx context.Context, locatio if err != nil { return ResourceClientCheckNameAvailabilityResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceClientCheckNameAvailabilityResponse{}, err } @@ -143,7 +132,7 @@ func (client *ResourceClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, errors.New("parameter location cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -176,7 +165,7 @@ func (client *ResourceClient) CheckQuotaAvailability(ctx context.Context, locati if err != nil { return ResourceClientCheckQuotaAvailabilityResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceClientCheckQuotaAvailabilityResponse{}, err } @@ -197,7 +186,7 @@ func (client *ResourceClient) checkQuotaAvailabilityCreateRequest(ctx context.Co return nil, errors.New("parameter location cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -229,7 +218,7 @@ func (client *ResourceClient) QueryRegionInfo(ctx context.Context, location stri if err != nil { return ResourceClientQueryRegionInfoResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceClientQueryRegionInfoResponse{}, err } @@ -250,7 +239,7 @@ func (client *ResourceClient) queryRegionInfoCreateRequest(ctx context.Context, return nil, errors.New("parameter location cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go index ed4780f19f7c..625b75a8b02f 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go @@ -25,11 +25,11 @@ func ExampleResourceClient_CheckNameAvailability() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewResourceClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CheckNameAvailability(ctx, "eastus", armnetapp.ResourceNameAvailabilityRequest{ + res, err := clientFactory.NewResourceClient().CheckNameAvailability(ctx, "eastus", armnetapp.ResourceNameAvailabilityRequest{ Name: to.Ptr("accName"), Type: to.Ptr(armnetapp.CheckNameResourceTypes("netAppAccount")), ResourceGroup: to.Ptr("myRG"), @@ -52,11 +52,11 @@ func ExampleResourceClient_CheckFilePathAvailability() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewResourceClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CheckFilePathAvailability(ctx, "eastus", armnetapp.FilePathAvailabilityRequest{ + res, err := clientFactory.NewResourceClient().CheckFilePathAvailability(ctx, "eastus", armnetapp.FilePathAvailabilityRequest{ Name: to.Ptr("my-exact-filepth"), SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), }, nil) @@ -78,11 +78,11 @@ func ExampleResourceClient_CheckQuotaAvailability() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewResourceClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CheckQuotaAvailability(ctx, "eastus", armnetapp.QuotaAvailabilityRequest{ + res, err := clientFactory.NewResourceClient().CheckQuotaAvailability(ctx, "eastus", armnetapp.QuotaAvailabilityRequest{ Name: to.Ptr("resource1"), Type: to.Ptr(armnetapp.CheckQuotaNameResourceTypesMicrosoftNetAppNetAppAccounts), ResourceGroup: to.Ptr("myRG"), @@ -105,11 +105,11 @@ func ExampleResourceClient_QueryRegionInfo() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewResourceClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.QueryRegionInfo(ctx, "eastus", nil) + res, err := clientFactory.NewResourceClient().QueryRegionInfo(ctx, "eastus", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go index c8a8ccd45df5..1cbc3baaaa79 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // ResourceQuotaLimitsClient contains the methods for the NetAppResourceQuotaLimits group. // Don't use this type directly, use NewResourceQuotaLimitsClient() instead. type ResourceQuotaLimitsClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewResourceQuotaLimitsClient creates a new instance of ResourceQuotaLimitsClient with the specified values. @@ -36,21 +33,13 @@ type ResourceQuotaLimitsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewResourceQuotaLimitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceQuotaLimitsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".ResourceQuotaLimitsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &ResourceQuotaLimitsClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -67,7 +56,7 @@ func (client *ResourceQuotaLimitsClient) Get(ctx context.Context, location strin if err != nil { return ResourceQuotaLimitsClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceQuotaLimitsClientGetResponse{}, err } @@ -92,7 +81,7 @@ func (client *ResourceQuotaLimitsClient) getCreateRequest(ctx context.Context, l return nil, errors.New("parameter quotaLimitName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{quotaLimitName}", url.PathEscape(quotaLimitName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -128,7 +117,7 @@ func (client *ResourceQuotaLimitsClient) NewListPager(location string, options * if err != nil { return ResourceQuotaLimitsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceQuotaLimitsClientListResponse{}, err } @@ -151,7 +140,7 @@ func (client *ResourceQuotaLimitsClient) listCreateRequest(ctx context.Context, return nil, errors.New("parameter location cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go index fc7340b14f06..7e4263971fd9 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go @@ -24,11 +24,11 @@ func ExampleResourceQuotaLimitsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewResourceQuotaLimitsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("eastus", nil) + pager := clientFactory.NewResourceQuotaLimitsClient().NewListPager("eastus", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -124,11 +124,11 @@ func ExampleResourceQuotaLimitsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewResourceQuotaLimitsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "eastus", "totalCoolAccessVolumesPerSubscription", nil) + res, err := clientFactory.NewResourceQuotaLimitsClient().Get(ctx, "eastus", "totalCoolAccessVolumesPerSubscription", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go index 5b2be90b0d60..7cf5a018ae93 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // SnapshotPoliciesClient contains the methods for the SnapshotPolicies group. // Don't use this type directly, use NewSnapshotPoliciesClient() instead. type SnapshotPoliciesClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewSnapshotPoliciesClient creates a new instance of SnapshotPoliciesClient with the specified values. @@ -36,21 +33,13 @@ type SnapshotPoliciesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSnapshotPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotPoliciesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".SnapshotPoliciesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &SnapshotPoliciesClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -69,7 +58,7 @@ func (client *SnapshotPoliciesClient) Create(ctx context.Context, resourceGroupN if err != nil { return SnapshotPoliciesClientCreateResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotPoliciesClientCreateResponse{}, err } @@ -98,7 +87,7 @@ func (client *SnapshotPoliciesClient) createCreateRequest(ctx context.Context, r return nil, errors.New("parameter snapshotPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotPolicyName}", url.PathEscape(snapshotPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -133,11 +122,11 @@ func (client *SnapshotPoliciesClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SnapshotPoliciesClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotPoliciesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[SnapshotPoliciesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SnapshotPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -150,7 +139,7 @@ func (client *SnapshotPoliciesClient) deleteOperation(ctx context.Context, resou if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -179,7 +168,7 @@ func (client *SnapshotPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, errors.New("parameter snapshotPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotPolicyName}", url.PathEscape(snapshotPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -202,7 +191,7 @@ func (client *SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName if err != nil { return SnapshotPoliciesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotPoliciesClientGetResponse{}, err } @@ -231,7 +220,7 @@ func (client *SnapshotPoliciesClient) getCreateRequest(ctx context.Context, reso return nil, errors.New("parameter snapshotPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotPolicyName}", url.PathEscape(snapshotPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -268,7 +257,7 @@ func (client *SnapshotPoliciesClient) NewListPager(resourceGroupName string, acc if err != nil { return SnapshotPoliciesClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotPoliciesClientListResponse{}, err } @@ -295,7 +284,7 @@ func (client *SnapshotPoliciesClient) listCreateRequest(ctx context.Context, res return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -329,7 +318,7 @@ func (client *SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceG if err != nil { return SnapshotPoliciesClientListVolumesResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotPoliciesClientListVolumesResponse{}, err } @@ -358,7 +347,7 @@ func (client *SnapshotPoliciesClient) listVolumesCreateRequest(ctx context.Conte return nil, errors.New("parameter snapshotPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotPolicyName}", url.PathEscape(snapshotPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -394,11 +383,11 @@ func (client *SnapshotPoliciesClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SnapshotPoliciesClientUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotPoliciesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[SnapshotPoliciesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SnapshotPoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -411,7 +400,7 @@ func (client *SnapshotPoliciesClient) update(ctx context.Context, resourceGroupN if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -440,7 +429,7 @@ func (client *SnapshotPoliciesClient) updateCreateRequest(ctx context.Context, r return nil, errors.New("parameter snapshotPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotPolicyName}", url.PathEscape(snapshotPolicyName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go index 26ac9b0252a8..13281d9df5ca 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go @@ -25,11 +25,11 @@ func ExampleSnapshotPoliciesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myRG", "account1", nil) + pager := clientFactory.NewSnapshotPoliciesClient().NewListPager("myRG", "account1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -84,11 +84,11 @@ func ExampleSnapshotPoliciesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", "snapshotPolicyName", nil) + res, err := clientFactory.NewSnapshotPoliciesClient().Get(ctx, "myRG", "account1", "snapshotPolicyName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -135,11 +135,11 @@ func ExampleSnapshotPoliciesClient_Create() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Create(ctx, "myRG", "account1", "snapshotPolicyName", armnetapp.SnapshotPolicy{ + res, err := clientFactory.NewSnapshotPoliciesClient().Create(ctx, "myRG", "account1", "snapshotPolicyName", armnetapp.SnapshotPolicy{ Location: to.Ptr("eastus"), Properties: &armnetapp.SnapshotPolicyProperties{ DailySchedule: &armnetapp.DailySchedule{ @@ -212,11 +212,11 @@ func ExampleSnapshotPoliciesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "snapshotPolicyName", armnetapp.SnapshotPolicyPatch{ + poller, err := clientFactory.NewSnapshotPoliciesClient().BeginUpdate(ctx, "myRG", "account1", "snapshotPolicyName", armnetapp.SnapshotPolicyPatch{ Location: to.Ptr("eastus"), Properties: &armnetapp.SnapshotPolicyProperties{ DailySchedule: &armnetapp.DailySchedule{ @@ -293,11 +293,11 @@ func ExampleSnapshotPoliciesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "resourceGroup", "accountName", "snapshotPolicyName", nil) + poller, err := clientFactory.NewSnapshotPoliciesClient().BeginDelete(ctx, "resourceGroup", "accountName", "snapshotPolicyName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -314,11 +314,11 @@ func ExampleSnapshotPoliciesClient_ListVolumes() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListVolumes(ctx, "myRG", "account1", "snapshotPolicyName", nil) + res, err := clientFactory.NewSnapshotPoliciesClient().ListVolumes(ctx, "myRG", "account1", "snapshotPolicyName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go b/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go index 884873c20a5d..e704e11f87e8 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // SnapshotsClient contains the methods for the Snapshots group. // Don't use this type directly, use NewSnapshotsClient() instead. type SnapshotsClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewSnapshotsClient creates a new instance of SnapshotsClient with the specified values. @@ -36,21 +33,13 @@ type SnapshotsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".SnapshotsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &SnapshotsClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -72,11 +61,11 @@ func (client *SnapshotsClient) BeginCreate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SnapshotsClientCreateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[SnapshotsClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SnapshotsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -89,7 +78,7 @@ func (client *SnapshotsClient) create(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -126,7 +115,7 @@ func (client *SnapshotsClient) createCreateRequest(ctx context.Context, resource return nil, errors.New("parameter snapshotName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -153,11 +142,11 @@ func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SnapshotsClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[SnapshotsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SnapshotsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -170,7 +159,7 @@ func (client *SnapshotsClient) deleteOperation(ctx context.Context, resourceGrou if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -207,7 +196,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, errors.New("parameter snapshotName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -232,7 +221,7 @@ func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string if err != nil { return SnapshotsClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotsClientGetResponse{}, err } @@ -269,7 +258,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, errors.New("parameter snapshotName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -307,7 +296,7 @@ func (client *SnapshotsClient) NewListPager(resourceGroupName string, accountNam if err != nil { return SnapshotsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotsClientListResponse{}, err } @@ -342,7 +331,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -380,9 +369,9 @@ func (client *SnapshotsClient) BeginRestoreFiles(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[SnapshotsClientRestoreFilesResponse](resp, client.pl, nil) + return runtime.NewPoller[SnapshotsClientRestoreFilesResponse](resp, client.internal.Pipeline(), nil) } else { - return runtime.NewPollerFromResumeToken[SnapshotsClientRestoreFilesResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SnapshotsClientRestoreFilesResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -395,7 +384,7 @@ func (client *SnapshotsClient) restoreFiles(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -432,7 +421,7 @@ func (client *SnapshotsClient) restoreFilesCreateRequest(ctx context.Context, re return nil, errors.New("parameter snapshotName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -459,11 +448,11 @@ func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SnapshotsClientUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[SnapshotsClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SnapshotsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -476,7 +465,7 @@ func (client *SnapshotsClient) update(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -513,7 +502,7 @@ func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resource return nil, errors.New("parameter snapshotName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go index 52f6a80a7e10..f5495b0216a9 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go @@ -25,11 +25,11 @@ func ExampleSnapshotsClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myRG", "account1", "pool1", "volume1", nil) + pager := clientFactory.NewSnapshotsClient().NewListPager("myRG", "account1", "pool1", "volume1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -64,11 +64,11 @@ func ExampleSnapshotsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", nil) + res, err := clientFactory.NewSnapshotsClient().Get(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -95,11 +95,11 @@ func ExampleSnapshotsClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", armnetapp.Snapshot{ + poller, err := clientFactory.NewSnapshotsClient().BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", armnetapp.Snapshot{ Location: to.Ptr("eastus"), }, nil) if err != nil { @@ -118,11 +118,11 @@ func ExampleSnapshotsClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", map[string]any{}, nil) + poller, err := clientFactory.NewSnapshotsClient().BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", map[string]any{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -153,11 +153,11 @@ func ExampleSnapshotsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", nil) + poller, err := clientFactory.NewSnapshotsClient().BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -174,11 +174,11 @@ func ExampleSnapshotsClient_BeginRestoreFiles() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRestoreFiles(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", armnetapp.SnapshotRestoreFiles{ + poller, err := clientFactory.NewSnapshotsClient().BeginRestoreFiles(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", armnetapp.SnapshotRestoreFiles{ FilePaths: []*string{ to.Ptr("/dir1/customer1.db"), to.Ptr("/dir1/customer2.db")}, diff --git a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go index 5ffaa9268a4b..10969ebd46f8 100644 --- a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // SubvolumesClient contains the methods for the Subvolumes group. // Don't use this type directly, use NewSubvolumesClient() instead. type SubvolumesClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewSubvolumesClient creates a new instance of SubvolumesClient with the specified values. @@ -36,21 +33,13 @@ type SubvolumesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSubvolumesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubvolumesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".SubvolumesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &SubvolumesClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -72,11 +61,11 @@ func (client *SubvolumesClient) BeginCreate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SubvolumesClientCreateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[SubvolumesClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SubvolumesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -89,7 +78,7 @@ func (client *SubvolumesClient) create(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -126,7 +115,7 @@ func (client *SubvolumesClient) createCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter subvolumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subvolumeName}", url.PathEscape(subvolumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -153,11 +142,11 @@ func (client *SubvolumesClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SubvolumesClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[SubvolumesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SubvolumesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -170,7 +159,7 @@ func (client *SubvolumesClient) deleteOperation(ctx context.Context, resourceGro if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -207,7 +196,7 @@ func (client *SubvolumesClient) deleteCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter subvolumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subvolumeName}", url.PathEscape(subvolumeName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -232,7 +221,7 @@ func (client *SubvolumesClient) Get(ctx context.Context, resourceGroupName strin if err != nil { return SubvolumesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SubvolumesClientGetResponse{}, err } @@ -269,7 +258,7 @@ func (client *SubvolumesClient) getCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter subvolumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subvolumeName}", url.PathEscape(subvolumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -306,11 +295,11 @@ func (client *SubvolumesClient) BeginGetMetadata(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SubvolumesClientGetMetadataResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientGetMetadataResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[SubvolumesClientGetMetadataResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SubvolumesClientGetMetadataResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -323,7 +312,7 @@ func (client *SubvolumesClient) getMetadata(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -360,7 +349,7 @@ func (client *SubvolumesClient) getMetadataCreateRequest(ctx context.Context, re return nil, errors.New("parameter subvolumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subvolumeName}", url.PathEscape(subvolumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -396,7 +385,7 @@ func (client *SubvolumesClient) NewListByVolumePager(resourceGroupName string, a if err != nil { return SubvolumesClientListByVolumeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SubvolumesClientListByVolumeResponse{}, err } @@ -431,7 +420,7 @@ func (client *SubvolumesClient) listByVolumeCreateRequest(ctx context.Context, r return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -468,11 +457,11 @@ func (client *SubvolumesClient) BeginUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SubvolumesClientUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[SubvolumesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SubvolumesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -485,7 +474,7 @@ func (client *SubvolumesClient) update(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -522,7 +511,7 @@ func (client *SubvolumesClient) updateCreateRequest(ctx context.Context, resourc return nil, errors.New("parameter subvolumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subvolumeName}", url.PathEscape(subvolumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go index c570ee9e4ce7..dea6eb5dfbb4 100644 --- a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go @@ -25,11 +25,11 @@ func ExampleSubvolumesClient_NewListByVolumePager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByVolumePager("myRG", "account1", "pool1", "volume1", nil) + pager := clientFactory.NewSubvolumesClient().NewListByVolumePager("myRG", "account1", "pool1", "volume1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -61,11 +61,11 @@ func ExampleSubvolumesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) + res, err := clientFactory.NewSubvolumesClient().Get(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -89,11 +89,11 @@ func ExampleSubvolumesClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", armnetapp.SubvolumeInfo{ + poller, err := clientFactory.NewSubvolumesClient().BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", armnetapp.SubvolumeInfo{ Properties: &armnetapp.SubvolumeProperties{ Path: to.Ptr("/subvolumePath"), }, @@ -126,11 +126,11 @@ func ExampleSubvolumesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", armnetapp.SubvolumePatchRequest{ + poller, err := clientFactory.NewSubvolumesClient().BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", armnetapp.SubvolumePatchRequest{ Properties: &armnetapp.SubvolumePatchParams{ Path: to.Ptr("/subvolumePath"), }, @@ -162,11 +162,11 @@ func ExampleSubvolumesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) + poller, err := clientFactory.NewSubvolumesClient().BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -183,11 +183,11 @@ func ExampleSubvolumesClient_BeginGetMetadata() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginGetMetadata(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) + poller, err := clientFactory.NewSubvolumesClient().BeginGetMetadata(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go index 2ec05fb5932a..15a96378c29f 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // VolumeGroupsClient contains the methods for the VolumeGroups group. // Don't use this type directly, use NewVolumeGroupsClient() instead. type VolumeGroupsClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewVolumeGroupsClient creates a new instance of VolumeGroupsClient with the specified values. @@ -36,21 +33,13 @@ type VolumeGroupsClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewVolumeGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VolumeGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".VolumeGroupsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &VolumeGroupsClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -71,9 +60,9 @@ func (client *VolumeGroupsClient) BeginCreate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[VolumeGroupsClientCreateResponse](resp, client.pl, nil) + return runtime.NewPoller[VolumeGroupsClientCreateResponse](resp, client.internal.Pipeline(), nil) } else { - return runtime.NewPollerFromResumeToken[VolumeGroupsClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumeGroupsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -86,7 +75,7 @@ func (client *VolumeGroupsClient) create(ctx context.Context, resourceGroupName if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -115,7 +104,7 @@ func (client *VolumeGroupsClient) createCreateRequest(ctx context.Context, resou return nil, errors.New("parameter volumeGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeGroupName}", url.PathEscape(volumeGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -141,9 +130,9 @@ func (client *VolumeGroupsClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[VolumeGroupsClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller[VolumeGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { - return runtime.NewPollerFromResumeToken[VolumeGroupsClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumeGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -156,7 +145,7 @@ func (client *VolumeGroupsClient) deleteOperation(ctx context.Context, resourceG if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -185,7 +174,7 @@ func (client *VolumeGroupsClient) deleteCreateRequest(ctx context.Context, resou return nil, errors.New("parameter volumeGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeGroupName}", url.PathEscape(volumeGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -208,7 +197,7 @@ func (client *VolumeGroupsClient) Get(ctx context.Context, resourceGroupName str if err != nil { return VolumeGroupsClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumeGroupsClientGetResponse{}, err } @@ -237,7 +226,7 @@ func (client *VolumeGroupsClient) getCreateRequest(ctx context.Context, resource return nil, errors.New("parameter volumeGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeGroupName}", url.PathEscape(volumeGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -274,7 +263,7 @@ func (client *VolumeGroupsClient) NewListByNetAppAccountPager(resourceGroupName if err != nil { return VolumeGroupsClientListByNetAppAccountResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumeGroupsClientListByNetAppAccountResponse{}, err } @@ -301,7 +290,7 @@ func (client *VolumeGroupsClient) listByNetAppAccountCreateRequest(ctx context.C return nil, errors.New("parameter accountName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go index c6277c05f021..46e99400a6d9 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go @@ -25,11 +25,11 @@ func ExampleVolumeGroupsClient_NewListByNetAppAccountPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumeGroupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByNetAppAccountPager("myRG", "account1", nil) + pager := clientFactory.NewVolumeGroupsClient().NewListByNetAppAccountPager("myRG", "account1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -68,11 +68,11 @@ func ExampleVolumeGroupsClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumeGroupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", "group1", nil) + res, err := clientFactory.NewVolumeGroupsClient().Get(ctx, "myRG", "account1", "group1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -179,11 +179,11 @@ func ExampleVolumeGroupsClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumeGroupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "myRG", "account1", "group1", armnetapp.VolumeGroupDetails{ + poller, err := clientFactory.NewVolumeGroupsClient().BeginCreate(ctx, "myRG", "account1", "group1", armnetapp.VolumeGroupDetails{ Location: to.Ptr("westus"), Properties: &armnetapp.VolumeGroupProperties{ GroupMetaData: &armnetapp.VolumeGroupMetaData{ @@ -250,11 +250,11 @@ func ExampleVolumeGroupsClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumeGroupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myRG", "account1", "group1", nil) + poller, err := clientFactory.NewVolumeGroupsClient().BeginDelete(ctx, "myRG", "account1", "group1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go index 4cdeab662d11..554e2d90ff54 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,9 +24,8 @@ import ( // VolumeQuotaRulesClient contains the methods for the VolumeQuotaRules group. // Don't use this type directly, use NewVolumeQuotaRulesClient() instead. type VolumeQuotaRulesClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewVolumeQuotaRulesClient creates a new instance of VolumeQuotaRulesClient with the specified values. @@ -36,21 +33,13 @@ type VolumeQuotaRulesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewVolumeQuotaRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VolumeQuotaRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".VolumeQuotaRulesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &VolumeQuotaRulesClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -73,11 +62,11 @@ func (client *VolumeQuotaRulesClient) BeginCreate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumeQuotaRulesClientCreateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumeQuotaRulesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumeQuotaRulesClientCreateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumeQuotaRulesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -90,7 +79,7 @@ func (client *VolumeQuotaRulesClient) create(ctx context.Context, resourceGroupN if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -127,7 +116,7 @@ func (client *VolumeQuotaRulesClient) createCreateRequest(ctx context.Context, r return nil, errors.New("parameter volumeQuotaRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeQuotaRuleName}", url.PathEscape(volumeQuotaRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -155,11 +144,11 @@ func (client *VolumeQuotaRulesClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumeQuotaRulesClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumeQuotaRulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumeQuotaRulesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumeQuotaRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -172,7 +161,7 @@ func (client *VolumeQuotaRulesClient) deleteOperation(ctx context.Context, resou if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -209,7 +198,7 @@ func (client *VolumeQuotaRulesClient) deleteCreateRequest(ctx context.Context, r return nil, errors.New("parameter volumeQuotaRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeQuotaRuleName}", url.PathEscape(volumeQuotaRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -234,7 +223,7 @@ func (client *VolumeQuotaRulesClient) Get(ctx context.Context, resourceGroupName if err != nil { return VolumeQuotaRulesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumeQuotaRulesClientGetResponse{}, err } @@ -271,7 +260,7 @@ func (client *VolumeQuotaRulesClient) getCreateRequest(ctx context.Context, reso return nil, errors.New("parameter volumeQuotaRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeQuotaRuleName}", url.PathEscape(volumeQuotaRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -310,7 +299,7 @@ func (client *VolumeQuotaRulesClient) NewListByVolumePager(resourceGroupName str if err != nil { return VolumeQuotaRulesClientListByVolumeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumeQuotaRulesClientListByVolumeResponse{}, err } @@ -345,7 +334,7 @@ func (client *VolumeQuotaRulesClient) listByVolumeCreateRequest(ctx context.Cont return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -383,11 +372,11 @@ func (client *VolumeQuotaRulesClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumeQuotaRulesClientUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumeQuotaRulesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumeQuotaRulesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumeQuotaRulesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -400,7 +389,7 @@ func (client *VolumeQuotaRulesClient) update(ctx context.Context, resourceGroupN if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -437,7 +426,7 @@ func (client *VolumeQuotaRulesClient) updateCreateRequest(ctx context.Context, r return nil, errors.New("parameter volumeQuotaRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeQuotaRuleName}", url.PathEscape(volumeQuotaRuleName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go index 1e03af7958f4..ffc965fc1dc6 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go @@ -25,11 +25,11 @@ func ExampleVolumeQuotaRulesClient_NewListByVolumePager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByVolumePager("myRG", "account-9957", "pool-5210", "volume-6387", nil) + pager := clientFactory.NewVolumeQuotaRulesClient().NewListByVolumePager("myRG", "account-9957", "pool-5210", "volume-6387", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -65,11 +65,11 @@ func ExampleVolumeQuotaRulesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", nil) + res, err := clientFactory.NewVolumeQuotaRulesClient().Get(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -97,11 +97,11 @@ func ExampleVolumeQuotaRulesClient_BeginCreate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreate(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", armnetapp.VolumeQuotaRule{ + poller, err := clientFactory.NewVolumeQuotaRulesClient().BeginCreate(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", armnetapp.VolumeQuotaRule{ Location: to.Ptr("westus"), Properties: &armnetapp.VolumeQuotaRulesProperties{ QuotaSizeInKiBs: to.Ptr[int64](100005), @@ -140,11 +140,11 @@ func ExampleVolumeQuotaRulesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", armnetapp.VolumeQuotaRulePatch{ + poller, err := clientFactory.NewVolumeQuotaRulesClient().BeginUpdate(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", armnetapp.VolumeQuotaRulePatch{ Properties: &armnetapp.VolumeQuotaRulesProperties{ QuotaSizeInKiBs: to.Ptr[int64](100009), }, @@ -180,11 +180,11 @@ func ExampleVolumeQuotaRulesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", nil) + poller, err := clientFactory.NewVolumeQuotaRulesClient().BeginDelete(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/netapp/armnetapp/volumes_client.go b/sdk/resourcemanager/netapp/armnetapp/volumes_client.go index 80d9389b5fbc..4203630ed5ec 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumes_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumes_client.go @@ -14,8 +14,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -27,9 +25,8 @@ import ( // VolumesClient contains the methods for the Volumes group. // Don't use this type directly, use NewVolumesClient() instead. type VolumesClient struct { - host string + internal *arm.Client subscriptionID string - pl runtime.Pipeline } // NewVolumesClient creates a new instance of VolumesClient with the specified values. @@ -37,21 +34,13 @@ type VolumesClient struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewVolumesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VolumesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".VolumesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &VolumesClient{ subscriptionID: subscriptionID, - host: ep, - pl: pl, + internal: cl, } return client, nil } @@ -73,11 +62,11 @@ func (client *VolumesClient) BeginAuthorizeReplication(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientAuthorizeReplicationResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientAuthorizeReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientAuthorizeReplicationResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientAuthorizeReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -90,7 +79,7 @@ func (client *VolumesClient) authorizeReplication(ctx context.Context, resourceG if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -123,7 +112,7 @@ func (client *VolumesClient) authorizeReplicationCreateRequest(ctx context.Conte return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -149,11 +138,11 @@ func (client *VolumesClient) BeginBreakFileLocks(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientBreakFileLocksResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientBreakFileLocksResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientBreakFileLocksResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientBreakFileLocksResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -166,7 +155,7 @@ func (client *VolumesClient) breakFileLocks(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -199,7 +188,7 @@ func (client *VolumesClient) breakFileLocksCreateRequest(ctx context.Context, re return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -228,11 +217,11 @@ func (client *VolumesClient) BeginBreakReplication(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientBreakReplicationResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientBreakReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientBreakReplicationResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientBreakReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -245,7 +234,7 @@ func (client *VolumesClient) breakReplication(ctx context.Context, resourceGroup if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -278,7 +267,7 @@ func (client *VolumesClient) breakReplicationCreateRequest(ctx context.Context, return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -308,11 +297,11 @@ func (client *VolumesClient) BeginCreateOrUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientCreateOrUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -325,7 +314,7 @@ func (client *VolumesClient) createOrUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -358,7 +347,7 @@ func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -384,11 +373,11 @@ func (client *VolumesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientDeleteResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -401,7 +390,7 @@ func (client *VolumesClient) deleteOperation(ctx context.Context, resourceGroupN if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -434,7 +423,7 @@ func (client *VolumesClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -463,11 +452,11 @@ func (client *VolumesClient) BeginDeleteReplication(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientDeleteReplicationResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientDeleteReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientDeleteReplicationResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientDeleteReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -480,7 +469,7 @@ func (client *VolumesClient) deleteReplication(ctx context.Context, resourceGrou if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -513,7 +502,7 @@ func (client *VolumesClient) deleteReplicationCreateRequest(ctx context.Context, return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -539,9 +528,9 @@ func (client *VolumesClient) BeginFinalizeRelocation(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[VolumesClientFinalizeRelocationResponse](resp, client.pl, nil) + return runtime.NewPoller[VolumesClientFinalizeRelocationResponse](resp, client.internal.Pipeline(), nil) } else { - return runtime.NewPollerFromResumeToken[VolumesClientFinalizeRelocationResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientFinalizeRelocationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -554,7 +543,7 @@ func (client *VolumesClient) finalizeRelocation(ctx context.Context, resourceGro if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -587,7 +576,7 @@ func (client *VolumesClient) finalizeRelocationCreateRequest(ctx context.Context return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -611,7 +600,7 @@ func (client *VolumesClient) Get(ctx context.Context, resourceGroupName string, if err != nil { return VolumesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumesClientGetResponse{}, err } @@ -644,7 +633,7 @@ func (client *VolumesClient) getCreateRequest(ctx context.Context, resourceGroup return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -687,7 +676,7 @@ func (client *VolumesClient) NewListPager(resourceGroupName string, accountName if err != nil { return VolumesClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumesClientListResponse{}, err } @@ -718,7 +707,7 @@ func (client *VolumesClient) listCreateRequest(ctx context.Context, resourceGrou return nil, errors.New("parameter poolName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -757,7 +746,7 @@ func (client *VolumesClient) NewListReplicationsPager(resourceGroupName string, if err != nil { return VolumesClientListReplicationsResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumesClientListReplicationsResponse{}, err } @@ -792,7 +781,7 @@ func (client *VolumesClient) listReplicationsCreateRequest(ctx context.Context, return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -828,11 +817,11 @@ func (client *VolumesClient) BeginPoolChange(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientPoolChangeResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientPoolChangeResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientPoolChangeResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientPoolChangeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -845,7 +834,7 @@ func (client *VolumesClient) poolChange(ctx context.Context, resourceGroupName s if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -878,7 +867,7 @@ func (client *VolumesClient) poolChangeCreateRequest(ctx context.Context, resour return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -904,11 +893,11 @@ func (client *VolumesClient) BeginReInitializeReplication(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientReInitializeReplicationResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientReInitializeReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientReInitializeReplicationResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientReInitializeReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -921,7 +910,7 @@ func (client *VolumesClient) reInitializeReplication(ctx context.Context, resour if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -954,7 +943,7 @@ func (client *VolumesClient) reInitializeReplicationCreateRequest(ctx context.Co return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -982,11 +971,11 @@ func (client *VolumesClient) BeginReestablishReplication(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientReestablishReplicationResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientReestablishReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientReestablishReplicationResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientReestablishReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -1000,7 +989,7 @@ func (client *VolumesClient) reestablishReplication(ctx context.Context, resourc if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -1033,7 +1022,7 @@ func (client *VolumesClient) reestablishReplicationCreateRequest(ctx context.Con return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -1058,9 +1047,9 @@ func (client *VolumesClient) BeginRelocate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[VolumesClientRelocateResponse](resp, client.pl, nil) + return runtime.NewPoller[VolumesClientRelocateResponse](resp, client.internal.Pipeline(), nil) } else { - return runtime.NewPollerFromResumeToken[VolumesClientRelocateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientRelocateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -1073,7 +1062,7 @@ func (client *VolumesClient) relocate(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -1106,7 +1095,7 @@ func (client *VolumesClient) relocateCreateRequest(ctx context.Context, resource return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -1134,7 +1123,7 @@ func (client *VolumesClient) ReplicationStatus(ctx context.Context, resourceGrou if err != nil { return VolumesClientReplicationStatusResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumesClientReplicationStatusResponse{}, err } @@ -1167,7 +1156,7 @@ func (client *VolumesClient) replicationStatusCreateRequest(ctx context.Context, return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -1203,9 +1192,9 @@ func (client *VolumesClient) BeginResetCifsPassword(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[VolumesClientResetCifsPasswordResponse](resp, client.pl, nil) + return runtime.NewPoller[VolumesClientResetCifsPasswordResponse](resp, client.internal.Pipeline(), nil) } else { - return runtime.NewPollerFromResumeToken[VolumesClientResetCifsPasswordResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientResetCifsPasswordResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -1218,7 +1207,7 @@ func (client *VolumesClient) resetCifsPassword(ctx context.Context, resourceGrou if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -1251,7 +1240,7 @@ func (client *VolumesClient) resetCifsPasswordCreateRequest(ctx context.Context, return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -1278,11 +1267,11 @@ func (client *VolumesClient) BeginResyncReplication(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientResyncReplicationResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientResyncReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientResyncReplicationResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientResyncReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -1296,7 +1285,7 @@ func (client *VolumesClient) resyncReplication(ctx context.Context, resourceGrou if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -1329,7 +1318,7 @@ func (client *VolumesClient) resyncReplicationCreateRequest(ctx context.Context, return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -1355,11 +1344,11 @@ func (client *VolumesClient) BeginRevert(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientRevertResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientRevertResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientRevertResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientRevertResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -1372,7 +1361,7 @@ func (client *VolumesClient) revert(ctx context.Context, resourceGroupName strin if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -1405,7 +1394,7 @@ func (client *VolumesClient) revertCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -1432,9 +1421,9 @@ func (client *VolumesClient) BeginRevertRelocation(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[VolumesClientRevertRelocationResponse](resp, client.pl, nil) + return runtime.NewPoller[VolumesClientRevertRelocationResponse](resp, client.internal.Pipeline(), nil) } else { - return runtime.NewPollerFromResumeToken[VolumesClientRevertRelocationResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientRevertRelocationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -1448,7 +1437,7 @@ func (client *VolumesClient) revertRelocation(ctx context.Context, resourceGroup if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -1481,7 +1470,7 @@ func (client *VolumesClient) revertRelocationCreateRequest(ctx context.Context, return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -1507,11 +1496,11 @@ func (client *VolumesClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[VolumesClientUpdateResponse]{ + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) } else { - return runtime.NewPollerFromResumeToken[VolumesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[VolumesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } @@ -1524,7 +1513,7 @@ func (client *VolumesClient) update(ctx context.Context, resourceGroupName strin if err != nil { return nil, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } @@ -1557,7 +1546,7 @@ func (client *VolumesClient) updateCreateRequest(ctx context.Context, resourceGr return nil, errors.New("parameter volumeName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go index e459a64e495e..0f884c83687a 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go @@ -25,11 +25,11 @@ func ExampleVolumesClient_NewListPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myRG", "account1", "pool1", nil) + pager := clientFactory.NewVolumesClient().NewListPager("myRG", "account1", "pool1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -71,11 +71,11 @@ func ExampleVolumesClient_Get() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, "myRG", "account1", "pool1", "volume1", nil) + res, err := clientFactory.NewVolumesClient().Get(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -109,11 +109,11 @@ func ExampleVolumesClient_BeginCreateOrUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.Volume{ + poller, err := clientFactory.NewVolumesClient().BeginCreateOrUpdate(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.Volume{ Location: to.Ptr("eastus"), Properties: &armnetapp.VolumeProperties{ CreationToken: to.Ptr("my-unique-file-path"), @@ -157,11 +157,11 @@ func ExampleVolumesClient_BeginUpdate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.VolumePatch{}, nil) + poller, err := clientFactory.NewVolumesClient().BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.VolumePatch{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -204,11 +204,11 @@ func ExampleVolumesClient_BeginDelete() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginDeleteOptions{ForceDelete: nil}) + poller, err := clientFactory.NewVolumesClient().BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginDeleteOptions{ForceDelete: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -225,11 +225,11 @@ func ExampleVolumesClient_BeginRevert() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRevert(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.VolumeRevert{ + poller, err := clientFactory.NewVolumesClient().BeginRevert(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.VolumeRevert{ SnapshotID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1"), }, nil) if err != nil { @@ -248,11 +248,11 @@ func ExampleVolumesClient_BeginResetCifsPassword() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginResetCifsPassword(ctx, "myRG", "account1", "pool1", "volume1", nil) + poller, err := clientFactory.NewVolumesClient().BeginResetCifsPassword(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -269,11 +269,11 @@ func ExampleVolumesClient_BeginBreakFileLocks() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginBreakFileLocks(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginBreakFileLocksOptions{Body: &armnetapp.BreakFileLocksRequest{ + poller, err := clientFactory.NewVolumesClient().BeginBreakFileLocks(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginBreakFileLocksOptions{Body: &armnetapp.BreakFileLocksRequest{ ClientIP: to.Ptr("101.102.103.104"), ConfirmRunningDisruptiveOperation: to.Ptr(true), }, @@ -294,11 +294,11 @@ func ExampleVolumesClient_BeginBreakReplication() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginBreakReplication(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginBreakReplicationOptions{Body: &armnetapp.BreakReplicationRequest{ + poller, err := clientFactory.NewVolumesClient().BeginBreakReplication(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginBreakReplicationOptions{Body: &armnetapp.BreakReplicationRequest{ ForceBreakReplication: to.Ptr(false), }, }) @@ -318,11 +318,11 @@ func ExampleVolumesClient_BeginReestablishReplication() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginReestablishReplication(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.ReestablishReplicationRequest{ + poller, err := clientFactory.NewVolumesClient().BeginReestablishReplication(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.ReestablishReplicationRequest{ SourceVolumeID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/mySourceRG/providers/Microsoft.NetApp/netAppAccounts/sourceAccount1/capacityPools/sourcePool1/volumes/sourceVolume1"), }, nil) if err != nil { @@ -341,11 +341,11 @@ func ExampleVolumesClient_ReplicationStatus() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ReplicationStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) + res, err := clientFactory.NewVolumesClient().ReplicationStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -368,11 +368,11 @@ func ExampleVolumesClient_NewListReplicationsPager() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListReplicationsPager("myRG", "account1", "pool1", "volume1", nil) + pager := clientFactory.NewVolumesClient().NewListReplicationsPager("myRG", "account1", "pool1", "volume1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -401,11 +401,11 @@ func ExampleVolumesClient_BeginResyncReplication() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginResyncReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) + poller, err := clientFactory.NewVolumesClient().BeginResyncReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -422,11 +422,11 @@ func ExampleVolumesClient_BeginDeleteReplication() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDeleteReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) + poller, err := clientFactory.NewVolumesClient().BeginDeleteReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -443,11 +443,11 @@ func ExampleVolumesClient_BeginAuthorizeReplication() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginAuthorizeReplication(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.AuthorizeRequest{ + poller, err := clientFactory.NewVolumesClient().BeginAuthorizeReplication(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.AuthorizeRequest{ RemoteVolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRemoteRG/providers/Microsoft.NetApp/netAppAccounts/remoteAccount1/capacityPools/remotePool1/volumes/remoteVolume1"), }, nil) if err != nil { @@ -466,11 +466,11 @@ func ExampleVolumesClient_BeginReInitializeReplication() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginReInitializeReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) + poller, err := clientFactory.NewVolumesClient().BeginReInitializeReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -487,11 +487,11 @@ func ExampleVolumesClient_BeginPoolChange() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginPoolChange(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.PoolChangeRequest{ + poller, err := clientFactory.NewVolumesClient().BeginPoolChange(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.PoolChangeRequest{ NewPoolResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), }, nil) if err != nil { @@ -510,11 +510,11 @@ func ExampleVolumesClient_BeginRelocate() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRelocate(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginRelocateOptions{Body: &armnetapp.RelocateVolumeRequest{}}) + poller, err := clientFactory.NewVolumesClient().BeginRelocate(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginRelocateOptions{Body: &armnetapp.RelocateVolumeRequest{}}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -531,11 +531,11 @@ func ExampleVolumesClient_BeginFinalizeRelocation() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginFinalizeRelocation(ctx, "myRG", "account1", "pool1", "volume1", nil) + poller, err := clientFactory.NewVolumesClient().BeginFinalizeRelocation(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -552,11 +552,11 @@ func ExampleVolumesClient_BeginRevertRelocation() { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armnetapp.NewVolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) + clientFactory, err := armnetapp.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginRevertRelocation(ctx, "myRG", "account1", "pool1", "volume1", nil) + poller, err := clientFactory.NewVolumesClient().BeginRevertRelocation(ctx, "myRG", "account1", "pool1", "volume1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } From 4801c1adcdef0aa4bdad56b441d7e98d6cb2adcc Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Wed, 22 Mar 2023 14:43:21 +0800 Subject: [PATCH 4/7] fix README --- sdk/resourcemanager/netapp/armnetapp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resourcemanager/netapp/armnetapp/README.md b/sdk/resourcemanager/netapp/armnetapp/README.md index 71ad33c198d3..9704da64d652 100644 --- a/sdk/resourcemanager/netapp/armnetapp/README.md +++ b/sdk/resourcemanager/netapp/armnetapp/README.md @@ -35,7 +35,7 @@ For more information on authentication, please see the documentation for `aziden ## Client Factory -Azure Compute modules consist of one or more clients. We provide a client factory which could be used to create any client in this module. +Azure NetApp modules consist of one or more clients. We provide a client factory which could be used to create any client in this module. ```go clientFactory, err := armnetapp.NewClientFactory(, cred, nil) From b2484a6182c9c77e226cafac47a3d155a63d108c Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Wed, 22 Mar 2023 14:44:28 +0800 Subject: [PATCH 5/7] fix --- sdk/resourcemanager/netapp/armnetapp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resourcemanager/netapp/armnetapp/README.md b/sdk/resourcemanager/netapp/armnetapp/README.md index 9704da64d652..605e187e222a 100644 --- a/sdk/resourcemanager/netapp/armnetapp/README.md +++ b/sdk/resourcemanager/netapp/armnetapp/README.md @@ -35,7 +35,7 @@ For more information on authentication, please see the documentation for `aziden ## Client Factory -Azure NetApp modules consist of one or more clients. We provide a client factory which could be used to create any client in this module. +Azure NetApp Files modules consist of one or more clients. We provide a client factory which could be used to create any client in this module. ```go clientFactory, err := armnetapp.NewClientFactory(, cred, nil) From ae3ebbcfc513239e7a909ecc7bc1f096265debae Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Thu, 23 Mar 2023 10:58:10 +0800 Subject: [PATCH 6/7] fix --- sdk/resourcemanager/netapp/armnetapp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resourcemanager/netapp/armnetapp/README.md b/sdk/resourcemanager/netapp/armnetapp/README.md index 605e187e222a..93246b54d62e 100644 --- a/sdk/resourcemanager/netapp/armnetapp/README.md +++ b/sdk/resourcemanager/netapp/armnetapp/README.md @@ -35,7 +35,7 @@ For more information on authentication, please see the documentation for `aziden ## Client Factory -Azure NetApp Files modules consist of one or more clients. We provide a client factory which could be used to create any client in this module. +Azure NetApp Files module consists of one or more clients. We provide a client factory which could be used to create any client in this module. ```go clientFactory, err := armnetapp.NewClientFactory(, cred, nil) From 5b6104ccffcbbeda44dae74100c5a633a9af97d9 Mon Sep 17 00:00:00 2001 From: Alancere <804873052@qq.com> Date: Thu, 23 Mar 2023 17:34:41 +0800 Subject: [PATCH 7/7] fix --- sdk/resourcemanager/netapp/armnetapp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resourcemanager/netapp/armnetapp/README.md b/sdk/resourcemanager/netapp/armnetapp/README.md index 93246b54d62e..e4b5a4e850c5 100644 --- a/sdk/resourcemanager/netapp/armnetapp/README.md +++ b/sdk/resourcemanager/netapp/armnetapp/README.md @@ -49,7 +49,7 @@ options := arm.ClientOptions { Cloud: cloud.AzureChina, }, } -client, err := armnetapp.NewClientFactory(, cred, &options) +clientFactory, err := armnetapp.NewClientFactory(, cred, &options) ``` ## Clients