diff --git a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md index d478f074ffeb..512288e6ecd4 100644 --- a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md +++ b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md @@ -1,5 +1,44 @@ # Release History +## 4.0.0 (2023-01-30) +### 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 +- Struct `VaultsClientListResponse` 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 `BackupsClientRestoreFilesResponse` +- New struct `BreakFileLocksRequest` +- New struct `ManagedServiceIdentity` +- New struct `VolumeRelocationProperties` +- New struct `VolumesClientBreakFileLocksResponse` +- 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 deleted file mode 100644 index eafd6e6aff11..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go +++ /dev/null @@ -1,81 +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/Backups_Account_List.json -func ExampleAccountBackupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewAccountBackupsClient("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 - } - } -} - -// 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 -func ExampleAccountBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewAccountBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRG", "account1", "backup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_Account_Delete.json -func ExampleAccountBackupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewAccountBackupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "resourceGroup", "accountName", "backupName", 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/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 deleted file mode 100644 index ee7c8d130371..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go +++ /dev/null @@ -1,170 +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/azcore/to" - "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/Accounts_List.json -func ExampleAccountsClient_NewListBySubscriptionPager() { - 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) - } - pager := client.NewListBySubscriptionPager(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 - } - } -} - -// 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 -func ExampleAccountsClient_Get() { - 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) - } - res, err := client.Get(ctx, "myRG", "account1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Accounts_CreateOrUpdate.json -func ExampleAccountsClient_BeginCreateOrUpdate() { - 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{ - ActiveDirectories: []*armnetapp.ActiveDirectory{ - { - 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"), - Password: to.Ptr("ad_password"), - Site: to.Ptr("SiteName"), - SmbServerName: to.Ptr("SMBServer"), - Username: to.Ptr("ad_user_name"), - }}, - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleAccountsClient_BeginDelete() { - 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.BeginDelete(ctx, "myRG", "account1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Accounts_Update.json -func ExampleAccountsClient_BeginUpdate() { - 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.BeginUpdate(ctx, "myRG", "account1", armnetapp.AccountPatch{ - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleAccountsClient_BeginRenewCredentials() { - 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.BeginRenewCredentials(ctx, "myRG", "account1", 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/autorest.md b/sdk/resourcemanager/netapp/armnetapp/autorest.md index f9a4dc238fbe..08edbab5797a 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 +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/netapp/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/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 deleted file mode 100644 index 67a879aa0cc7..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go +++ /dev/null @@ -1,144 +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/azcore/to" - "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/BackupPolicies_List.json -func ExampleBackupPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("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 - } - } -} - -// 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 -func ExampleBackupPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRG", "account1", "backupPolicyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/BackupPolicies_Create.json -func ExampleBackupPoliciesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicy{ - Location: to.Ptr("westus"), - Properties: &armnetapp.BackupPolicyProperties{ - DailyBackupsToKeep: to.Ptr[int32](10), - Enabled: to.Ptr(true), - MonthlyBackupsToKeep: to.Ptr[int32](10), - WeeklyBackupsToKeep: to.Ptr[int32](10), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleBackupPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicyPatch{ - Location: to.Ptr("westus"), - Properties: &armnetapp.BackupPolicyProperties{ - DailyBackupsToKeep: to.Ptr[int32](5), - Enabled: to.Ptr(false), - MonthlyBackupsToKeep: to.Ptr[int32](10), - WeeklyBackupsToKeep: to.Ptr[int32](10), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleBackupPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewBackupPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "resourceGroup", "accountName", "backupPolicyName", 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/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 deleted file mode 100644 index 0914c0c868a4..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go +++ /dev/null @@ -1,171 +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/azcore/to" - "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/Volumes_BackupStatus.json -func ExampleBackupsClient_GetStatus() { - 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) - } - res, err := client.GetStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_RestoreStatus.json -func ExampleBackupsClient_GetVolumeRestoreStatus() { - 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) - } - res, err := client.GetVolumeRestoreStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_List.json -func ExampleBackupsClient_NewListPager() { - 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) - } - pager := client.NewListPager("myRG", "account1", "pool1", "volume1", 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 - } - } -} - -// 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 -func ExampleBackupsClient_Get() { - 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) - } - res, err := client.Get(ctx, "myRG", "account1", "pool1", "volume1", "backup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Backups_Create.json -func ExampleBackupsClient_BeginCreate() { - 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.BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.Backup{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.BackupProperties{ - Label: to.Ptr("myLabel"), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleBackupsClient_BeginUpdate() { - 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.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupPatch{}, &armnetapp.BackupsClientBeginUpdateOptions{}) - 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleBackupsClient_BeginDelete() { - 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.BeginDelete(ctx, "resourceGroup", "accountName", "poolName", "volumeName", "backupName", 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..1c383a7e7f28 100644 --- a/sdk/resourcemanager/netapp/armnetapp/go.mod +++ b/sdk/resourcemanager/netapp/armnetapp/go.mod @@ -1,21 +1,13 @@ -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 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 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/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 + github.com/davecgh/go-spew v1.1.1 // 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 + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/netapp/armnetapp/go.sum b/sdk/resourcemanager/netapp/armnetapp/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/netapp/armnetapp/go.sum +++ b/sdk/resourcemanager/netapp/armnetapp/go.sum @@ -1,33 +1,15 @@ 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/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/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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.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= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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 deleted file mode 100644 index 6dd278df4e6e..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/operations_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/OperationList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(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/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 deleted file mode 100644 index 79d77f12a576..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go +++ /dev/null @@ -1,135 +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/azcore/to" - "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/Pools_List.json -func ExamplePoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewPoolsClient("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 - } - } -} - -// 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 -func ExamplePoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewPoolsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRG", "account1", "pool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Pools_CreateOrUpdate.json -func ExamplePoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewPoolsClient("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", "pool1", armnetapp.CapacityPool{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.PoolProperties{ - QosType: to.Ptr(armnetapp.QosTypeAuto), - ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - Size: to.Ptr[int64](4398046511104), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExamplePoolsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewPoolsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "pool1", armnetapp.CapacityPoolPatch{}, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExamplePoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewPoolsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myRG", "account1", "pool1", 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/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 deleted file mode 100644 index 23d98cd3c3ba..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go +++ /dev/null @@ -1,105 +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/azcore/to" - "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/CheckNameAvailability.json -func ExampleResourceClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewResourceClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "eastus", armnetapp.ResourceNameAvailabilityRequest{ - Name: to.Ptr("accName"), - Type: to.Ptr(armnetapp.CheckNameResourceTypes("netAppAccount")), - ResourceGroup: to.Ptr("myRG"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/CheckFilePathAvailability.json -func ExampleResourceClient_CheckFilePathAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewResourceClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/CheckQuotaAvailability.json -func ExampleResourceClient_CheckQuotaAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewResourceClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckQuotaAvailability(ctx, "eastus", armnetapp.QuotaAvailabilityRequest{ - Name: to.Ptr("resource1"), - Type: to.Ptr(armnetapp.CheckQuotaNameResourceTypesMicrosoftNetAppNetAppAccounts), - ResourceGroup: to.Ptr("myRG"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/RegionInfo.json -func ExampleResourceClient_QueryRegionInfo() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewResourceClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.QueryRegionInfo(ctx, "eastus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 deleted file mode 100644 index 2897a1d6f831..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go +++ /dev/null @@ -1,60 +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/QuotaLimits_List.json -func ExampleResourceQuotaLimitsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewResourceQuotaLimitsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("eastus", 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 - } - } -} - -// 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 -func ExampleResourceQuotaLimitsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewResourceQuotaLimitsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "eastus", "totalCoolAccessVolumesPerSubscription", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 deleted file mode 100644 index 60f252ef2239..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go +++ /dev/null @@ -1,195 +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/azcore/to" - "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/SnapshotPolicies_List.json -func ExampleSnapshotPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("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 - } - } -} - -// 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 -func ExampleSnapshotPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRG", "account1", "snapshotPolicyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/SnapshotPolicies_Create.json -func ExampleSnapshotPoliciesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "myRG", "account1", "snapshotPolicyName", armnetapp.SnapshotPolicy{ - 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), - }, - WeeklySchedule: &armnetapp.WeeklySchedule{ - Day: to.Ptr("Wednesday"), - Hour: to.Ptr[int32](14), - Minute: to.Ptr[int32](45), - SnapshotsToKeep: to.Ptr[int32](3), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/SnapshotPolicies_Update.json -func ExampleSnapshotPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "myRG", "account1", "snapshotPolicyName", armnetapp.SnapshotPolicyPatch{ - 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), - }, - WeeklySchedule: &armnetapp.WeeklySchedule{ - Day: to.Ptr("Wednesday"), - Hour: to.Ptr[int32](14), - Minute: to.Ptr[int32](45), - SnapshotsToKeep: to.Ptr[int32](3), - }, - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleSnapshotPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "resourceGroup", "accountName", "snapshotPolicyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/SnapshotPolicies_ListVolumes.json -func ExampleSnapshotPoliciesClient_ListVolumes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotPoliciesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListVolumes(ctx, "myRG", "account1", "snapshotPolicyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 deleted file mode 100644 index 5d008df17787..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go +++ /dev/null @@ -1,153 +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/azcore/to" - "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/Snapshots_List.json -func ExampleSnapshotsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myRG", "account1", "pool1", "volume1", 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 - } - } -} - -// 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 -func ExampleSnapshotsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_Create.json -func ExampleSnapshotsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", 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{ - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_Update.json -func ExampleSnapshotsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", 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]interface{}{}, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleSnapshotsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Snapshots_SingleFileRestore.json -func ExampleSnapshotsClient_BeginRestoreFiles() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSnapshotsClient("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", "snapshot1", armnetapp.SnapshotRestoreFiles{ - FilePaths: []*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/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 deleted file mode 100644 index 629a6c2fd149..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go +++ /dev/null @@ -1,159 +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/azcore/to" - "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/Subvolumes_List.json -func ExampleSubvolumesClient_NewListByVolumePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByVolumePager("myRG", "account1", "pool1", "volume1", 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 - } - } -} - -// 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 -func ExampleSubvolumesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Subvolumes_Create.json -func ExampleSubvolumesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", 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{ - Properties: &armnetapp.SubvolumeProperties{ - Path: to.Ptr("/subvolumePath"), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleSubvolumesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", 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{ - Properties: &armnetapp.SubvolumePatchParams{ - Path: to.Ptr("/subvolumePath"), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleSubvolumesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Subvolumes_Metadata.json -func ExampleSubvolumesClient_BeginGetMetadata() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewSubvolumesClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginGetMetadata(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", 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) - } - // TODO: use response item - _ = res -} 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 deleted file mode 100644 index 7b8cceacaa36..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go +++ /dev/null @@ -1,153 +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/azcore/to" - "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/VolumeGroups_List.json -func ExampleVolumeGroupsClient_NewListByNetAppAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVolumeGroupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByNetAppAccountPager("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 - } - } -} - -// 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 -func ExampleVolumeGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVolumeGroupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRG", "account1", "group1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeGroups_Create.json -func ExampleVolumeGroupsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVolumeGroupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myRG", "account1", "group1", armnetapp.VolumeGroupDetails{ - Location: to.Ptr("westus"), - Properties: &armnetapp.VolumeGroupProperties{ - GroupMetaData: &armnetapp.VolumeGroupMetaData{ - ApplicationIdentifier: to.Ptr("DEV"), - ApplicationType: to.Ptr(armnetapp.ApplicationTypeSAPHANA), - DeploymentSpecID: to.Ptr("fb04dbeb-005d-2703-197e-6208dfadb5d9"), - GroupDescription: to.Ptr("Volume group"), - }, - Volumes: []*armnetapp.VolumeGroupVolumeProperties{ - { - Name: to.Ptr("testVol1"), - 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"), - 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("testVol2"), - 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"), - 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("testVol3"), - 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"), - 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"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeGroups_Delete.json -func ExampleVolumeGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVolumeGroupsClient("D633CC2E-722B-4AE1-B636-BBD9E4C60ED9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myRG", "account1", "group1", 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/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 deleted file mode 100644 index 9927b5d40278..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go +++ /dev/null @@ -1,139 +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/azcore/to" - "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/VolumeQuotaRules_List.json -func ExampleVolumeQuotaRulesClient_NewListByVolumePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByVolumePager("myRG", "account-9957", "pool-5210", "volume-6387", 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 - } - } -} - -// 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 -func ExampleVolumeQuotaRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", 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) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/VolumeQuotaRules_Create.json -func ExampleVolumeQuotaRulesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", 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{ - Location: to.Ptr("westus"), - Properties: &armnetapp.VolumeQuotaRulesProperties{ - QuotaSizeInKiBs: to.Ptr[int64](100005), - QuotaTarget: to.Ptr("1821"), - QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleVolumeQuotaRulesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", 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{ - Properties: &armnetapp.VolumeQuotaRulesProperties{ - QuotaSizeInKiBs: to.Ptr[int64](100009), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleVolumeQuotaRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armnetapp.NewVolumeQuotaRulesClient("5275316f-a498-48d6-b324-2cbfdc4311b9", 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) - 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/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 deleted file mode 100644 index bd928ef42d61..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go +++ /dev/null @@ -1,444 +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/azcore/to" - "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/Volumes_List.json -func ExampleVolumesClient_NewListPager() { - 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) - } - pager := client.NewListPager("myRG", "account1", "pool1", 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 - } - } -} - -// 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 -func ExampleVolumesClient_Get() { - 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) - } - res, err := client.Get(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_CreateOrUpdate.json -func ExampleVolumesClient_BeginCreateOrUpdate() { - 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.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), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleVolumesClient_BeginUpdate() { - 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.BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.VolumePatch{}, 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) - } - // TODO: use response item - _ = res -} - -// 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 -func ExampleVolumesClient_BeginDelete() { - 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.BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginDeleteOptions{ForceDelete: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_Revert.json -func ExampleVolumesClient_BeginRevert() { - 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.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 { - 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/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ResetCifsPassword.json -func ExampleVolumesClient_BeginResetCifsPassword() { - 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.BeginResetCifsPassword(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_BreakReplication.json -func ExampleVolumesClient_BeginBreakReplication() { - 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.BeginBreakReplication(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginBreakReplicationOptions{Body: &armnetapp.BreakReplicationRequest{ - ForceBreakReplication: to.Ptr(false), - }, - }) - 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/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ReestablishReplication.json -func ExampleVolumesClient_BeginReestablishReplication() { - 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.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 { - 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/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ReplicationStatus.json -func ExampleVolumesClient_ReplicationStatus() { - 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) - } - res, err := client.ReplicationStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ListReplications.json -func ExampleVolumesClient_NewListReplicationsPager() { - 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) - } - pager := client.NewListReplicationsPager("myRG", "account1", "pool1", "volume1", 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 - } - } -} - -// 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 -func ExampleVolumesClient_BeginResyncReplication() { - 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.BeginResyncReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_DeleteReplication.json -func ExampleVolumesClient_BeginDeleteReplication() { - 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.BeginDeleteReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_AuthorizeReplication.json -func ExampleVolumesClient_BeginAuthorizeReplication() { - 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.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 { - 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/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_ReInitializeReplication.json -func ExampleVolumesClient_BeginReInitializeReplication() { - 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.BeginReInitializeReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_PoolChange.json -func ExampleVolumesClient_BeginPoolChange() { - 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.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 { - 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/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_Relocate.json -func ExampleVolumesClient_BeginRelocate() { - 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.BeginRelocate(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginRelocateOptions{Body: &armnetapp.RelocateVolumeRequest{}}) - 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/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_FinalizeRelocation.json -func ExampleVolumesClient_BeginFinalizeRelocation() { - 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.BeginFinalizeRelocation(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-05-01/examples/Volumes_RevertRelocation.json -func ExampleVolumesClient_BeginRevertRelocation() { - 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.BeginRevertRelocation(ctx, "myRG", "account1", "pool1", "volume1", 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) - } -}