From 7e782576c04302cd4f11a75255aceb5d61437ff0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 5 Aug 2022 01:48:05 +0000 Subject: [PATCH] CodeGen from PR 19357 in Azure/azure-rest-api-specs Merge 3cf9857aea480dc8186d148ee0e916664595d88b into 1dd7fa1577bab1b9ca6075ec0d0a19db6373bd11 --- .../storage/armstorage/CHANGELOG.md | 56 + ..._accounts_client.go => accounts_client.go} | 75 +- .../storage/armstorage/autorest.md | 6 +- ...ers_client.go => blobcontainers_client.go} | 71 +- ...ent.go => blobinventorypolicies_client.go} | 17 +- ...vices_client.go => blobservices_client.go} | 13 +- ...zz_generated_constants.go => constants.go} | 115 +- ...ts_client.go => deletedaccounts_client.go} | 9 +- ...s_client.go => encryptionscopes_client.go} | 17 +- ...vices_client.go => fileservices_client.go} | 13 +- ...eshares_client.go => fileshares_client.go} | 29 +- sdk/resourcemanager/storage/armstorage/go.mod | 4 +- ...alusers_client.go => localusers_client.go} | 25 +- ...client.go => managementpolicies_client.go} | 13 +- .../{zz_generated_models.go => models.go} | 50 +- .../storage/armstorage/models_serde.go | 6654 +++++++++++++++++ ...go => objectreplicationpolicies_client.go} | 17 +- ...rations_client.go => operations_client.go} | 5 +- ...o => privateendpointconnections_client.go} | 17 +- ...ient.go => privatelinkresources_client.go} | 5 +- ...erated_queue_client.go => queue_client.go} | 21 +- ...ices_client.go => queueservices_client.go} | 13 +- ...ed_response_types.go => response_types.go} | 1 + ...enerated_skus_client.go => skus_client.go} | 5 +- ...erated_table_client.go => table_client.go} | 45 +- ...ices_client.go => tableservices_client.go} | 13 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...ated_usages_client.go => usages_client.go} | 5 +- ...ated_example_blobcontainers_client_test.go | 391 - ...ample_blobinventorypolicies_client_test.go | 177 - ...erated_example_blobservices_client_test.go | 98 - ...ted_example_deletedaccounts_client_test.go | 63 - ...ed_example_encryptionscopes_client_test.go | 122 - ...erated_example_fileservices_client_test.go | 136 - ...enerated_example_fileshares_client_test.go | 214 - ...enerated_example_localusers_client_test.go | 179 - ..._example_managementpolicies_client_test.go | 160 - ...e_objectreplicationpolicies_client_test.go | 127 - ...enerated_example_operations_client_test.go | 41 - ..._privateendpointconnections_client_test.go | 119 - ...xample_privatelinkresources_client_test.go | 39 - .../ze_generated_example_queue_client_test.go | 137 - ...rated_example_queueservices_client_test.go | 136 - .../ze_generated_example_skus_client_test.go | 41 - ...ted_example_storageaccounts_client_test.go | 458 -- .../ze_generated_example_table_client_test.go | 133 - ...rated_example_tableservices_client_test.go | 136 - ...ze_generated_example_usages_client_test.go | 42 - .../armstorage/zz_generated_models_serde.go | 1551 ---- 49 files changed, 7021 insertions(+), 4794 deletions(-) rename sdk/resourcemanager/storage/armstorage/{zz_generated_accounts_client.go => accounts_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_blobcontainers_client.go => blobcontainers_client.go} (96%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_blobinventorypolicies_client.go => blobinventorypolicies_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_blobservices_client.go => blobservices_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_constants.go => constants.go} (92%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_deletedaccounts_client.go => deletedaccounts_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_encryptionscopes_client.go => encryptionscopes_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_fileservices_client.go => fileservices_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_fileshares_client.go => fileshares_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_localusers_client.go => localusers_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_managementpolicies_client.go => managementpolicies_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_models.go => models.go} (99%) create mode 100644 sdk/resourcemanager/storage/armstorage/models_serde.go rename sdk/resourcemanager/storage/armstorage/{zz_generated_objectreplicationpolicies_client.go => objectreplicationpolicies_client.go} (98%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_operations_client.go => operations_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_privateendpointconnections_client.go => privateendpointconnections_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_privatelinkresources_client.go => privatelinkresources_client.go} (98%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_queue_client.go => queue_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_queueservices_client.go => queueservices_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_skus_client.go => skus_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_table_client.go => table_client.go} (93%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_tableservices_client.go => tableservices_client.go} (97%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) rename sdk/resourcemanager/storage/armstorage/{zz_generated_usages_client.go => usages_client.go} (97%) delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_blobcontainers_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_blobinventorypolicies_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_blobservices_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_deletedaccounts_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_encryptionscopes_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_fileservices_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_fileshares_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_localusers_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_managementpolicies_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_objectreplicationpolicies_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_privateendpointconnections_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_privatelinkresources_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_queue_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_queueservices_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_skus_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_storageaccounts_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_table_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_tableservices_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/ze_generated_example_usages_client_test.go delete mode 100644 sdk/resourcemanager/storage/armstorage/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/storage/armstorage/CHANGELOG.md b/sdk/resourcemanager/storage/armstorage/CHANGELOG.md index 54f601b066be..f349e8d3ae0c 100644 --- a/sdk/resourcemanager/storage/armstorage/CHANGELOG.md +++ b/sdk/resourcemanager/storage/armstorage/CHANGELOG.md @@ -1,5 +1,61 @@ # Release History +## 2.0.0 (2022-08-05) +### Breaking Changes + +- Function `*TableClient.Create` parameter(s) have been changed from `(context.Context, string, string, string, *TableClientCreateOptions)` to `(context.Context, string, string, string, Table, *TableClientCreateOptions)` +- Function `*TableClient.Update` parameter(s) have been changed from `(context.Context, string, string, string, *TableClientUpdateOptions)` to `(context.Context, string, string, string, Table, *TableClientUpdateOptions)` +- Function `*BlobContainersClient.CreateOrUpdateImmutabilityPolicy` parameter(s) have been changed from `(context.Context, string, string, string, *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions)` to `(context.Context, string, string, string, ImmutabilityPolicy, *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions)` +- Type of `CorsRule.AllowedMethods` has been changed from `[]*CorsRuleAllowedMethodsItem` to `[]*AllowedMethods` +- Type of `ActiveDirectoryProperties.AccountType` has been changed from `*ActiveDirectoryPropertiesAccountType` to `*AccountType` +- Type of `BlobContainersClientLeaseOptions.Parameters` has been changed from `*LeaseContainerRequest` to `*LeaseContainerRequestAutoGenerated` +- Const `CorsRuleAllowedMethodsItemPOST` has been removed +- Const `LeaseContainerRequestActionRelease` has been removed +- Const `CorsRuleAllowedMethodsItemHEAD` has been removed +- Const `CorsRuleAllowedMethodsItemMERGE` has been removed +- Const `CorsRuleAllowedMethodsItemPATCH` has been removed +- Const `ActiveDirectoryPropertiesAccountTypeUser` has been removed +- Const `LeaseContainerRequestActionAcquire` has been removed +- Const `CorsRuleAllowedMethodsItemOPTIONS` has been removed +- Const `CorsRuleAllowedMethodsItemDELETE` has been removed +- Const `CorsRuleAllowedMethodsItemPUT` has been removed +- Const `LeaseContainerRequestActionBreak` has been removed +- Const `LeaseContainerRequestActionRenew` has been removed +- Const `LeaseContainerRequestActionChange` has been removed +- Const `ActiveDirectoryPropertiesAccountTypeComputer` has been removed +- Const `CorsRuleAllowedMethodsItemGET` has been removed +- Function `PossibleLeaseContainerRequestActionValues` has been removed +- Function `PossibleActiveDirectoryPropertiesAccountTypeValues` has been removed +- Function `PossibleCorsRuleAllowedMethodsItemValues` has been removed +- Struct `LeaseContainerRequest` has been removed +- Field `Parameters` of struct `BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions` has been removed +- Field `Parameters` of struct `TableClientUpdateOptions` has been removed +- Field `Parameters` of struct `TableClientCreateOptions` has been removed + +### Features Added + +- New const `AllowedMethodsOPTIONS` +- New const `AllowedMethodsDELETE` +- New const `AllowedMethodsPATCH` +- New const `LeaseContainerRequestBreak` +- New const `AllowedMethodsHEAD` +- New const `AllowedMethodsPUT` +- New const `LeaseContainerRequestRenew` +- New const `AllowedMethodsMERGE` +- New const `AllowedMethodsPOST` +- New const `DirectoryServiceOptionsAADKERB` +- New const `LeaseContainerRequestAcquire` +- New const `LeaseContainerRequestRelease` +- New const `AccountTypeUser` +- New const `AllowedMethodsGET` +- New const `AccountTypeComputer` +- New const `LeaseContainerRequestChange` +- New function `PossibleAccountTypeValues() []AccountType` +- New function `PossibleAllowedMethodsValues() []AllowedMethods` +- New function `PossibleLeaseContainerRequestValues() []LeaseContainerRequest` +- New struct `LeaseContainerRequestAutoGenerated` + + ## 1.0.0 (2022-05-16) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_accounts_client.go b/sdk/resourcemanager/storage/armstorage/accounts_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_accounts_client.go rename to sdk/resourcemanager/storage/armstorage/accounts_client.go index ebbd1e931631..a6524f6b560a 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_accounts_client.go +++ b/sdk/resourcemanager/storage/armstorage/accounts_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, // BeginAbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -78,7 +79,7 @@ func (client *AccountsClient) BeginAbortHierarchicalNamespaceMigration(ctx conte // AbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 func (client *AccountsClient) abortHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*http.Response, error) { req, err := client.abortHierarchicalNamespaceMigrationCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -114,7 +115,7 @@ func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,7 +123,7 @@ func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(c // CheckNameAvailability - Checks that the storage account name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. // options - AccountsClientCheckNameAvailabilityOptions contains the optional parameters for the AccountsClient.CheckNameAvailability @@ -154,7 +155,7 @@ func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, accountName) @@ -174,7 +175,7 @@ func (client *AccountsClient) checkNameAvailabilityHandleResponse(resp *http.Res // will be updated. If an account is already created and a subsequent create or update request is issued with the exact same // set of properties, the request will succeed. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -197,7 +198,7 @@ func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName // will be updated. If an account is already created and a subsequent create or update request is issued with the exact same // set of properties, the request will succeed. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 func (client *AccountsClient) create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, parameters, options) if err != nil { @@ -233,7 +234,7 @@ func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -241,7 +242,7 @@ func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceG // Delete - Deletes a storage account in Microsoft Azure. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -281,7 +282,7 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -290,7 +291,7 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG // from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The // secondary cluster will become primary after failover. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -313,7 +314,7 @@ func (client *AccountsClient) BeginFailover(ctx context.Context, resourceGroupNa // from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The // secondary cluster will become primary after failover. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 func (client *AccountsClient) failover(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginFailoverOptions) (*http.Response, error) { req, err := client.failoverCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -349,7 +350,7 @@ func (client *AccountsClient) failoverCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -357,7 +358,7 @@ func (client *AccountsClient) failoverCreateRequest(ctx context.Context, resourc // GetProperties - Returns the properties for the specified storage account including but not limited to name, SKU name, location, // and account status. The ListKeys operation should be used to retrieve storage keys. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -397,7 +398,7 @@ func (client *AccountsClient) getPropertiesCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } @@ -417,7 +418,7 @@ func (client *AccountsClient) getPropertiesHandleResponse(resp *http.Response) ( // BeginHierarchicalNamespaceMigration - Live Migration of storage account to enable Hns // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -442,7 +443,7 @@ func (client *AccountsClient) BeginHierarchicalNamespaceMigration(ctx context.Co // HierarchicalNamespaceMigration - Live Migration of storage account to enable Hns // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 func (client *AccountsClient) hierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*http.Response, error) { req, err := client.hierarchicalNamespaceMigrationCreateRequest(ctx, resourceGroupName, accountName, requestType, options) if err != nil { @@ -478,7 +479,7 @@ func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") reqQP.Set("requestType", requestType) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -488,7 +489,7 @@ func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx co // NewListPager - Lists all the storage accounts available under the subscription. Note that storage keys are not returned; // use the ListKeys operation for this. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // options - AccountsClientListOptions contains the optional parameters for the AccountsClient.List method. func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AccountsClientListResponse]{ @@ -530,7 +531,7 @@ func (client *AccountsClient) listCreateRequest(ctx context.Context, options *Ac return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -547,7 +548,7 @@ func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsC // ListAccountSAS - List SAS credentials of a storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -588,7 +589,7 @@ func (client *AccountsClient) listAccountSASCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -606,7 +607,7 @@ func (client *AccountsClient) listAccountSASHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Lists all the storage accounts available under the given resource group. Note that storage // keys are not returned; use the ListKeys operation for this. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.ListByResourceGroup // method. @@ -654,7 +655,7 @@ func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -671,7 +672,7 @@ func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Respo // ListKeys - Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -711,7 +712,7 @@ func (client *AccountsClient) listKeysCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", "kerb") } @@ -731,7 +732,7 @@ func (client *AccountsClient) listKeysHandleResponse(resp *http.Response) (Accou // ListServiceSAS - List service SAS credentials of a specific resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -772,7 +773,7 @@ func (client *AccountsClient) listServiceSASCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -789,7 +790,7 @@ func (client *AccountsClient) listServiceSASHandleResponse(resp *http.Response) // RegenerateKey - Regenerates one of the access keys or Kerberos keys for the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -830,7 +831,7 @@ func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateKey) @@ -847,7 +848,7 @@ func (client *AccountsClient) regenerateKeyHandleResponse(resp *http.Response) ( // BeginRestoreBlobRanges - Restore blobs in the specified blob ranges // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -870,7 +871,7 @@ func (client *AccountsClient) BeginRestoreBlobRanges(ctx context.Context, resour // RestoreBlobRanges - Restore blobs in the specified blob ranges // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 func (client *AccountsClient) restoreBlobRanges(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*http.Response, error) { req, err := client.restoreBlobRangesCreateRequest(ctx, resourceGroupName, accountName, parameters, options) if err != nil { @@ -906,7 +907,7 @@ func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -914,7 +915,7 @@ func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context // RevokeUserDelegationKeys - Revoke user delegation keys. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -955,7 +956,7 @@ func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -968,7 +969,7 @@ func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context. // want to change the storage account keys, use the regenerate keys operation. The // location and name of the storage account cannot be changed after creation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -1009,7 +1010,7 @@ func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/storage/armstorage/autorest.md b/sdk/resourcemanager/storage/armstorage/autorest.md index d7741d8c20c9..7c4d603140f5 100644 --- a/sdk/resourcemanager/storage/armstorage/autorest.md +++ b/sdk/resourcemanager/storage/armstorage/autorest.md @@ -5,10 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/storage/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/storage/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/storage/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/storage/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0 modelerfour: seal-single-value-enum-by-default: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_blobcontainers_client.go b/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go similarity index 96% rename from sdk/resourcemanager/storage/armstorage/zz_generated_blobcontainers_client.go rename to sdk/resourcemanager/storage/armstorage/blobcontainers_client.go index 1b638fd4db9f..74a40ec04d8d 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_blobcontainers_client.go +++ b/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -57,7 +58,7 @@ func NewBlobContainersClient(subscriptionID string, credential azcore.TokenCrede // ClearLegalHold - Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold // clears out only the specified tags in the request. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -106,7 +107,7 @@ func (client *BlobContainersClient) clearLegalHoldCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, legalHold) @@ -125,7 +126,7 @@ func (client *BlobContainersClient) clearLegalHoldHandleResponse(resp *http.Resp // metadata and properties for that container. It does not include a list of the blobs // contained by the container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -173,7 +174,7 @@ func (client *BlobContainersClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, blobContainer) @@ -191,17 +192,18 @@ func (client *BlobContainersClient) createHandleResponse(resp *http.Response) (B // CreateOrUpdateImmutabilityPolicy - Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given // but not required for this operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. // containerName - The name of the blob container within the specified storage account. Blob container names must be between // 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every // dash (-) character must be immediately preceded and followed by a letter or number. +// parameters - The ImmutabilityPolicy Properties that will be created or updated to a blob container. // options - BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.CreateOrUpdateImmutabilityPolicy // method. -func (client *BlobContainersClient) CreateOrUpdateImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions) (BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse, error) { - req, err := client.createOrUpdateImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, options) +func (client *BlobContainersClient) CreateOrUpdateImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters ImmutabilityPolicy, options *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions) (BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse, error) { + req, err := client.createOrUpdateImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, parameters, options) if err != nil { return BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}, err } @@ -216,7 +218,7 @@ func (client *BlobContainersClient) CreateOrUpdateImmutabilityPolicy(ctx context } // createOrUpdateImmutabilityPolicyCreateRequest creates the CreateOrUpdateImmutabilityPolicy request. -func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions) (*policy.Request, error) { +func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters ImmutabilityPolicy, options *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -240,16 +242,13 @@ func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil + return req, runtime.MarshalAsJSON(req, parameters) } // createOrUpdateImmutabilityPolicyHandleResponse handles the CreateOrUpdateImmutabilityPolicy response. @@ -266,7 +265,7 @@ func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyHandleRespon // Delete - Deletes specified container under its account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -313,7 +312,7 @@ func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -323,7 +322,7 @@ func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, res // policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked // container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -375,7 +374,7 @@ func (client *BlobContainersClient) deleteImmutabilityPolicyCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -397,7 +396,7 @@ func (client *BlobContainersClient) deleteImmutabilityPolicyHandleResponse(resp // ExtendImmutabilityPolicy - Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action // allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -448,7 +447,7 @@ func (client *BlobContainersClient) extendImmutabilityPolicyCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -472,7 +471,7 @@ func (client *BlobContainersClient) extendImmutabilityPolicyHandleResponse(resp // Get - Gets properties of a specified container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -519,7 +518,7 @@ func (client *BlobContainersClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -537,7 +536,7 @@ func (client *BlobContainersClient) getHandleResponse(resp *http.Response) (Blob // GetImmutabilityPolicy - Gets the existing immutability policy along with the corresponding ETag in response headers and // body. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -586,7 +585,7 @@ func (client *BlobContainersClient) getImmutabilityPolicyCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -610,7 +609,7 @@ func (client *BlobContainersClient) getImmutabilityPolicyHandleResponse(resp *ht // Lease - The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration // can be 15 to 60 seconds, or can be infinite. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -657,7 +656,7 @@ func (client *BlobContainersClient) leaseCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -678,7 +677,7 @@ func (client *BlobContainersClient) leaseHandleResponse(resp *http.Response) (Bl // NewListPager - Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation // token. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -731,7 +730,7 @@ func (client *BlobContainersClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", *options.Maxpagesize) } @@ -758,7 +757,7 @@ func (client *BlobContainersClient) listHandleResponse(resp *http.Response) (Blo // LockImmutabilityPolicy - Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy // action. ETag in If-Match is required for this operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -809,7 +808,7 @@ func (client *BlobContainersClient) lockImmutabilityPolicyCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -832,7 +831,7 @@ func (client *BlobContainersClient) lockImmutabilityPolicyHandleResponse(resp *h // enabled container. Prerequisites require a container level immutability policy either in locked or // unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -859,7 +858,7 @@ func (client *BlobContainersClient) BeginObjectLevelWorm(ctx context.Context, re // container. Prerequisites require a container level immutability policy either in locked or // unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 func (client *BlobContainersClient) objectLevelWorm(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*http.Response, error) { req, err := client.objectLevelWormCreateRequest(ctx, resourceGroupName, accountName, containerName, options) if err != nil { @@ -899,7 +898,7 @@ func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -908,7 +907,7 @@ func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Con // SetLegalHold - Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append // pattern and does not clear out the existing tags that are not specified in the request. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -957,7 +956,7 @@ func (client *BlobContainersClient) setLegalHoldCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, legalHold) @@ -975,7 +974,7 @@ func (client *BlobContainersClient) setLegalHoldHandleResponse(resp *http.Respon // Update - Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. // Update fails if the specified container doesn't already exist. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -1023,7 +1022,7 @@ func (client *BlobContainersClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, blobContainer) diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_blobinventorypolicies_client.go b/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_blobinventorypolicies_client.go rename to sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go index 9c231f2dec09..4e46332b7b0d 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_blobinventorypolicies_client.go +++ b/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewBlobInventoryPoliciesClient(subscriptionID string, credential azcore.Tok // CreateOrUpdate - Sets the blob inventory policy to the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -103,7 +104,7 @@ func (client *BlobInventoryPoliciesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) @@ -120,7 +121,7 @@ func (client *BlobInventoryPoliciesClient) createOrUpdateHandleResponse(resp *ht // Delete - Deletes the blob inventory policy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -166,7 +167,7 @@ func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +175,7 @@ func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Conte // Get - Gets the blob inventory policy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -220,7 +221,7 @@ func (client *BlobInventoryPoliciesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +238,7 @@ func (client *BlobInventoryPoliciesClient) getHandleResponse(resp *http.Response // NewListPager - Gets the blob inventory policy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -285,7 +286,7 @@ func (client *BlobInventoryPoliciesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_blobservices_client.go b/sdk/resourcemanager/storage/armstorage/blobservices_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_blobservices_client.go rename to sdk/resourcemanager/storage/armstorage/blobservices_client.go index 75bf93aa9295..204a6335f663 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_blobservices_client.go +++ b/sdk/resourcemanager/storage/armstorage/blobservices_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -57,7 +58,7 @@ func NewBlobServicesClient(subscriptionID string, credential azcore.TokenCredent // GetServiceProperties - Gets the properties of a storage account’s Blob service, including properties for Storage Analytics // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -99,7 +100,7 @@ func (client *BlobServicesClient) getServicePropertiesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +117,7 @@ func (client *BlobServicesClient) getServicePropertiesHandleResponse(resp *http. // NewListPager - List blob services of storage account. It returns a collection of one object named default. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -163,7 +164,7 @@ func (client *BlobServicesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +182,7 @@ func (client *BlobServicesClient) listHandleResponse(resp *http.Response) (BlobS // SetServiceProperties - Sets the properties of a storage account’s Blob service, including properties for Storage Analytics // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -225,7 +226,7 @@ func (client *BlobServicesClient) setServicePropertiesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_constants.go b/sdk/resourcemanager/storage/armstorage/constants.go similarity index 92% rename from sdk/resourcemanager/storage/armstorage/zz_generated_constants.go rename to sdk/resourcemanager/storage/armstorage/constants.go index adbc2d0c1890..319061c7d89b 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_constants.go +++ b/sdk/resourcemanager/storage/armstorage/constants.go @@ -5,12 +5,13 @@ // 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 armstorage const ( moduleName = "armstorage" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' @@ -71,19 +72,19 @@ func PossibleAccountStatusValues() []AccountStatus { } } -// ActiveDirectoryPropertiesAccountType - Specifies the Active Directory account type for Azure Storage. -type ActiveDirectoryPropertiesAccountType string +// AccountType - Specifies the Active Directory account type for Azure Storage. +type AccountType string const ( - ActiveDirectoryPropertiesAccountTypeComputer ActiveDirectoryPropertiesAccountType = "Computer" - ActiveDirectoryPropertiesAccountTypeUser ActiveDirectoryPropertiesAccountType = "User" + AccountTypeComputer AccountType = "Computer" + AccountTypeUser AccountType = "User" ) -// PossibleActiveDirectoryPropertiesAccountTypeValues returns the possible values for the ActiveDirectoryPropertiesAccountType const type. -func PossibleActiveDirectoryPropertiesAccountTypeValues() []ActiveDirectoryPropertiesAccountType { - return []ActiveDirectoryPropertiesAccountType{ - ActiveDirectoryPropertiesAccountTypeComputer, - ActiveDirectoryPropertiesAccountTypeUser, +// PossibleAccountTypeValues returns the possible values for the AccountType const type. +func PossibleAccountTypeValues() []AccountType { + return []AccountType{ + AccountTypeComputer, + AccountTypeUser, } } @@ -103,6 +104,33 @@ func PossibleAllowedCopyScopeValues() []AllowedCopyScope { } } +type AllowedMethods string + +const ( + AllowedMethodsDELETE AllowedMethods = "DELETE" + AllowedMethodsGET AllowedMethods = "GET" + AllowedMethodsHEAD AllowedMethods = "HEAD" + AllowedMethodsMERGE AllowedMethods = "MERGE" + AllowedMethodsOPTIONS AllowedMethods = "OPTIONS" + AllowedMethodsPATCH AllowedMethods = "PATCH" + AllowedMethodsPOST AllowedMethods = "POST" + AllowedMethodsPUT AllowedMethods = "PUT" +) + +// PossibleAllowedMethodsValues returns the possible values for the AllowedMethods const type. +func PossibleAllowedMethodsValues() []AllowedMethods { + return []AllowedMethods{ + AllowedMethodsDELETE, + AllowedMethodsGET, + AllowedMethodsHEAD, + AllowedMethodsMERGE, + AllowedMethodsOPTIONS, + AllowedMethodsPATCH, + AllowedMethodsPOST, + AllowedMethodsPUT, + } +} + type BlobInventoryPolicyName string const ( @@ -158,33 +186,6 @@ func PossibleBypassValues() []Bypass { } } -type CorsRuleAllowedMethodsItem string - -const ( - CorsRuleAllowedMethodsItemDELETE CorsRuleAllowedMethodsItem = "DELETE" - CorsRuleAllowedMethodsItemGET CorsRuleAllowedMethodsItem = "GET" - CorsRuleAllowedMethodsItemHEAD CorsRuleAllowedMethodsItem = "HEAD" - CorsRuleAllowedMethodsItemMERGE CorsRuleAllowedMethodsItem = "MERGE" - CorsRuleAllowedMethodsItemOPTIONS CorsRuleAllowedMethodsItem = "OPTIONS" - CorsRuleAllowedMethodsItemPATCH CorsRuleAllowedMethodsItem = "PATCH" - CorsRuleAllowedMethodsItemPOST CorsRuleAllowedMethodsItem = "POST" - CorsRuleAllowedMethodsItemPUT CorsRuleAllowedMethodsItem = "PUT" -) - -// PossibleCorsRuleAllowedMethodsItemValues returns the possible values for the CorsRuleAllowedMethodsItem const type. -func PossibleCorsRuleAllowedMethodsItemValues() []CorsRuleAllowedMethodsItem { - return []CorsRuleAllowedMethodsItem{ - CorsRuleAllowedMethodsItemDELETE, - CorsRuleAllowedMethodsItemGET, - CorsRuleAllowedMethodsItemHEAD, - CorsRuleAllowedMethodsItemMERGE, - CorsRuleAllowedMethodsItemOPTIONS, - CorsRuleAllowedMethodsItemPATCH, - CorsRuleAllowedMethodsItemPOST, - CorsRuleAllowedMethodsItemPUT, - } -} - // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -259,19 +260,21 @@ func PossibleDefaultSharePermissionValues() []DefaultSharePermission { } } -// DirectoryServiceOptions - Indicates the directory service used. +// DirectoryServiceOptions - Indicates the directory service used. Note that this enum may be extended in the future. type DirectoryServiceOptions string const ( - DirectoryServiceOptionsAADDS DirectoryServiceOptions = "AADDS" - DirectoryServiceOptionsAD DirectoryServiceOptions = "AD" - DirectoryServiceOptionsNone DirectoryServiceOptions = "None" + DirectoryServiceOptionsAADDS DirectoryServiceOptions = "AADDS" + DirectoryServiceOptionsAADKERB DirectoryServiceOptions = "AADKERB" + DirectoryServiceOptionsAD DirectoryServiceOptions = "AD" + DirectoryServiceOptionsNone DirectoryServiceOptions = "None" ) // PossibleDirectoryServiceOptionsValues returns the possible values for the DirectoryServiceOptions const type. func PossibleDirectoryServiceOptionsValues() []DirectoryServiceOptions { return []DirectoryServiceOptions{ DirectoryServiceOptionsAADDS, + DirectoryServiceOptionsAADKERB, DirectoryServiceOptionsAD, DirectoryServiceOptionsNone, } @@ -562,25 +565,25 @@ func PossibleLargeFileSharesStateValues() []LargeFileSharesState { } } -// LeaseContainerRequestAction - Specifies the lease action. Can be one of the available actions. -type LeaseContainerRequestAction string +// LeaseContainerRequest - Specifies the lease action. Can be one of the available actions. +type LeaseContainerRequest string const ( - LeaseContainerRequestActionAcquire LeaseContainerRequestAction = "Acquire" - LeaseContainerRequestActionBreak LeaseContainerRequestAction = "Break" - LeaseContainerRequestActionChange LeaseContainerRequestAction = "Change" - LeaseContainerRequestActionRelease LeaseContainerRequestAction = "Release" - LeaseContainerRequestActionRenew LeaseContainerRequestAction = "Renew" + LeaseContainerRequestAcquire LeaseContainerRequest = "Acquire" + LeaseContainerRequestBreak LeaseContainerRequest = "Break" + LeaseContainerRequestChange LeaseContainerRequest = "Change" + LeaseContainerRequestRelease LeaseContainerRequest = "Release" + LeaseContainerRequestRenew LeaseContainerRequest = "Renew" ) -// PossibleLeaseContainerRequestActionValues returns the possible values for the LeaseContainerRequestAction const type. -func PossibleLeaseContainerRequestActionValues() []LeaseContainerRequestAction { - return []LeaseContainerRequestAction{ - LeaseContainerRequestActionAcquire, - LeaseContainerRequestActionBreak, - LeaseContainerRequestActionChange, - LeaseContainerRequestActionRelease, - LeaseContainerRequestActionRenew, +// PossibleLeaseContainerRequestValues returns the possible values for the LeaseContainerRequest const type. +func PossibleLeaseContainerRequestValues() []LeaseContainerRequest { + return []LeaseContainerRequest{ + LeaseContainerRequestAcquire, + LeaseContainerRequestBreak, + LeaseContainerRequestChange, + LeaseContainerRequestRelease, + LeaseContainerRequestRenew, } } diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_deletedaccounts_client.go b/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_deletedaccounts_client.go rename to sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go index 120ee2c5fcfb..7d27acf7fcc2 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_deletedaccounts_client.go +++ b/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewDeletedAccountsClient(subscriptionID string, credential azcore.TokenCred // Get - Get properties of specified deleted account resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // deletedAccountName - Name of the deleted storage account. // location - The location of the deleted storage account. // options - DeletedAccountsClientGetOptions contains the optional parameters for the DeletedAccountsClient.Get method. @@ -95,7 +96,7 @@ func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, delet return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +113,7 @@ func (client *DeletedAccountsClient) getHandleResponse(resp *http.Response) (Del // NewListPager - Lists deleted accounts under the subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // options - DeletedAccountsClientListOptions contains the optional parameters for the DeletedAccountsClient.List method. func (client *DeletedAccountsClient) NewListPager(options *DeletedAccountsClientListOptions) *runtime.Pager[DeletedAccountsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DeletedAccountsClientListResponse]{ @@ -154,7 +155,7 @@ func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_encryptionscopes_client.go b/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_encryptionscopes_client.go rename to sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go index 1d99b257265e..a2092bcb18f2 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_encryptionscopes_client.go +++ b/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewEncryptionScopesClient(subscriptionID string, credential azcore.TokenCre // Get - Returns the properties for the specified encryption scope. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -103,7 +104,7 @@ func (client *EncryptionScopesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,7 +121,7 @@ func (client *EncryptionScopesClient) getHandleResponse(resp *http.Response) (En // NewListPager - Lists all the encryption scopes available under the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -173,7 +174,7 @@ func (client *EncryptionScopesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +192,7 @@ func (client *EncryptionScopesClient) listHandleResponse(resp *http.Response) (E // Patch - Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope // does not already exist. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -239,7 +240,7 @@ func (client *EncryptionScopesClient) patchCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, encryptionScope) @@ -258,7 +259,7 @@ func (client *EncryptionScopesClient) patchHandleResponse(resp *http.Response) ( // is already created and a subsequent request is issued with different properties, the // encryption scope properties will be updated per the specified request. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -306,7 +307,7 @@ func (client *EncryptionScopesClient) putCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, encryptionScope) diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_fileservices_client.go b/sdk/resourcemanager/storage/armstorage/fileservices_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_fileservices_client.go rename to sdk/resourcemanager/storage/armstorage/fileservices_client.go index 0b75fc96ccf3..2db2defaac11 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_fileservices_client.go +++ b/sdk/resourcemanager/storage/armstorage/fileservices_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -57,7 +58,7 @@ func NewFileServicesClient(subscriptionID string, credential azcore.TokenCredent // GetServiceProperties - Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource // Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -99,7 +100,7 @@ func (client *FileServicesClient) getServicePropertiesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +117,7 @@ func (client *FileServicesClient) getServicePropertiesHandleResponse(resp *http. // List - List all file services in storage accounts // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -156,7 +157,7 @@ func (client *FileServicesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +175,7 @@ func (client *FileServicesClient) listHandleResponse(resp *http.Response) (FileS // SetServiceProperties - Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource // Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -217,7 +218,7 @@ func (client *FileServicesClient) setServicePropertiesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_fileshares_client.go b/sdk/resourcemanager/storage/armstorage/fileshares_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_fileshares_client.go rename to sdk/resourcemanager/storage/armstorage/fileshares_client.go index fe6f23865fa7..47d5da5e25a9 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_fileshares_client.go +++ b/sdk/resourcemanager/storage/armstorage/fileshares_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -58,7 +59,7 @@ func NewFileSharesClient(subscriptionID string, credential azcore.TokenCredentia // and properties for that share. It does not include a list of the files contained by // the share. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -109,7 +110,7 @@ func (client *FileSharesClient) createCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, fileShare) @@ -126,7 +127,7 @@ func (client *FileSharesClient) createHandleResponse(resp *http.Response) (FileS // Delete - Deletes specified share under its account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -173,7 +174,7 @@ func (client *FileSharesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") if options != nil && options.Include != nil { reqQP.Set("$include", *options.Include) } @@ -187,7 +188,7 @@ func (client *FileSharesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets properties of a specified share. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -234,7 +235,7 @@ func (client *FileSharesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -258,7 +259,7 @@ func (client *FileSharesClient) getHandleResponse(resp *http.Response) (FileShar // Lease - The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can // be 15 to 60 seconds, or can be infinite. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -305,7 +306,7 @@ func (client *FileSharesClient) leaseCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.XMSSnapshot != nil { req.Raw().Header["x-ms-snapshot"] = []string{*options.XMSSnapshot} @@ -331,7 +332,7 @@ func (client *FileSharesClient) leaseHandleResponse(resp *http.Response) (FileSh // NewListPager - Lists all shares. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -384,7 +385,7 @@ func (client *FileSharesClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", *options.Maxpagesize) } @@ -410,7 +411,7 @@ func (client *FileSharesClient) listHandleResponse(resp *http.Response) (FileSha // Restore - Restore a file share within a valid retention days if share soft delete is enabled // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -457,7 +458,7 @@ func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, deletedShare) @@ -466,7 +467,7 @@ func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resour // Update - Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. // Update fails if the specified share does not already exist. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -514,7 +515,7 @@ func (client *FileSharesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, fileShare) diff --git a/sdk/resourcemanager/storage/armstorage/go.mod b/sdk/resourcemanager/storage/armstorage/go.mod index b914d53269fe..c590630fde54 100644 --- a/sdk/resourcemanager/storage/armstorage/go.mod +++ b/sdk/resourcemanager/storage/armstorage/go.mod @@ -1,15 +1,15 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v2 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.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_localusers_client.go b/sdk/resourcemanager/storage/armstorage/localusers_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_localusers_client.go rename to sdk/resourcemanager/storage/armstorage/localusers_client.go index 5b7750e78863..f95a32cb76fe 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_localusers_client.go +++ b/sdk/resourcemanager/storage/armstorage/localusers_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewLocalUsersClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Create or update the properties of a local user associated with the storage account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -104,7 +105,7 @@ func (client *LocalUsersClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) @@ -121,7 +122,7 @@ func (client *LocalUsersClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the local user associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -167,7 +168,7 @@ func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,7 +176,7 @@ func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get the local user of the storage account by username. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -221,7 +222,7 @@ func (client *LocalUsersClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +239,7 @@ func (client *LocalUsersClient) getHandleResponse(resp *http.Response) (LocalUse // NewListPager - List the local users associated with the storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -285,7 +286,7 @@ func (client *LocalUsersClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,7 +303,7 @@ func (client *LocalUsersClient) listHandleResponse(resp *http.Response) (LocalUs // ListKeys - List SSH authorized keys and shared key of the local user. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -348,7 +349,7 @@ func (client *LocalUsersClient) listKeysCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +366,7 @@ func (client *LocalUsersClient) listKeysHandleResponse(resp *http.Response) (Loc // RegeneratePassword - Regenerate the local user SSH password. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -412,7 +413,7 @@ func (client *LocalUsersClient) regeneratePasswordCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_managementpolicies_client.go b/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_managementpolicies_client.go rename to sdk/resourcemanager/storage/armstorage/managementpolicies_client.go index 9f86f9d39c97..437aa0b2cd03 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_managementpolicies_client.go +++ b/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewManagementPoliciesClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Sets the managementpolicy to the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -103,7 +104,7 @@ func (client *ManagementPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) @@ -120,7 +121,7 @@ func (client *ManagementPoliciesClient) createOrUpdateHandleResponse(resp *http. // Delete - Deletes the managementpolicy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -166,14 +167,14 @@ func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets the managementpolicy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -218,7 +219,7 @@ func (client *ManagementPoliciesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_models.go b/sdk/resourcemanager/storage/armstorage/models.go similarity index 99% rename from sdk/resourcemanager/storage/armstorage/zz_generated_models.go rename to sdk/resourcemanager/storage/armstorage/models.go index ac7482697816..aab1fb10b0d6 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_models.go +++ b/sdk/resourcemanager/storage/armstorage/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -59,7 +60,8 @@ type AccountCheckNameAvailabilityParameters struct { // REQUIRED; The storage account name. Name *string `json:"name,omitempty"` - // REQUIRED; The type of resource, Microsoft.Storage/storageAccounts + // CONSTANT; The type of resource, Microsoft.Storage/storageAccounts + // Field has constant value "Microsoft.Storage/storageAccounts", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -640,27 +642,27 @@ type AccountsClientUpdateOptions struct { // ActiveDirectoryProperties - Settings properties for Active Directory (AD). type ActiveDirectoryProperties struct { - // REQUIRED; Specifies the security identifier (SID) for Azure Storage. - AzureStorageSid *string `json:"azureStorageSid,omitempty"` - // REQUIRED; Specifies the domain GUID. DomainGUID *string `json:"domainGuid,omitempty"` // REQUIRED; Specifies the primary domain that the AD DNS server is authoritative for. DomainName *string `json:"domainName,omitempty"` - // REQUIRED; Specifies the security identifier (SID). + // Specifies the Active Directory account type for Azure Storage. + AccountType *AccountType `json:"accountType,omitempty"` + + // Specifies the security identifier (SID) for Azure Storage. + AzureStorageSid *string `json:"azureStorageSid,omitempty"` + + // Specifies the security identifier (SID). DomainSid *string `json:"domainSid,omitempty"` - // REQUIRED; Specifies the Active Directory forest to get. + // Specifies the Active Directory forest to get. ForestName *string `json:"forestName,omitempty"` - // REQUIRED; Specifies the NetBIOS domain name. + // Specifies the NetBIOS domain name. NetBiosDomainName *string `json:"netBiosDomainName,omitempty"` - // Specifies the Active Directory account type for Azure Storage. - AccountType *ActiveDirectoryPropertiesAccountType `json:"accountType,omitempty"` - // Specifies the Active Directory SAMAccountName for Azure Storage. SamAccountName *string `json:"samAccountName,omitempty"` } @@ -682,10 +684,10 @@ type AzureEntityResource struct { // AzureFilesIdentityBasedAuthentication - Settings for Azure Files identity based authentication. type AzureFilesIdentityBasedAuthentication struct { - // REQUIRED; Indicates the directory service used. + // REQUIRED; Indicates the directory service used. Note that this enum may be extended in the future. DirectoryServiceOptions *DirectoryServiceOptions `json:"directoryServiceOptions,omitempty"` - // Required if choose AD. + // Required if directoryServiceOptions are AD, optional if they are AADKERB. ActiveDirectoryProperties *ActiveDirectoryProperties `json:"activeDirectoryProperties,omitempty"` // Default share permission for users using Kerberos authentication if RBAC role is not assigned. @@ -735,8 +737,6 @@ type BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions struct { // only if the immutability policy already exists. If omitted, this operation will // always be applied. IfMatch *string - // The ImmutabilityPolicy Properties that will be created or updated to a blob container. - Parameters *ImmutabilityPolicy } // BlobContainersClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.DeleteImmutabilityPolicy @@ -774,7 +774,7 @@ type BlobContainersClientGetOptions struct { // BlobContainersClientLeaseOptions contains the optional parameters for the BlobContainersClient.Lease method. type BlobContainersClientLeaseOptions struct { // Lease Container request body. - Parameters *LeaseContainerRequest + Parameters *LeaseContainerRequestAutoGenerated } // BlobContainersClientListOptions contains the optional parameters for the BlobContainersClient.List method. @@ -1175,7 +1175,7 @@ type CorsRule struct { AllowedHeaders []*string `json:"allowedHeaders,omitempty"` // REQUIRED; Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. - AllowedMethods []*CorsRuleAllowedMethodsItem `json:"allowedMethods,omitempty"` + AllowedMethods []*AllowedMethods `json:"allowedMethods,omitempty"` // REQUIRED; Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow // all domains @@ -1325,12 +1325,12 @@ type Dimension struct { // Encryption - The encryption settings on the storage account. type Encryption struct { - // REQUIRED; The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault - KeySource *KeySource `json:"keySource,omitempty"` - // The identity to be used with service-side encryption at rest. EncryptionIdentity *EncryptionIdentity `json:"identity,omitempty"` + // The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + KeySource *KeySource `json:"keySource,omitempty"` + // Properties provided by key vault. KeyVaultProperties *KeyVaultProperties `json:"keyvaultproperties,omitempty"` @@ -1906,10 +1906,10 @@ type LastAccessTimeTrackingPolicy struct { TrackingGranularityInDays *int32 `json:"trackingGranularityInDays,omitempty"` } -// LeaseContainerRequest - Lease Container request schema. -type LeaseContainerRequest struct { +// LeaseContainerRequestAutoGenerated - Lease Container request schema. +type LeaseContainerRequestAutoGenerated struct { // REQUIRED; Specifies the lease action. Can be one of the available actions. - Action *LeaseContainerRequestAction `json:"action,omitempty"` + Action *LeaseContainerRequest `json:"action,omitempty"` // Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and // 60. @@ -3048,8 +3048,7 @@ type TableAccessPolicy struct { // TableClientCreateOptions contains the optional parameters for the TableClient.Create method. type TableClientCreateOptions struct { - // The parameters to provide to create a table. - Parameters *Table + // placeholder for future optional parameters } // TableClientDeleteOptions contains the optional parameters for the TableClient.Delete method. @@ -3069,8 +3068,7 @@ type TableClientListOptions struct { // TableClientUpdateOptions contains the optional parameters for the TableClient.Update method. type TableClientUpdateOptions struct { - // The parameters to provide to create a table. - Parameters *Table + // placeholder for future optional parameters } type TableProperties struct { diff --git a/sdk/resourcemanager/storage/armstorage/models_serde.go b/sdk/resourcemanager/storage/armstorage/models_serde.go new file mode 100644 index 000000000000..e4c72c6443ae --- /dev/null +++ b/sdk/resourcemanager/storage/armstorage/models_serde.go @@ -0,0 +1,6654 @@ +//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 armstorage + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AccessPolicy. +func (a AccessPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "expiryTime", a.ExpiryTime) + populate(objectMap, "permission", a.Permission) + populateTimeRFC3339(objectMap, "startTime", a.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicy. +func (a *AccessPolicy) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expiryTime": + err = unpopulateTimeRFC3339(val, "ExpiryTime", &a.ExpiryTime) + delete(rawMsg, key) + case "permission": + err = unpopulate(val, "Permission", &a.Permission) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "extendedLocation", a.ExtendedLocation) + populate(objectMap, "id", a.ID) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "kind", a.Kind) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Account. +func (a *Account) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &a.ExtendedLocation) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &a.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountCheckNameAvailabilityParameters. +func (a AccountCheckNameAvailabilityParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", a.Name) + objectMap["type"] = "Microsoft.Storage/storageAccounts" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountCheckNameAvailabilityParameters. +func (a *AccountCheckNameAvailabilityParameters) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountCreateParameters. +func (a AccountCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "extendedLocation", a.ExtendedLocation) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "kind", a.Kind) + populate(objectMap, "location", a.Location) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountCreateParameters. +func (a *AccountCreateParameters) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &a.ExtendedLocation) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &a.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountImmutabilityPolicyProperties. +func (a AccountImmutabilityPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowProtectedAppendWrites", a.AllowProtectedAppendWrites) + populate(objectMap, "immutabilityPeriodSinceCreationInDays", a.ImmutabilityPeriodSinceCreationInDays) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountImmutabilityPolicyProperties. +func (a *AccountImmutabilityPolicyProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowProtectedAppendWrites": + err = unpopulate(val, "AllowProtectedAppendWrites", &a.AllowProtectedAppendWrites) + delete(rawMsg, key) + case "immutabilityPeriodSinceCreationInDays": + err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &a.ImmutabilityPeriodSinceCreationInDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &a.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountInternetEndpoints. +func (a AccountInternetEndpoints) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blob", a.Blob) + populate(objectMap, "dfs", a.Dfs) + populate(objectMap, "file", a.File) + populate(objectMap, "web", a.Web) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountInternetEndpoints. +func (a *AccountInternetEndpoints) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blob": + err = unpopulate(val, "Blob", &a.Blob) + delete(rawMsg, key) + case "dfs": + err = unpopulate(val, "Dfs", &a.Dfs) + delete(rawMsg, key) + case "file": + err = unpopulate(val, "File", &a.File) + delete(rawMsg, key) + case "web": + err = unpopulate(val, "Web", &a.Web) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountKey. +func (a AccountKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", a.CreationTime) + populate(objectMap, "keyName", a.KeyName) + populate(objectMap, "permissions", a.Permissions) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountKey. +func (a *AccountKey) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &a.CreationTime) + delete(rawMsg, key) + case "keyName": + err = unpopulate(val, "KeyName", &a.KeyName) + delete(rawMsg, key) + case "permissions": + err = unpopulate(val, "Permissions", &a.Permissions) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountListKeysResult. +func (a AccountListKeysResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keys", a.Keys) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountListKeysResult. +func (a *AccountListKeysResult) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keys": + err = unpopulate(val, "Keys", &a.Keys) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountListResult. +func (a AccountListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountListResult. +func (a *AccountListResult) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountMicrosoftEndpoints. +func (a AccountMicrosoftEndpoints) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blob", a.Blob) + populate(objectMap, "dfs", a.Dfs) + populate(objectMap, "file", a.File) + populate(objectMap, "queue", a.Queue) + populate(objectMap, "table", a.Table) + populate(objectMap, "web", a.Web) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountMicrosoftEndpoints. +func (a *AccountMicrosoftEndpoints) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blob": + err = unpopulate(val, "Blob", &a.Blob) + delete(rawMsg, key) + case "dfs": + err = unpopulate(val, "Dfs", &a.Dfs) + delete(rawMsg, key) + case "file": + err = unpopulate(val, "File", &a.File) + delete(rawMsg, key) + case "queue": + err = unpopulate(val, "Queue", &a.Queue) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &a.Table) + delete(rawMsg, key) + case "web": + err = unpopulate(val, "Web", &a.Web) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountProperties. +func (a AccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessTier", a.AccessTier) + populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess) + populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication) + populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess) + populate(objectMap, "allowedCopyScope", a.AllowedCopyScope) + populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication) + populate(objectMap, "blobRestoreStatus", a.BlobRestoreStatus) + populateTimeRFC3339(objectMap, "creationTime", a.CreationTime) + populate(objectMap, "customDomain", a.CustomDomain) + populate(objectMap, "dnsEndpointType", a.DNSEndpointType) + populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication) + populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly) + populate(objectMap, "isNfsV3Enabled", a.EnableNfsV3) + populate(objectMap, "encryption", a.Encryption) + populate(objectMap, "failoverInProgress", a.FailoverInProgress) + populate(objectMap, "geoReplicationStats", a.GeoReplicationStats) + populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning) + populate(objectMap, "isHnsEnabled", a.IsHnsEnabled) + populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled) + populate(objectMap, "isSftpEnabled", a.IsSftpEnabled) + populate(objectMap, "keyCreationTime", a.KeyCreationTime) + populate(objectMap, "keyPolicy", a.KeyPolicy) + populate(objectMap, "largeFileSharesState", a.LargeFileSharesState) + populateTimeRFC3339(objectMap, "lastGeoFailoverTime", a.LastGeoFailoverTime) + populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion) + populate(objectMap, "networkAcls", a.NetworkRuleSet) + populate(objectMap, "primaryEndpoints", a.PrimaryEndpoints) + populate(objectMap, "primaryLocation", a.PrimaryLocation) + populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess) + populate(objectMap, "routingPreference", a.RoutingPreference) + populate(objectMap, "sasPolicy", a.SasPolicy) + populate(objectMap, "secondaryEndpoints", a.SecondaryEndpoints) + populate(objectMap, "secondaryLocation", a.SecondaryLocation) + populate(objectMap, "statusOfPrimary", a.StatusOfPrimary) + populate(objectMap, "statusOfSecondary", a.StatusOfSecondary) + populate(objectMap, "storageAccountSkuConversionStatus", a.StorageAccountSKUConversionStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountProperties. +func (a *AccountProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessTier": + err = unpopulate(val, "AccessTier", &a.AccessTier) + delete(rawMsg, key) + case "allowBlobPublicAccess": + err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess) + delete(rawMsg, key) + case "allowCrossTenantReplication": + err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication) + delete(rawMsg, key) + case "allowSharedKeyAccess": + err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess) + delete(rawMsg, key) + case "allowedCopyScope": + err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope) + delete(rawMsg, key) + case "azureFilesIdentityBasedAuthentication": + err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication) + delete(rawMsg, key) + case "blobRestoreStatus": + err = unpopulate(val, "BlobRestoreStatus", &a.BlobRestoreStatus) + delete(rawMsg, key) + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &a.CreationTime) + delete(rawMsg, key) + case "customDomain": + err = unpopulate(val, "CustomDomain", &a.CustomDomain) + delete(rawMsg, key) + case "dnsEndpointType": + err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType) + delete(rawMsg, key) + case "defaultToOAuthAuthentication": + err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication) + delete(rawMsg, key) + case "supportsHttpsTrafficOnly": + err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly) + delete(rawMsg, key) + case "isNfsV3Enabled": + err = unpopulate(val, "EnableNfsV3", &a.EnableNfsV3) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &a.Encryption) + delete(rawMsg, key) + case "failoverInProgress": + err = unpopulate(val, "FailoverInProgress", &a.FailoverInProgress) + delete(rawMsg, key) + case "geoReplicationStats": + err = unpopulate(val, "GeoReplicationStats", &a.GeoReplicationStats) + delete(rawMsg, key) + case "immutableStorageWithVersioning": + err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning) + delete(rawMsg, key) + case "isHnsEnabled": + err = unpopulate(val, "IsHnsEnabled", &a.IsHnsEnabled) + delete(rawMsg, key) + case "isLocalUserEnabled": + err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled) + delete(rawMsg, key) + case "isSftpEnabled": + err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled) + delete(rawMsg, key) + case "keyCreationTime": + err = unpopulate(val, "KeyCreationTime", &a.KeyCreationTime) + delete(rawMsg, key) + case "keyPolicy": + err = unpopulate(val, "KeyPolicy", &a.KeyPolicy) + delete(rawMsg, key) + case "largeFileSharesState": + err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState) + delete(rawMsg, key) + case "lastGeoFailoverTime": + err = unpopulateTimeRFC3339(val, "LastGeoFailoverTime", &a.LastGeoFailoverTime) + delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion) + delete(rawMsg, key) + case "networkAcls": + err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet) + delete(rawMsg, key) + case "primaryEndpoints": + err = unpopulate(val, "PrimaryEndpoints", &a.PrimaryEndpoints) + delete(rawMsg, key) + case "primaryLocation": + err = unpopulate(val, "PrimaryLocation", &a.PrimaryLocation) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &a.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess) + delete(rawMsg, key) + case "routingPreference": + err = unpopulate(val, "RoutingPreference", &a.RoutingPreference) + delete(rawMsg, key) + case "sasPolicy": + err = unpopulate(val, "SasPolicy", &a.SasPolicy) + delete(rawMsg, key) + case "secondaryEndpoints": + err = unpopulate(val, "SecondaryEndpoints", &a.SecondaryEndpoints) + delete(rawMsg, key) + case "secondaryLocation": + err = unpopulate(val, "SecondaryLocation", &a.SecondaryLocation) + delete(rawMsg, key) + case "statusOfPrimary": + err = unpopulate(val, "StatusOfPrimary", &a.StatusOfPrimary) + delete(rawMsg, key) + case "statusOfSecondary": + err = unpopulate(val, "StatusOfSecondary", &a.StatusOfSecondary) + delete(rawMsg, key) + case "storageAccountSkuConversionStatus": + err = unpopulate(val, "StorageAccountSKUConversionStatus", &a.StorageAccountSKUConversionStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountPropertiesCreateParameters. +func (a AccountPropertiesCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessTier", a.AccessTier) + populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess) + populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication) + populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess) + populate(objectMap, "allowedCopyScope", a.AllowedCopyScope) + populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication) + populate(objectMap, "customDomain", a.CustomDomain) + populate(objectMap, "dnsEndpointType", a.DNSEndpointType) + populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication) + populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly) + populate(objectMap, "isNfsV3Enabled", a.EnableNfsV3) + populate(objectMap, "encryption", a.Encryption) + populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning) + populate(objectMap, "isHnsEnabled", a.IsHnsEnabled) + populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled) + populate(objectMap, "isSftpEnabled", a.IsSftpEnabled) + populate(objectMap, "keyPolicy", a.KeyPolicy) + populate(objectMap, "largeFileSharesState", a.LargeFileSharesState) + populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion) + populate(objectMap, "networkAcls", a.NetworkRuleSet) + populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess) + populate(objectMap, "routingPreference", a.RoutingPreference) + populate(objectMap, "sasPolicy", a.SasPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountPropertiesCreateParameters. +func (a *AccountPropertiesCreateParameters) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessTier": + err = unpopulate(val, "AccessTier", &a.AccessTier) + delete(rawMsg, key) + case "allowBlobPublicAccess": + err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess) + delete(rawMsg, key) + case "allowCrossTenantReplication": + err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication) + delete(rawMsg, key) + case "allowSharedKeyAccess": + err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess) + delete(rawMsg, key) + case "allowedCopyScope": + err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope) + delete(rawMsg, key) + case "azureFilesIdentityBasedAuthentication": + err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication) + delete(rawMsg, key) + case "customDomain": + err = unpopulate(val, "CustomDomain", &a.CustomDomain) + delete(rawMsg, key) + case "dnsEndpointType": + err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType) + delete(rawMsg, key) + case "defaultToOAuthAuthentication": + err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication) + delete(rawMsg, key) + case "supportsHttpsTrafficOnly": + err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly) + delete(rawMsg, key) + case "isNfsV3Enabled": + err = unpopulate(val, "EnableNfsV3", &a.EnableNfsV3) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &a.Encryption) + delete(rawMsg, key) + case "immutableStorageWithVersioning": + err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning) + delete(rawMsg, key) + case "isHnsEnabled": + err = unpopulate(val, "IsHnsEnabled", &a.IsHnsEnabled) + delete(rawMsg, key) + case "isLocalUserEnabled": + err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled) + delete(rawMsg, key) + case "isSftpEnabled": + err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled) + delete(rawMsg, key) + case "keyPolicy": + err = unpopulate(val, "KeyPolicy", &a.KeyPolicy) + delete(rawMsg, key) + case "largeFileSharesState": + err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState) + delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion) + delete(rawMsg, key) + case "networkAcls": + err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess) + delete(rawMsg, key) + case "routingPreference": + err = unpopulate(val, "RoutingPreference", &a.RoutingPreference) + delete(rawMsg, key) + case "sasPolicy": + err = unpopulate(val, "SasPolicy", &a.SasPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountPropertiesUpdateParameters. +func (a AccountPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessTier", a.AccessTier) + populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess) + populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication) + populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess) + populate(objectMap, "allowedCopyScope", a.AllowedCopyScope) + populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication) + populate(objectMap, "customDomain", a.CustomDomain) + populate(objectMap, "dnsEndpointType", a.DNSEndpointType) + populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication) + populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly) + populate(objectMap, "encryption", a.Encryption) + populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning) + populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled) + populate(objectMap, "isSftpEnabled", a.IsSftpEnabled) + populate(objectMap, "keyPolicy", a.KeyPolicy) + populate(objectMap, "largeFileSharesState", a.LargeFileSharesState) + populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion) + populate(objectMap, "networkAcls", a.NetworkRuleSet) + populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess) + populate(objectMap, "routingPreference", a.RoutingPreference) + populate(objectMap, "sasPolicy", a.SasPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountPropertiesUpdateParameters. +func (a *AccountPropertiesUpdateParameters) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessTier": + err = unpopulate(val, "AccessTier", &a.AccessTier) + delete(rawMsg, key) + case "allowBlobPublicAccess": + err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess) + delete(rawMsg, key) + case "allowCrossTenantReplication": + err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication) + delete(rawMsg, key) + case "allowSharedKeyAccess": + err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess) + delete(rawMsg, key) + case "allowedCopyScope": + err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope) + delete(rawMsg, key) + case "azureFilesIdentityBasedAuthentication": + err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication) + delete(rawMsg, key) + case "customDomain": + err = unpopulate(val, "CustomDomain", &a.CustomDomain) + delete(rawMsg, key) + case "dnsEndpointType": + err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType) + delete(rawMsg, key) + case "defaultToOAuthAuthentication": + err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication) + delete(rawMsg, key) + case "supportsHttpsTrafficOnly": + err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &a.Encryption) + delete(rawMsg, key) + case "immutableStorageWithVersioning": + err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning) + delete(rawMsg, key) + case "isLocalUserEnabled": + err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled) + delete(rawMsg, key) + case "isSftpEnabled": + err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled) + delete(rawMsg, key) + case "keyPolicy": + err = unpopulate(val, "KeyPolicy", &a.KeyPolicy) + delete(rawMsg, key) + case "largeFileSharesState": + err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState) + delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion) + delete(rawMsg, key) + case "networkAcls": + err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess) + delete(rawMsg, key) + case "routingPreference": + err = unpopulate(val, "RoutingPreference", &a.RoutingPreference) + delete(rawMsg, key) + case "sasPolicy": + err = unpopulate(val, "SasPolicy", &a.SasPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountRegenerateKeyParameters. +func (a AccountRegenerateKeyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyName", a.KeyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountRegenerateKeyParameters. +func (a *AccountRegenerateKeyParameters) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyName": + err = unpopulate(val, "KeyName", &a.KeyName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountSKUConversionStatus. +func (a AccountSKUConversionStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endTime", a.EndTime) + populate(objectMap, "skuConversionStatus", a.SKUConversionStatus) + populate(objectMap, "startTime", a.StartTime) + populate(objectMap, "targetSkuName", a.TargetSKUName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSKUConversionStatus. +func (a *AccountSKUConversionStatus) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulate(val, "EndTime", &a.EndTime) + delete(rawMsg, key) + case "skuConversionStatus": + err = unpopulate(val, "SKUConversionStatus", &a.SKUConversionStatus) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &a.StartTime) + delete(rawMsg, key) + case "targetSkuName": + err = unpopulate(val, "TargetSKUName", &a.TargetSKUName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountSasParameters. +func (a AccountSasParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "signedIp", a.IPAddressOrRange) + populate(objectMap, "keyToSign", a.KeyToSign) + populate(objectMap, "signedPermission", a.Permissions) + populate(objectMap, "signedProtocol", a.Protocols) + populate(objectMap, "signedResourceTypes", a.ResourceTypes) + populate(objectMap, "signedServices", a.Services) + populateTimeRFC3339(objectMap, "signedExpiry", a.SharedAccessExpiryTime) + populateTimeRFC3339(objectMap, "signedStart", a.SharedAccessStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSasParameters. +func (a *AccountSasParameters) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "signedIp": + err = unpopulate(val, "IPAddressOrRange", &a.IPAddressOrRange) + delete(rawMsg, key) + case "keyToSign": + err = unpopulate(val, "KeyToSign", &a.KeyToSign) + delete(rawMsg, key) + case "signedPermission": + err = unpopulate(val, "Permissions", &a.Permissions) + delete(rawMsg, key) + case "signedProtocol": + err = unpopulate(val, "Protocols", &a.Protocols) + delete(rawMsg, key) + case "signedResourceTypes": + err = unpopulate(val, "ResourceTypes", &a.ResourceTypes) + delete(rawMsg, key) + case "signedServices": + err = unpopulate(val, "Services", &a.Services) + delete(rawMsg, key) + case "signedExpiry": + err = unpopulateTimeRFC3339(val, "SharedAccessExpiryTime", &a.SharedAccessExpiryTime) + delete(rawMsg, key) + case "signedStart": + err = unpopulateTimeRFC3339(val, "SharedAccessStartTime", &a.SharedAccessStartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountUpdateParameters. +func (a AccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "kind", a.Kind) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountUpdateParameters. +func (a *AccountUpdateParameters) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &a.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ActiveDirectoryProperties. +func (a ActiveDirectoryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountType", a.AccountType) + populate(objectMap, "azureStorageSid", a.AzureStorageSid) + populate(objectMap, "domainGuid", a.DomainGUID) + populate(objectMap, "domainName", a.DomainName) + populate(objectMap, "domainSid", a.DomainSid) + populate(objectMap, "forestName", a.ForestName) + populate(objectMap, "netBiosDomainName", a.NetBiosDomainName) + populate(objectMap, "samAccountName", a.SamAccountName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDirectoryProperties. +func (a *ActiveDirectoryProperties) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accountType": + err = unpopulate(val, "AccountType", &a.AccountType) + delete(rawMsg, key) + case "azureStorageSid": + err = unpopulate(val, "AzureStorageSid", &a.AzureStorageSid) + delete(rawMsg, key) + case "domainGuid": + err = unpopulate(val, "DomainGUID", &a.DomainGUID) + delete(rawMsg, key) + case "domainName": + err = unpopulate(val, "DomainName", &a.DomainName) + delete(rawMsg, key) + case "domainSid": + err = unpopulate(val, "DomainSid", &a.DomainSid) + delete(rawMsg, key) + case "forestName": + err = unpopulate(val, "ForestName", &a.ForestName) + delete(rawMsg, key) + case "netBiosDomainName": + err = unpopulate(val, "NetBiosDomainName", &a.NetBiosDomainName) + delete(rawMsg, key) + case "samAccountName": + err = unpopulate(val, "SamAccountName", &a.SamAccountName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureEntityResource. +func (a AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureEntityResource. +func (a *AzureEntityResource) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureFilesIdentityBasedAuthentication. +func (a AzureFilesIdentityBasedAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "activeDirectoryProperties", a.ActiveDirectoryProperties) + populate(objectMap, "defaultSharePermission", a.DefaultSharePermission) + populate(objectMap, "directoryServiceOptions", a.DirectoryServiceOptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFilesIdentityBasedAuthentication. +func (a *AzureFilesIdentityBasedAuthentication) 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", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activeDirectoryProperties": + err = unpopulate(val, "ActiveDirectoryProperties", &a.ActiveDirectoryProperties) + delete(rawMsg, key) + case "defaultSharePermission": + err = unpopulate(val, "DefaultSharePermission", &a.DefaultSharePermission) + delete(rawMsg, key) + case "directoryServiceOptions": + err = unpopulate(val, "DirectoryServiceOptions", &a.DirectoryServiceOptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BlobContainer. +func (b BlobContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", b.ContainerProperties) + populate(objectMap, "etag", b.Etag) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobContainer. +func (b *BlobContainer) 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 "properties": + err = unpopulate(val, "ContainerProperties", &b.ContainerProperties) + delete(rawMsg, key) + case "etag": + err = unpopulate(val, "Etag", &b.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + 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 BlobInventoryPolicy. +func (b BlobInventoryPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicy. +func (b *BlobInventoryPolicy) 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 "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyDefinition. +func (b BlobInventoryPolicyDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "filters", b.Filters) + populate(objectMap, "format", b.Format) + populate(objectMap, "objectType", b.ObjectType) + populate(objectMap, "schedule", b.Schedule) + populate(objectMap, "schemaFields", b.SchemaFields) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyDefinition. +func (b *BlobInventoryPolicyDefinition) 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 "filters": + err = unpopulate(val, "Filters", &b.Filters) + delete(rawMsg, key) + case "format": + err = unpopulate(val, "Format", &b.Format) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &b.ObjectType) + delete(rawMsg, key) + case "schedule": + err = unpopulate(val, "Schedule", &b.Schedule) + delete(rawMsg, key) + case "schemaFields": + err = unpopulate(val, "SchemaFields", &b.SchemaFields) + 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 BlobInventoryPolicyFilter. +func (b BlobInventoryPolicyFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobTypes", b.BlobTypes) + populate(objectMap, "excludePrefix", b.ExcludePrefix) + populate(objectMap, "includeBlobVersions", b.IncludeBlobVersions) + populate(objectMap, "includeDeleted", b.IncludeDeleted) + populate(objectMap, "includeSnapshots", b.IncludeSnapshots) + populate(objectMap, "prefixMatch", b.PrefixMatch) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyFilter. +func (b *BlobInventoryPolicyFilter) 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 "blobTypes": + err = unpopulate(val, "BlobTypes", &b.BlobTypes) + delete(rawMsg, key) + case "excludePrefix": + err = unpopulate(val, "ExcludePrefix", &b.ExcludePrefix) + delete(rawMsg, key) + case "includeBlobVersions": + err = unpopulate(val, "IncludeBlobVersions", &b.IncludeBlobVersions) + delete(rawMsg, key) + case "includeDeleted": + err = unpopulate(val, "IncludeDeleted", &b.IncludeDeleted) + delete(rawMsg, key) + case "includeSnapshots": + err = unpopulate(val, "IncludeSnapshots", &b.IncludeSnapshots) + delete(rawMsg, key) + case "prefixMatch": + err = unpopulate(val, "PrefixMatch", &b.PrefixMatch) + 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 BlobInventoryPolicyProperties. +func (b BlobInventoryPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "lastModifiedTime", b.LastModifiedTime) + populate(objectMap, "policy", b.Policy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyProperties. +func (b *BlobInventoryPolicyProperties) 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 "lastModifiedTime": + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &b.LastModifiedTime) + delete(rawMsg, key) + case "policy": + err = unpopulate(val, "Policy", &b.Policy) + 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 BlobInventoryPolicyRule. +func (b BlobInventoryPolicyRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "definition", b.Definition) + populate(objectMap, "destination", b.Destination) + populate(objectMap, "enabled", b.Enabled) + populate(objectMap, "name", b.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyRule. +func (b *BlobInventoryPolicyRule) 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 "definition": + err = unpopulate(val, "Definition", &b.Definition) + delete(rawMsg, key) + case "destination": + err = unpopulate(val, "Destination", &b.Destination) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &b.Enabled) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + 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 BlobInventoryPolicySchema. +func (b BlobInventoryPolicySchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destination", b.Destination) + populate(objectMap, "enabled", b.Enabled) + populate(objectMap, "rules", b.Rules) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicySchema. +func (b *BlobInventoryPolicySchema) 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 "destination": + err = unpopulate(val, "Destination", &b.Destination) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &b.Enabled) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &b.Rules) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + 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 BlobRestoreParameters. +func (b BlobRestoreParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobRanges", b.BlobRanges) + populateTimeRFC3339(objectMap, "timeToRestore", b.TimeToRestore) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreParameters. +func (b *BlobRestoreParameters) 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 "blobRanges": + err = unpopulate(val, "BlobRanges", &b.BlobRanges) + delete(rawMsg, key) + case "timeToRestore": + err = unpopulateTimeRFC3339(val, "TimeToRestore", &b.TimeToRestore) + 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 BlobRestoreRange. +func (b BlobRestoreRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endRange", b.EndRange) + populate(objectMap, "startRange", b.StartRange) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreRange. +func (b *BlobRestoreRange) 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 "endRange": + err = unpopulate(val, "EndRange", &b.EndRange) + delete(rawMsg, key) + case "startRange": + err = unpopulate(val, "StartRange", &b.StartRange) + 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 BlobRestoreStatus. +func (b BlobRestoreStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "failureReason", b.FailureReason) + populate(objectMap, "parameters", b.Parameters) + populate(objectMap, "restoreId", b.RestoreID) + populate(objectMap, "status", b.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreStatus. +func (b *BlobRestoreStatus) 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 "failureReason": + err = unpopulate(val, "FailureReason", &b.FailureReason) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &b.Parameters) + delete(rawMsg, key) + case "restoreId": + err = unpopulate(val, "RestoreID", &b.RestoreID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &b.Status) + 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 BlobServiceItems. +func (b BlobServiceItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobServiceItems. +func (b *BlobServiceItems) 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 "value": + err = unpopulate(val, "Value", &b.Value) + 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 BlobServiceProperties. +func (b BlobServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", b.BlobServiceProperties) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "sku", b.SKU) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobServiceProperties. +func (b *BlobServiceProperties) 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 "properties": + err = unpopulate(val, "BlobServiceProperties", &b.BlobServiceProperties) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &b.SKU) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + 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 BlobServicePropertiesProperties. +func (b BlobServicePropertiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "automaticSnapshotPolicyEnabled", b.AutomaticSnapshotPolicyEnabled) + populate(objectMap, "changeFeed", b.ChangeFeed) + populate(objectMap, "containerDeleteRetentionPolicy", b.ContainerDeleteRetentionPolicy) + populate(objectMap, "cors", b.Cors) + populate(objectMap, "defaultServiceVersion", b.DefaultServiceVersion) + populate(objectMap, "deleteRetentionPolicy", b.DeleteRetentionPolicy) + populate(objectMap, "isVersioningEnabled", b.IsVersioningEnabled) + populate(objectMap, "lastAccessTimeTrackingPolicy", b.LastAccessTimeTrackingPolicy) + populate(objectMap, "restorePolicy", b.RestorePolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobServicePropertiesProperties. +func (b *BlobServicePropertiesProperties) 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 "automaticSnapshotPolicyEnabled": + err = unpopulate(val, "AutomaticSnapshotPolicyEnabled", &b.AutomaticSnapshotPolicyEnabled) + delete(rawMsg, key) + case "changeFeed": + err = unpopulate(val, "ChangeFeed", &b.ChangeFeed) + delete(rawMsg, key) + case "containerDeleteRetentionPolicy": + err = unpopulate(val, "ContainerDeleteRetentionPolicy", &b.ContainerDeleteRetentionPolicy) + delete(rawMsg, key) + case "cors": + err = unpopulate(val, "Cors", &b.Cors) + delete(rawMsg, key) + case "defaultServiceVersion": + err = unpopulate(val, "DefaultServiceVersion", &b.DefaultServiceVersion) + delete(rawMsg, key) + case "deleteRetentionPolicy": + err = unpopulate(val, "DeleteRetentionPolicy", &b.DeleteRetentionPolicy) + delete(rawMsg, key) + case "isVersioningEnabled": + err = unpopulate(val, "IsVersioningEnabled", &b.IsVersioningEnabled) + delete(rawMsg, key) + case "lastAccessTimeTrackingPolicy": + err = unpopulate(val, "LastAccessTimeTrackingPolicy", &b.LastAccessTimeTrackingPolicy) + delete(rawMsg, key) + case "restorePolicy": + err = unpopulate(val, "RestorePolicy", &b.RestorePolicy) + 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 ChangeFeed. +func (c ChangeFeed) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", c.Enabled) + populate(objectMap, "retentionInDays", c.RetentionInDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ChangeFeed. +func (c *ChangeFeed) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &c.Enabled) + delete(rawMsg, key) + case "retentionInDays": + err = unpopulate(val, "RetentionInDays", &c.RetentionInDays) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResult. +func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", c.Message) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResult. +func (c *CheckNameAvailabilityResult) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudError. +func (c CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", c.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudError. +func (c *CloudError) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &c.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudErrorBody. +func (c CloudErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", c.Code) + populate(objectMap, "details", c.Details) + populate(objectMap, "message", c.Message) + populate(objectMap, "target", c.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudErrorBody. +func (c *CloudErrorBody) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &c.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &c.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &c.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerProperties. +func (c ContainerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "defaultEncryptionScope", c.DefaultEncryptionScope) + populate(objectMap, "deleted", c.Deleted) + populateTimeRFC3339(objectMap, "deletedTime", c.DeletedTime) + populate(objectMap, "denyEncryptionScopeOverride", c.DenyEncryptionScopeOverride) + populate(objectMap, "enableNfsV3AllSquash", c.EnableNfsV3AllSquash) + populate(objectMap, "enableNfsV3RootSquash", c.EnableNfsV3RootSquash) + populate(objectMap, "hasImmutabilityPolicy", c.HasImmutabilityPolicy) + populate(objectMap, "hasLegalHold", c.HasLegalHold) + populate(objectMap, "immutabilityPolicy", c.ImmutabilityPolicy) + populate(objectMap, "immutableStorageWithVersioning", c.ImmutableStorageWithVersioning) + populateTimeRFC3339(objectMap, "lastModifiedTime", c.LastModifiedTime) + populate(objectMap, "leaseDuration", c.LeaseDuration) + populate(objectMap, "leaseState", c.LeaseState) + populate(objectMap, "leaseStatus", c.LeaseStatus) + populate(objectMap, "legalHold", c.LegalHold) + populate(objectMap, "metadata", c.Metadata) + populate(objectMap, "publicAccess", c.PublicAccess) + populate(objectMap, "remainingRetentionDays", c.RemainingRetentionDays) + populate(objectMap, "version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProperties. +func (c *ContainerProperties) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultEncryptionScope": + err = unpopulate(val, "DefaultEncryptionScope", &c.DefaultEncryptionScope) + delete(rawMsg, key) + case "deleted": + err = unpopulate(val, "Deleted", &c.Deleted) + delete(rawMsg, key) + case "deletedTime": + err = unpopulateTimeRFC3339(val, "DeletedTime", &c.DeletedTime) + delete(rawMsg, key) + case "denyEncryptionScopeOverride": + err = unpopulate(val, "DenyEncryptionScopeOverride", &c.DenyEncryptionScopeOverride) + delete(rawMsg, key) + case "enableNfsV3AllSquash": + err = unpopulate(val, "EnableNfsV3AllSquash", &c.EnableNfsV3AllSquash) + delete(rawMsg, key) + case "enableNfsV3RootSquash": + err = unpopulate(val, "EnableNfsV3RootSquash", &c.EnableNfsV3RootSquash) + delete(rawMsg, key) + case "hasImmutabilityPolicy": + err = unpopulate(val, "HasImmutabilityPolicy", &c.HasImmutabilityPolicy) + delete(rawMsg, key) + case "hasLegalHold": + err = unpopulate(val, "HasLegalHold", &c.HasLegalHold) + delete(rawMsg, key) + case "immutabilityPolicy": + err = unpopulate(val, "ImmutabilityPolicy", &c.ImmutabilityPolicy) + delete(rawMsg, key) + case "immutableStorageWithVersioning": + err = unpopulate(val, "ImmutableStorageWithVersioning", &c.ImmutableStorageWithVersioning) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &c.LastModifiedTime) + delete(rawMsg, key) + case "leaseDuration": + err = unpopulate(val, "LeaseDuration", &c.LeaseDuration) + delete(rawMsg, key) + case "leaseState": + err = unpopulate(val, "LeaseState", &c.LeaseState) + delete(rawMsg, key) + case "leaseStatus": + err = unpopulate(val, "LeaseStatus", &c.LeaseStatus) + delete(rawMsg, key) + case "legalHold": + err = unpopulate(val, "LegalHold", &c.LegalHold) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &c.Metadata) + delete(rawMsg, key) + case "publicAccess": + err = unpopulate(val, "PublicAccess", &c.PublicAccess) + delete(rawMsg, key) + case "remainingRetentionDays": + err = unpopulate(val, "RemainingRetentionDays", &c.RemainingRetentionDays) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CorsRule. +func (c CorsRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedHeaders", c.AllowedHeaders) + populate(objectMap, "allowedMethods", c.AllowedMethods) + populate(objectMap, "allowedOrigins", c.AllowedOrigins) + populate(objectMap, "exposedHeaders", c.ExposedHeaders) + populate(objectMap, "maxAgeInSeconds", c.MaxAgeInSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CorsRule. +func (c *CorsRule) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedHeaders": + err = unpopulate(val, "AllowedHeaders", &c.AllowedHeaders) + delete(rawMsg, key) + case "allowedMethods": + err = unpopulate(val, "AllowedMethods", &c.AllowedMethods) + delete(rawMsg, key) + case "allowedOrigins": + err = unpopulate(val, "AllowedOrigins", &c.AllowedOrigins) + delete(rawMsg, key) + case "exposedHeaders": + err = unpopulate(val, "ExposedHeaders", &c.ExposedHeaders) + delete(rawMsg, key) + case "maxAgeInSeconds": + err = unpopulate(val, "MaxAgeInSeconds", &c.MaxAgeInSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CorsRules. +func (c CorsRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "corsRules", c.CorsRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CorsRules. +func (c *CorsRules) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "corsRules": + err = unpopulate(val, "CorsRules", &c.CorsRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomDomain. +func (c CustomDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + populate(objectMap, "useSubDomainName", c.UseSubDomainName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomain. +func (c *CustomDomain) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "useSubDomainName": + err = unpopulate(val, "UseSubDomainName", &c.UseSubDomainName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DateAfterCreation. +func (d DateAfterCreation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "daysAfterCreationGreaterThan", d.DaysAfterCreationGreaterThan) + populate(objectMap, "daysAfterLastTierChangeGreaterThan", d.DaysAfterLastTierChangeGreaterThan) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DateAfterCreation. +func (d *DateAfterCreation) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "daysAfterCreationGreaterThan": + err = unpopulate(val, "DaysAfterCreationGreaterThan", &d.DaysAfterCreationGreaterThan) + delete(rawMsg, key) + case "daysAfterLastTierChangeGreaterThan": + err = unpopulate(val, "DaysAfterLastTierChangeGreaterThan", &d.DaysAfterLastTierChangeGreaterThan) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DateAfterModification. +func (d DateAfterModification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "daysAfterCreationGreaterThan", d.DaysAfterCreationGreaterThan) + populate(objectMap, "daysAfterLastAccessTimeGreaterThan", d.DaysAfterLastAccessTimeGreaterThan) + populate(objectMap, "daysAfterLastTierChangeGreaterThan", d.DaysAfterLastTierChangeGreaterThan) + populate(objectMap, "daysAfterModificationGreaterThan", d.DaysAfterModificationGreaterThan) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DateAfterModification. +func (d *DateAfterModification) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "daysAfterCreationGreaterThan": + err = unpopulate(val, "DaysAfterCreationGreaterThan", &d.DaysAfterCreationGreaterThan) + delete(rawMsg, key) + case "daysAfterLastAccessTimeGreaterThan": + err = unpopulate(val, "DaysAfterLastAccessTimeGreaterThan", &d.DaysAfterLastAccessTimeGreaterThan) + delete(rawMsg, key) + case "daysAfterLastTierChangeGreaterThan": + err = unpopulate(val, "DaysAfterLastTierChangeGreaterThan", &d.DaysAfterLastTierChangeGreaterThan) + delete(rawMsg, key) + case "daysAfterModificationGreaterThan": + err = unpopulate(val, "DaysAfterModificationGreaterThan", &d.DaysAfterModificationGreaterThan) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeleteRetentionPolicy. +func (d DeleteRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowPermanentDelete", d.AllowPermanentDelete) + populate(objectMap, "days", d.Days) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeleteRetentionPolicy. +func (d *DeleteRetentionPolicy) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowPermanentDelete": + err = unpopulate(val, "AllowPermanentDelete", &d.AllowPermanentDelete) + delete(rawMsg, key) + case "days": + err = unpopulate(val, "Days", &d.Days) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedAccount. +func (d DeletedAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedAccount. +func (d *DeletedAccount) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedAccountListResult. +func (d DeletedAccountListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedAccountListResult. +func (d *DeletedAccountListResult) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedAccountProperties. +func (d DeletedAccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "creationTime", d.CreationTime) + populate(objectMap, "deletionTime", d.DeletionTime) + populate(objectMap, "location", d.Location) + populate(objectMap, "restoreReference", d.RestoreReference) + populate(objectMap, "storageAccountResourceId", d.StorageAccountResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedAccountProperties. +func (d *DeletedAccountProperties) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulate(val, "CreationTime", &d.CreationTime) + delete(rawMsg, key) + case "deletionTime": + err = unpopulate(val, "DeletionTime", &d.DeletionTime) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "restoreReference": + err = unpopulate(val, "RestoreReference", &d.RestoreReference) + delete(rawMsg, key) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &d.StorageAccountResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedShare. +func (d DeletedShare) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deletedShareName", d.DeletedShareName) + populate(objectMap, "deletedShareVersion", d.DeletedShareVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedShare. +func (d *DeletedShare) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deletedShareName": + err = unpopulate(val, "DeletedShareName", &d.DeletedShareName) + delete(rawMsg, key) + case "deletedShareVersion": + err = unpopulate(val, "DeletedShareVersion", &d.DeletedShareVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Dimension. +func (d Dimension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Dimension. +func (d *Dimension) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Encryption. +func (e Encryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", e.EncryptionIdentity) + populate(objectMap, "keySource", e.KeySource) + populate(objectMap, "keyvaultproperties", e.KeyVaultProperties) + populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption) + populate(objectMap, "services", e.Services) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption. +func (e *Encryption) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "EncryptionIdentity", &e.EncryptionIdentity) + delete(rawMsg, key) + case "keySource": + err = unpopulate(val, "KeySource", &e.KeySource) + delete(rawMsg, key) + case "keyvaultproperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) + delete(rawMsg, key) + case "requireInfrastructureEncryption": + err = unpopulate(val, "RequireInfrastructureEncryption", &e.RequireInfrastructureEncryption) + delete(rawMsg, key) + case "services": + err = unpopulate(val, "Services", &e.Services) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionIdentity. +func (e EncryptionIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "federatedIdentityClientId", e.EncryptionFederatedIdentityClientID) + populate(objectMap, "userAssignedIdentity", e.EncryptionUserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionIdentity. +func (e *EncryptionIdentity) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "federatedIdentityClientId": + err = unpopulate(val, "EncryptionFederatedIdentityClientID", &e.EncryptionFederatedIdentityClientID) + delete(rawMsg, key) + case "userAssignedIdentity": + err = unpopulate(val, "EncryptionUserAssignedIdentity", &e.EncryptionUserAssignedIdentity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionScope. +func (e EncryptionScope) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", e.EncryptionScopeProperties) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScope. +func (e *EncryptionScope) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "EncryptionScopeProperties", &e.EncryptionScopeProperties) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeKeyVaultProperties. +func (e EncryptionScopeKeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentVersionedKeyIdentifier", e.CurrentVersionedKeyIdentifier) + populate(objectMap, "keyUri", e.KeyURI) + populateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", e.LastKeyRotationTimestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeKeyVaultProperties. +func (e *EncryptionScopeKeyVaultProperties) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentVersionedKeyIdentifier": + err = unpopulate(val, "CurrentVersionedKeyIdentifier", &e.CurrentVersionedKeyIdentifier) + delete(rawMsg, key) + case "keyUri": + err = unpopulate(val, "KeyURI", &e.KeyURI) + delete(rawMsg, key) + case "lastKeyRotationTimestamp": + err = unpopulateTimeRFC3339(val, "LastKeyRotationTimestamp", &e.LastKeyRotationTimestamp) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeListResult. +func (e EncryptionScopeListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeListResult. +func (e *EncryptionScopeListResult) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeProperties. +func (e EncryptionScopeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", e.CreationTime) + populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) + populateTimeRFC3339(objectMap, "lastModifiedTime", e.LastModifiedTime) + populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption) + populate(objectMap, "source", e.Source) + populate(objectMap, "state", e.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeProperties. +func (e *EncryptionScopeProperties) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &e.CreationTime) + delete(rawMsg, key) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &e.LastModifiedTime) + delete(rawMsg, key) + case "requireInfrastructureEncryption": + err = unpopulate(val, "RequireInfrastructureEncryption", &e.RequireInfrastructureEncryption) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &e.Source) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionService. +func (e EncryptionService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", e.Enabled) + populate(objectMap, "keyType", e.KeyType) + populateTimeRFC3339(objectMap, "lastEnabledTime", e.LastEnabledTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionService. +func (e *EncryptionService) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &e.Enabled) + delete(rawMsg, key) + case "keyType": + err = unpopulate(val, "KeyType", &e.KeyType) + delete(rawMsg, key) + case "lastEnabledTime": + err = unpopulateTimeRFC3339(val, "LastEnabledTime", &e.LastEnabledTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionServices. +func (e EncryptionServices) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blob", e.Blob) + populate(objectMap, "file", e.File) + populate(objectMap, "queue", e.Queue) + populate(objectMap, "table", e.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionServices. +func (e *EncryptionServices) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blob": + err = unpopulate(val, "Blob", &e.Blob) + delete(rawMsg, key) + case "file": + err = unpopulate(val, "File", &e.File) + delete(rawMsg, key) + case "queue": + err = unpopulate(val, "Queue", &e.Queue) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &e.Table) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Endpoints. +func (e Endpoints) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blob", e.Blob) + populate(objectMap, "dfs", e.Dfs) + populate(objectMap, "file", e.File) + populate(objectMap, "internetEndpoints", e.InternetEndpoints) + populate(objectMap, "microsoftEndpoints", e.MicrosoftEndpoints) + populate(objectMap, "queue", e.Queue) + populate(objectMap, "table", e.Table) + populate(objectMap, "web", e.Web) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Endpoints. +func (e *Endpoints) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blob": + err = unpopulate(val, "Blob", &e.Blob) + delete(rawMsg, key) + case "dfs": + err = unpopulate(val, "Dfs", &e.Dfs) + delete(rawMsg, key) + case "file": + err = unpopulate(val, "File", &e.File) + delete(rawMsg, key) + case "internetEndpoints": + err = unpopulate(val, "InternetEndpoints", &e.InternetEndpoints) + delete(rawMsg, key) + case "microsoftEndpoints": + err = unpopulate(val, "MicrosoftEndpoints", &e.MicrosoftEndpoints) + delete(rawMsg, key) + case "queue": + err = unpopulate(val, "Queue", &e.Queue) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &e.Table) + delete(rawMsg, key) + case "web": + err = unpopulate(val, "Web", &e.Web) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody. +func (e ErrorResponseBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody. +func (e *ErrorResponseBody) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. +func (e ExtendedLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", e.Name) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation. +func (e *ExtendedLocation) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileServiceItems. +func (f FileServiceItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceItems. +func (f *FileServiceItems) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileServiceProperties. +func (f FileServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", f.FileServiceProperties) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "sku", f.SKU) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceProperties. +func (f *FileServiceProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "FileServiceProperties", &f.FileServiceProperties) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &f.SKU) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileServicePropertiesProperties. +func (f FileServicePropertiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cors", f.Cors) + populate(objectMap, "protocolSettings", f.ProtocolSettings) + populate(objectMap, "shareDeleteRetentionPolicy", f.ShareDeleteRetentionPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileServicePropertiesProperties. +func (f *FileServicePropertiesProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cors": + err = unpopulate(val, "Cors", &f.Cors) + delete(rawMsg, key) + case "protocolSettings": + err = unpopulate(val, "ProtocolSettings", &f.ProtocolSettings) + delete(rawMsg, key) + case "shareDeleteRetentionPolicy": + err = unpopulate(val, "ShareDeleteRetentionPolicy", &f.ShareDeleteRetentionPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileShare. +func (f FileShare) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", f.Etag) + populate(objectMap, "properties", f.FileShareProperties) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileShare. +func (f *FileShare) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &f.Etag) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "FileShareProperties", &f.FileShareProperties) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileShareItem. +func (f FileShareItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", f.Etag) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareItem. +func (f *FileShareItem) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &f.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileShareItems. +func (f FileShareItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareItems. +func (f *FileShareItems) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileShareProperties. +func (f FileShareProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessTier", f.AccessTier) + populateTimeRFC3339(objectMap, "accessTierChangeTime", f.AccessTierChangeTime) + populate(objectMap, "accessTierStatus", f.AccessTierStatus) + populate(objectMap, "deleted", f.Deleted) + populateTimeRFC3339(objectMap, "deletedTime", f.DeletedTime) + populate(objectMap, "enabledProtocols", f.EnabledProtocols) + populateTimeRFC3339(objectMap, "lastModifiedTime", f.LastModifiedTime) + populate(objectMap, "leaseDuration", f.LeaseDuration) + populate(objectMap, "leaseState", f.LeaseState) + populate(objectMap, "leaseStatus", f.LeaseStatus) + populate(objectMap, "metadata", f.Metadata) + populate(objectMap, "remainingRetentionDays", f.RemainingRetentionDays) + populate(objectMap, "rootSquash", f.RootSquash) + populate(objectMap, "shareQuota", f.ShareQuota) + populate(objectMap, "shareUsageBytes", f.ShareUsageBytes) + populate(objectMap, "signedIdentifiers", f.SignedIdentifiers) + populateTimeRFC3339(objectMap, "snapshotTime", f.SnapshotTime) + populate(objectMap, "version", f.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareProperties. +func (f *FileShareProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessTier": + err = unpopulate(val, "AccessTier", &f.AccessTier) + delete(rawMsg, key) + case "accessTierChangeTime": + err = unpopulateTimeRFC3339(val, "AccessTierChangeTime", &f.AccessTierChangeTime) + delete(rawMsg, key) + case "accessTierStatus": + err = unpopulate(val, "AccessTierStatus", &f.AccessTierStatus) + delete(rawMsg, key) + case "deleted": + err = unpopulate(val, "Deleted", &f.Deleted) + delete(rawMsg, key) + case "deletedTime": + err = unpopulateTimeRFC3339(val, "DeletedTime", &f.DeletedTime) + delete(rawMsg, key) + case "enabledProtocols": + err = unpopulate(val, "EnabledProtocols", &f.EnabledProtocols) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &f.LastModifiedTime) + delete(rawMsg, key) + case "leaseDuration": + err = unpopulate(val, "LeaseDuration", &f.LeaseDuration) + delete(rawMsg, key) + case "leaseState": + err = unpopulate(val, "LeaseState", &f.LeaseState) + delete(rawMsg, key) + case "leaseStatus": + err = unpopulate(val, "LeaseStatus", &f.LeaseStatus) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &f.Metadata) + delete(rawMsg, key) + case "remainingRetentionDays": + err = unpopulate(val, "RemainingRetentionDays", &f.RemainingRetentionDays) + delete(rawMsg, key) + case "rootSquash": + err = unpopulate(val, "RootSquash", &f.RootSquash) + delete(rawMsg, key) + case "shareQuota": + err = unpopulate(val, "ShareQuota", &f.ShareQuota) + delete(rawMsg, key) + case "shareUsageBytes": + err = unpopulate(val, "ShareUsageBytes", &f.ShareUsageBytes) + delete(rawMsg, key) + case "signedIdentifiers": + err = unpopulate(val, "SignedIdentifiers", &f.SignedIdentifiers) + delete(rawMsg, key) + case "snapshotTime": + err = unpopulateTimeRFC3339(val, "SnapshotTime", &f.SnapshotTime) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &f.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GeoReplicationStats. +func (g GeoReplicationStats) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "canFailover", g.CanFailover) + populateTimeRFC3339(objectMap, "lastSyncTime", g.LastSyncTime) + populate(objectMap, "status", g.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoReplicationStats. +func (g *GeoReplicationStats) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "canFailover": + err = unpopulate(val, "CanFailover", &g.CanFailover) + delete(rawMsg, key) + case "lastSyncTime": + err = unpopulateTimeRFC3339(val, "LastSyncTime", &g.LastSyncTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &g.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPRule. +func (i IPRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["action"] = "Allow" + populate(objectMap, "value", i.IPAddressOrRange) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule. +func (i *IPRule) 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 "action": + err = unpopulate(val, "Action", &i.Action) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange) + 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 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 ImmutabilityPolicy. +func (i ImmutabilityPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilityPolicy. +func (i *ImmutabilityPolicy) 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 "etag": + err = unpopulate(val, "Etag", &i.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + 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 ImmutabilityPolicyProperties. +func (i ImmutabilityPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "updateHistory", i.UpdateHistory) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilityPolicyProperties. +func (i *ImmutabilityPolicyProperties) 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 "etag": + err = unpopulate(val, "Etag", &i.Etag) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "updateHistory": + err = unpopulate(val, "UpdateHistory", &i.UpdateHistory) + 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 ImmutabilityPolicyProperty. +func (i ImmutabilityPolicyProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowProtectedAppendWrites", i.AllowProtectedAppendWrites) + populate(objectMap, "allowProtectedAppendWritesAll", i.AllowProtectedAppendWritesAll) + populate(objectMap, "immutabilityPeriodSinceCreationInDays", i.ImmutabilityPeriodSinceCreationInDays) + populate(objectMap, "state", i.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilityPolicyProperty. +func (i *ImmutabilityPolicyProperty) 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 "allowProtectedAppendWrites": + err = unpopulate(val, "AllowProtectedAppendWrites", &i.AllowProtectedAppendWrites) + delete(rawMsg, key) + case "allowProtectedAppendWritesAll": + err = unpopulate(val, "AllowProtectedAppendWritesAll", &i.AllowProtectedAppendWritesAll) + delete(rawMsg, key) + case "immutabilityPeriodSinceCreationInDays": + err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &i.ImmutabilityPeriodSinceCreationInDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &i.State) + 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 ImmutableStorageAccount. +func (i ImmutableStorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", i.Enabled) + populate(objectMap, "immutabilityPolicy", i.ImmutabilityPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutableStorageAccount. +func (i *ImmutableStorageAccount) 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 "enabled": + err = unpopulate(val, "Enabled", &i.Enabled) + delete(rawMsg, key) + case "immutabilityPolicy": + err = unpopulate(val, "ImmutabilityPolicy", &i.ImmutabilityPolicy) + 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 ImmutableStorageWithVersioning. +func (i ImmutableStorageWithVersioning) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", i.Enabled) + populate(objectMap, "migrationState", i.MigrationState) + populateTimeRFC3339(objectMap, "timeStamp", i.TimeStamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutableStorageWithVersioning. +func (i *ImmutableStorageWithVersioning) 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 "enabled": + err = unpopulate(val, "Enabled", &i.Enabled) + delete(rawMsg, key) + case "migrationState": + err = unpopulate(val, "MigrationState", &i.MigrationState) + delete(rawMsg, key) + case "timeStamp": + err = unpopulateTimeRFC3339(val, "TimeStamp", &i.TimeStamp) + 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 KeyCreationTime. +func (k KeyCreationTime) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "key1", k.Key1) + populateTimeRFC3339(objectMap, "key2", k.Key2) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyCreationTime. +func (k *KeyCreationTime) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key1": + err = unpopulateTimeRFC3339(val, "Key1", &k.Key1) + delete(rawMsg, key) + case "key2": + err = unpopulateTimeRFC3339(val, "Key2", &k.Key2) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyPolicy. +func (k KeyPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyExpirationPeriodInDays", k.KeyExpirationPeriodInDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyPolicy. +func (k *KeyPolicy) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyExpirationPeriodInDays": + err = unpopulate(val, "KeyExpirationPeriodInDays", &k.KeyExpirationPeriodInDays) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. +func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "currentVersionedKeyExpirationTimestamp", k.CurrentVersionedKeyExpirationTimestamp) + populate(objectMap, "currentVersionedKeyIdentifier", k.CurrentVersionedKeyIdentifier) + populate(objectMap, "keyname", k.KeyName) + populate(objectMap, "keyvaulturi", k.KeyVaultURI) + populate(objectMap, "keyversion", k.KeyVersion) + populateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", k.LastKeyRotationTimestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. +func (k *KeyVaultProperties) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentVersionedKeyExpirationTimestamp": + err = unpopulateTimeRFC3339(val, "CurrentVersionedKeyExpirationTimestamp", &k.CurrentVersionedKeyExpirationTimestamp) + delete(rawMsg, key) + case "currentVersionedKeyIdentifier": + err = unpopulate(val, "CurrentVersionedKeyIdentifier", &k.CurrentVersionedKeyIdentifier) + delete(rawMsg, key) + case "keyname": + err = unpopulate(val, "KeyName", &k.KeyName) + delete(rawMsg, key) + case "keyvaulturi": + err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI) + delete(rawMsg, key) + case "keyversion": + err = unpopulate(val, "KeyVersion", &k.KeyVersion) + delete(rawMsg, key) + case "lastKeyRotationTimestamp": + err = unpopulateTimeRFC3339(val, "LastKeyRotationTimestamp", &k.LastKeyRotationTimestamp) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LastAccessTimeTrackingPolicy. +func (l LastAccessTimeTrackingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobType", l.BlobType) + populate(objectMap, "enable", l.Enable) + populate(objectMap, "name", l.Name) + populate(objectMap, "trackingGranularityInDays", l.TrackingGranularityInDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LastAccessTimeTrackingPolicy. +func (l *LastAccessTimeTrackingPolicy) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobType": + err = unpopulate(val, "BlobType", &l.BlobType) + delete(rawMsg, key) + case "enable": + err = unpopulate(val, "Enable", &l.Enable) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "trackingGranularityInDays": + err = unpopulate(val, "TrackingGranularityInDays", &l.TrackingGranularityInDays) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LeaseContainerRequestAutoGenerated. +func (l LeaseContainerRequestAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", l.Action) + populate(objectMap, "breakPeriod", l.BreakPeriod) + populate(objectMap, "leaseDuration", l.LeaseDuration) + populate(objectMap, "leaseId", l.LeaseID) + populate(objectMap, "proposedLeaseId", l.ProposedLeaseID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseContainerRequestAutoGenerated. +func (l *LeaseContainerRequestAutoGenerated) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &l.Action) + delete(rawMsg, key) + case "breakPeriod": + err = unpopulate(val, "BreakPeriod", &l.BreakPeriod) + delete(rawMsg, key) + case "leaseDuration": + err = unpopulate(val, "LeaseDuration", &l.LeaseDuration) + delete(rawMsg, key) + case "leaseId": + err = unpopulate(val, "LeaseID", &l.LeaseID) + delete(rawMsg, key) + case "proposedLeaseId": + err = unpopulate(val, "ProposedLeaseID", &l.ProposedLeaseID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LeaseContainerResponse. +func (l LeaseContainerResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "leaseId", l.LeaseID) + populate(objectMap, "leaseTimeSeconds", l.LeaseTimeSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseContainerResponse. +func (l *LeaseContainerResponse) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "leaseId": + err = unpopulate(val, "LeaseID", &l.LeaseID) + delete(rawMsg, key) + case "leaseTimeSeconds": + err = unpopulate(val, "LeaseTimeSeconds", &l.LeaseTimeSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LeaseShareRequest. +func (l LeaseShareRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", l.Action) + populate(objectMap, "breakPeriod", l.BreakPeriod) + populate(objectMap, "leaseDuration", l.LeaseDuration) + populate(objectMap, "leaseId", l.LeaseID) + populate(objectMap, "proposedLeaseId", l.ProposedLeaseID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseShareRequest. +func (l *LeaseShareRequest) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &l.Action) + delete(rawMsg, key) + case "breakPeriod": + err = unpopulate(val, "BreakPeriod", &l.BreakPeriod) + delete(rawMsg, key) + case "leaseDuration": + err = unpopulate(val, "LeaseDuration", &l.LeaseDuration) + delete(rawMsg, key) + case "leaseId": + err = unpopulate(val, "LeaseID", &l.LeaseID) + delete(rawMsg, key) + case "proposedLeaseId": + err = unpopulate(val, "ProposedLeaseID", &l.ProposedLeaseID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LeaseShareResponse. +func (l LeaseShareResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "leaseId", l.LeaseID) + populate(objectMap, "leaseTimeSeconds", l.LeaseTimeSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseShareResponse. +func (l *LeaseShareResponse) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "leaseId": + err = unpopulate(val, "LeaseID", &l.LeaseID) + delete(rawMsg, key) + case "leaseTimeSeconds": + err = unpopulate(val, "LeaseTimeSeconds", &l.LeaseTimeSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LegalHold. +func (l LegalHold) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowProtectedAppendWritesAll", l.AllowProtectedAppendWritesAll) + populate(objectMap, "hasLegalHold", l.HasLegalHold) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LegalHold. +func (l *LegalHold) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowProtectedAppendWritesAll": + err = unpopulate(val, "AllowProtectedAppendWritesAll", &l.AllowProtectedAppendWritesAll) + delete(rawMsg, key) + case "hasLegalHold": + err = unpopulate(val, "HasLegalHold", &l.HasLegalHold) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LegalHoldProperties. +func (l LegalHoldProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hasLegalHold", l.HasLegalHold) + populate(objectMap, "protectedAppendWritesHistory", l.ProtectedAppendWritesHistory) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LegalHoldProperties. +func (l *LegalHoldProperties) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hasLegalHold": + err = unpopulate(val, "HasLegalHold", &l.HasLegalHold) + delete(rawMsg, key) + case "protectedAppendWritesHistory": + err = unpopulate(val, "ProtectedAppendWritesHistory", &l.ProtectedAppendWritesHistory) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListAccountSasResponse. +func (l ListAccountSasResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountSasToken", l.AccountSasToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListAccountSasResponse. +func (l *ListAccountSasResponse) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accountSasToken": + err = unpopulate(val, "AccountSasToken", &l.AccountSasToken) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListBlobInventoryPolicy. +func (l ListBlobInventoryPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListBlobInventoryPolicy. +func (l *ListBlobInventoryPolicy) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListContainerItem. +func (l ListContainerItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", l.Etag) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListContainerItem. +func (l *ListContainerItem) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &l.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListContainerItems. +func (l ListContainerItems) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListContainerItems. +func (l *ListContainerItems) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListQueue. +func (l ListQueue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.QueueProperties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueue. +func (l *ListQueue) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "QueueProperties", &l.QueueProperties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListQueueProperties. +func (l ListQueueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metadata", l.Metadata) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueueProperties. +func (l *ListQueueProperties) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metadata": + err = unpopulate(val, "Metadata", &l.Metadata) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListQueueResource. +func (l ListQueueResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueueResource. +func (l *ListQueueResource) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListQueueServices. +func (l ListQueueServices) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueueServices. +func (l *ListQueueServices) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListServiceSasResponse. +func (l ListServiceSasResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "serviceSasToken", l.ServiceSasToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListServiceSasResponse. +func (l *ListServiceSasResponse) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceSasToken": + err = unpopulate(val, "ServiceSasToken", &l.ServiceSasToken) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListTableResource. +func (l ListTableResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListTableResource. +func (l *ListTableResource) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListTableServices. +func (l ListTableServices) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListTableServices. +func (l *ListTableServices) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocalUser. +func (l LocalUser) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUser. +func (l *LocalUser) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocalUserKeys. +func (l LocalUserKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sshAuthorizedKeys", l.SSHAuthorizedKeys) + populate(objectMap, "sharedKey", l.SharedKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUserKeys. +func (l *LocalUserKeys) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sshAuthorizedKeys": + err = unpopulate(val, "SSHAuthorizedKeys", &l.SSHAuthorizedKeys) + delete(rawMsg, key) + case "sharedKey": + err = unpopulate(val, "SharedKey", &l.SharedKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocalUserProperties. +func (l LocalUserProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hasSshKey", l.HasSSHKey) + populate(objectMap, "hasSshPassword", l.HasSSHPassword) + populate(objectMap, "hasSharedKey", l.HasSharedKey) + populate(objectMap, "homeDirectory", l.HomeDirectory) + populate(objectMap, "permissionScopes", l.PermissionScopes) + populate(objectMap, "sshAuthorizedKeys", l.SSHAuthorizedKeys) + populate(objectMap, "sid", l.Sid) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUserProperties. +func (l *LocalUserProperties) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hasSshKey": + err = unpopulate(val, "HasSSHKey", &l.HasSSHKey) + delete(rawMsg, key) + case "hasSshPassword": + err = unpopulate(val, "HasSSHPassword", &l.HasSSHPassword) + delete(rawMsg, key) + case "hasSharedKey": + err = unpopulate(val, "HasSharedKey", &l.HasSharedKey) + delete(rawMsg, key) + case "homeDirectory": + err = unpopulate(val, "HomeDirectory", &l.HomeDirectory) + delete(rawMsg, key) + case "permissionScopes": + err = unpopulate(val, "PermissionScopes", &l.PermissionScopes) + delete(rawMsg, key) + case "sshAuthorizedKeys": + err = unpopulate(val, "SSHAuthorizedKeys", &l.SSHAuthorizedKeys) + delete(rawMsg, key) + case "sid": + err = unpopulate(val, "Sid", &l.Sid) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocalUserRegeneratePasswordResult. +func (l LocalUserRegeneratePasswordResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sshPassword", l.SSHPassword) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUserRegeneratePasswordResult. +func (l *LocalUserRegeneratePasswordResult) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sshPassword": + err = unpopulate(val, "SSHPassword", &l.SSHPassword) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LocalUsers. +func (l LocalUsers) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUsers. +func (l *LocalUsers) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagementPolicy. +func (m ManagementPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicy. +func (m *ManagementPolicy) 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 "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + 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 ManagementPolicyAction. +func (m ManagementPolicyAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "baseBlob", m.BaseBlob) + populate(objectMap, "snapshot", m.Snapshot) + populate(objectMap, "version", m.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyAction. +func (m *ManagementPolicyAction) 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 "baseBlob": + err = unpopulate(val, "BaseBlob", &m.BaseBlob) + delete(rawMsg, key) + case "snapshot": + err = unpopulate(val, "Snapshot", &m.Snapshot) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &m.Version) + 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 ManagementPolicyBaseBlob. +func (m ManagementPolicyBaseBlob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "delete", m.Delete) + populate(objectMap, "enableAutoTierToHotFromCool", m.EnableAutoTierToHotFromCool) + populate(objectMap, "tierToArchive", m.TierToArchive) + populate(objectMap, "tierToCool", m.TierToCool) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyBaseBlob. +func (m *ManagementPolicyBaseBlob) 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 "delete": + err = unpopulate(val, "Delete", &m.Delete) + delete(rawMsg, key) + case "enableAutoTierToHotFromCool": + err = unpopulate(val, "EnableAutoTierToHotFromCool", &m.EnableAutoTierToHotFromCool) + delete(rawMsg, key) + case "tierToArchive": + err = unpopulate(val, "TierToArchive", &m.TierToArchive) + delete(rawMsg, key) + case "tierToCool": + err = unpopulate(val, "TierToCool", &m.TierToCool) + 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 ManagementPolicyDefinition. +func (m ManagementPolicyDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actions", m.Actions) + populate(objectMap, "filters", m.Filters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyDefinition. +func (m *ManagementPolicyDefinition) 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 "actions": + err = unpopulate(val, "Actions", &m.Actions) + delete(rawMsg, key) + case "filters": + err = unpopulate(val, "Filters", &m.Filters) + 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 ManagementPolicyFilter. +func (m ManagementPolicyFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobIndexMatch", m.BlobIndexMatch) + populate(objectMap, "blobTypes", m.BlobTypes) + populate(objectMap, "prefixMatch", m.PrefixMatch) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyFilter. +func (m *ManagementPolicyFilter) 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 "blobIndexMatch": + err = unpopulate(val, "BlobIndexMatch", &m.BlobIndexMatch) + delete(rawMsg, key) + case "blobTypes": + err = unpopulate(val, "BlobTypes", &m.BlobTypes) + delete(rawMsg, key) + case "prefixMatch": + err = unpopulate(val, "PrefixMatch", &m.PrefixMatch) + 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 ManagementPolicyProperties. +func (m ManagementPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "lastModifiedTime", m.LastModifiedTime) + populate(objectMap, "policy", m.Policy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyProperties. +func (m *ManagementPolicyProperties) 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 "lastModifiedTime": + err = unpopulateTimeRFC3339(val, "LastModifiedTime", &m.LastModifiedTime) + delete(rawMsg, key) + case "policy": + err = unpopulate(val, "Policy", &m.Policy) + 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 ManagementPolicyRule. +func (m ManagementPolicyRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "definition", m.Definition) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "name", m.Name) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyRule. +func (m *ManagementPolicyRule) 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 "definition": + err = unpopulate(val, "Definition", &m.Definition) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + 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 ManagementPolicySchema. +func (m ManagementPolicySchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "rules", m.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicySchema. +func (m *ManagementPolicySchema) 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 "rules": + err = unpopulate(val, "Rules", &m.Rules) + 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 ManagementPolicySnapShot. +func (m ManagementPolicySnapShot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "delete", m.Delete) + populate(objectMap, "tierToArchive", m.TierToArchive) + populate(objectMap, "tierToCool", m.TierToCool) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicySnapShot. +func (m *ManagementPolicySnapShot) 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 "delete": + err = unpopulate(val, "Delete", &m.Delete) + delete(rawMsg, key) + case "tierToArchive": + err = unpopulate(val, "TierToArchive", &m.TierToArchive) + delete(rawMsg, key) + case "tierToCool": + err = unpopulate(val, "TierToCool", &m.TierToCool) + 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 ManagementPolicyVersion. +func (m ManagementPolicyVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "delete", m.Delete) + populate(objectMap, "tierToArchive", m.TierToArchive) + populate(objectMap, "tierToCool", m.TierToCool) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyVersion. +func (m *ManagementPolicyVersion) 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 "delete": + err = unpopulate(val, "Delete", &m.Delete) + delete(rawMsg, key) + case "tierToArchive": + err = unpopulate(val, "TierToArchive", &m.TierToArchive) + delete(rawMsg, key) + case "tierToCool": + err = unpopulate(val, "TierToCool", &m.TierToCool) + 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{}) + populate(objectMap, "aggregationType", m.AggregationType) + populate(objectMap, "category", m.Category) + populate(objectMap, "dimensions", m.Dimensions) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "name", m.Name) + populate(objectMap, "resourceIdDimensionNameOverride", m.ResourceIDDimensionNameOverride) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification. +func (m *MetricSpecification) 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 "aggregationType": + err = unpopulate(val, "AggregationType", &m.AggregationType) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &m.Category) + delete(rawMsg, key) + case "dimensions": + err = unpopulate(val, "Dimensions", &m.Dimensions) + delete(rawMsg, key) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &m.DisplayDescription) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "fillGapWithZero": + err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "resourceIdDimensionNameOverride": + err = unpopulate(val, "ResourceIDDimensionNameOverride", &m.ResourceIDDimensionNameOverride) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + 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 Multichannel. +func (m Multichannel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", m.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Multichannel. +func (m *Multichannel) 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 "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + 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 NetworkRuleSet. +func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bypass", n.Bypass) + populate(objectMap, "defaultAction", n.DefaultAction) + populate(objectMap, "ipRules", n.IPRules) + populate(objectMap, "resourceAccessRules", n.ResourceAccessRules) + populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. +func (n *NetworkRuleSet) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bypass": + err = unpopulate(val, "Bypass", &n.Bypass) + delete(rawMsg, key) + case "defaultAction": + err = unpopulate(val, "DefaultAction", &n.DefaultAction) + delete(rawMsg, key) + case "ipRules": + err = unpopulate(val, "IPRules", &n.IPRules) + delete(rawMsg, key) + case "resourceAccessRules": + err = unpopulate(val, "ResourceAccessRules", &n.ResourceAccessRules) + delete(rawMsg, key) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicies. +func (o ObjectReplicationPolicies) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicies. +func (o *ObjectReplicationPolicies) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicy. +func (o ObjectReplicationPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicy. +func (o *ObjectReplicationPolicy) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyFilter. +func (o ObjectReplicationPolicyFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "minCreationTime", o.MinCreationTime) + populate(objectMap, "prefixMatch", o.PrefixMatch) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyFilter. +func (o *ObjectReplicationPolicyFilter) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "minCreationTime": + err = unpopulate(val, "MinCreationTime", &o.MinCreationTime) + delete(rawMsg, key) + case "prefixMatch": + err = unpopulate(val, "PrefixMatch", &o.PrefixMatch) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyProperties. +func (o ObjectReplicationPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destinationAccount", o.DestinationAccount) + populateTimeRFC3339(objectMap, "enabledTime", o.EnabledTime) + populate(objectMap, "policyId", o.PolicyID) + populate(objectMap, "rules", o.Rules) + populate(objectMap, "sourceAccount", o.SourceAccount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyProperties. +func (o *ObjectReplicationPolicyProperties) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationAccount": + err = unpopulate(val, "DestinationAccount", &o.DestinationAccount) + delete(rawMsg, key) + case "enabledTime": + err = unpopulateTimeRFC3339(val, "EnabledTime", &o.EnabledTime) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &o.PolicyID) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &o.Rules) + delete(rawMsg, key) + case "sourceAccount": + err = unpopulate(val, "SourceAccount", &o.SourceAccount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyRule. +func (o ObjectReplicationPolicyRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destinationContainer", o.DestinationContainer) + populate(objectMap, "filters", o.Filters) + populate(objectMap, "ruleId", o.RuleID) + populate(objectMap, "sourceContainer", o.SourceContainer) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyRule. +func (o *ObjectReplicationPolicyRule) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationContainer": + err = unpopulate(val, "DestinationContainer", &o.DestinationContainer) + delete(rawMsg, key) + case "filters": + err = unpopulate(val, "Filters", &o.Filters) + delete(rawMsg, key) + case "ruleId": + err = unpopulate(val, "RuleID", &o.RuleID) + delete(rawMsg, key) + case "sourceContainer": + err = unpopulate(val, "SourceContainer", &o.SourceContainer) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.OperationProperties) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "OperationProperties", &o.OperationProperties) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. +func (o *OperationProperties) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PermissionScope. +func (p PermissionScope) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "permissions", p.Permissions) + populate(objectMap, "resourceName", p.ResourceName) + populate(objectMap, "service", p.Service) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PermissionScope. +func (p *PermissionScope) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "permissions": + err = unpopulate(val, "Permissions", &p.Permissions) + delete(rawMsg, key) + case "resourceName": + err = unpopulate(val, "ResourceName", &p.ResourceName) + delete(rawMsg, key) + case "service": + err = unpopulate(val, "Service", &p.Service) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionRequired", p.ActionRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionRequired": + err = unpopulate(val, "ActionRequired", &p.ActionRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProtectedAppendWritesHistory. +func (p ProtectedAppendWritesHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowProtectedAppendWritesAll", p.AllowProtectedAppendWritesAll) + populateTimeRFC3339(objectMap, "timestamp", p.Timestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedAppendWritesHistory. +func (p *ProtectedAppendWritesHistory) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowProtectedAppendWritesAll": + err = unpopulate(val, "AllowProtectedAppendWritesAll", &p.AllowProtectedAppendWritesAll) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &p.Timestamp) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProtocolSettings. +func (p ProtocolSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "smb", p.Smb) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtocolSettings. +func (p *ProtocolSettings) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "smb": + err = unpopulate(val, "Smb", &p.Smb) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Queue. +func (q Queue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", q.ID) + populate(objectMap, "name", q.Name) + populate(objectMap, "properties", q.QueueProperties) + populate(objectMap, "type", q.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Queue. +func (q *Queue) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &q.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "QueueProperties", &q.QueueProperties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &q.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueueProperties. +func (q QueueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "approximateMessageCount", q.ApproximateMessageCount) + populate(objectMap, "metadata", q.Metadata) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueueProperties. +func (q *QueueProperties) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "approximateMessageCount": + err = unpopulate(val, "ApproximateMessageCount", &q.ApproximateMessageCount) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &q.Metadata) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueueServiceProperties. +func (q QueueServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", q.ID) + populate(objectMap, "name", q.Name) + populate(objectMap, "properties", q.QueueServiceProperties) + populate(objectMap, "type", q.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueueServiceProperties. +func (q *QueueServiceProperties) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &q.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "QueueServiceProperties", &q.QueueServiceProperties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &q.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueueServicePropertiesProperties. +func (q QueueServicePropertiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cors", q.Cors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueueServicePropertiesProperties. +func (q *QueueServicePropertiesProperties) 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", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cors": + err = unpopulate(val, "Cors", &q.Cors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceAccessRule. +func (r ResourceAccessRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resourceId", r.ResourceID) + populate(objectMap, "tenantId", r.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAccessRule. +func (r *ResourceAccessRule) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceId": + err = unpopulate(val, "ResourceID", &r.ResourceID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestorePolicyProperties. +func (r RestorePolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "days", r.Days) + populate(objectMap, "enabled", r.Enabled) + populateTimeRFC3339(objectMap, "lastEnabledTime", r.LastEnabledTime) + populateTimeRFC3339(objectMap, "minRestoreTime", r.MinRestoreTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePolicyProperties. +func (r *RestorePolicyProperties) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "days": + err = unpopulate(val, "Days", &r.Days) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + case "lastEnabledTime": + err = unpopulateTimeRFC3339(val, "LastEnabledTime", &r.LastEnabledTime) + delete(rawMsg, key) + case "minRestoreTime": + err = unpopulateTimeRFC3339(val, "MinRestoreTime", &r.MinRestoreTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Restriction. +func (r Restriction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "reasonCode", r.ReasonCode) + populate(objectMap, "type", r.Type) + populate(objectMap, "values", r.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Restriction. +func (r *Restriction) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "reasonCode": + err = unpopulate(val, "ReasonCode", &r.ReasonCode) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &r.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RoutingPreference. +func (r RoutingPreference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "publishInternetEndpoints", r.PublishInternetEndpoints) + populate(objectMap, "publishMicrosoftEndpoints", r.PublishMicrosoftEndpoints) + populate(objectMap, "routingChoice", r.RoutingChoice) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingPreference. +func (r *RoutingPreference) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "publishInternetEndpoints": + err = unpopulate(val, "PublishInternetEndpoints", &r.PublishInternetEndpoints) + delete(rawMsg, key) + case "publishMicrosoftEndpoints": + err = unpopulate(val, "PublishMicrosoftEndpoints", &r.PublishMicrosoftEndpoints) + delete(rawMsg, key) + case "routingChoice": + err = unpopulate(val, "RoutingChoice", &r.RoutingChoice) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUCapability. +func (s SKUCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapability. +func (s *SKUCapability) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUInformation. +func (s SKUInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capabilities", s.Capabilities) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "name", s.Name) + populate(objectMap, "resourceType", s.ResourceType) + populate(objectMap, "restrictions", s.Restrictions) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUInformation. +func (s *SKUInformation) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capabilities": + err = unpopulate(val, "Capabilities", &s.Capabilities) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &s.Locations) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &s.ResourceType) + delete(rawMsg, key) + case "restrictions": + err = unpopulate(val, "Restrictions", &s.Restrictions) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUListResult. +func (s SKUListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUListResult. +func (s *SKUListResult) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SSHPublicKey. +func (s SSHPublicKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", s.Description) + populate(objectMap, "key", s.Key) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey. +func (s *SSHPublicKey) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "key": + err = unpopulate(val, "Key", &s.Key) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SasPolicy. +func (s SasPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "expirationAction", s.ExpirationAction) + populate(objectMap, "sasExpirationPeriod", s.SasExpirationPeriod) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SasPolicy. +func (s *SasPolicy) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationAction": + err = unpopulate(val, "ExpirationAction", &s.ExpirationAction) + delete(rawMsg, key) + case "sasExpirationPeriod": + err = unpopulate(val, "SasExpirationPeriod", &s.SasExpirationPeriod) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSasParameters. +func (s ServiceSasParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "rscc", s.CacheControl) + populate(objectMap, "canonicalizedResource", s.CanonicalizedResource) + populate(objectMap, "rscd", s.ContentDisposition) + populate(objectMap, "rsce", s.ContentEncoding) + populate(objectMap, "rscl", s.ContentLanguage) + populate(objectMap, "rsct", s.ContentType) + populate(objectMap, "signedIp", s.IPAddressOrRange) + populate(objectMap, "signedIdentifier", s.Identifier) + populate(objectMap, "keyToSign", s.KeyToSign) + populate(objectMap, "endPk", s.PartitionKeyEnd) + populate(objectMap, "startPk", s.PartitionKeyStart) + populate(objectMap, "signedPermission", s.Permissions) + populate(objectMap, "signedProtocol", s.Protocols) + populate(objectMap, "signedResource", s.Resource) + populate(objectMap, "endRk", s.RowKeyEnd) + populate(objectMap, "startRk", s.RowKeyStart) + populateTimeRFC3339(objectMap, "signedExpiry", s.SharedAccessExpiryTime) + populateTimeRFC3339(objectMap, "signedStart", s.SharedAccessStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSasParameters. +func (s *ServiceSasParameters) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "rscc": + err = unpopulate(val, "CacheControl", &s.CacheControl) + delete(rawMsg, key) + case "canonicalizedResource": + err = unpopulate(val, "CanonicalizedResource", &s.CanonicalizedResource) + delete(rawMsg, key) + case "rscd": + err = unpopulate(val, "ContentDisposition", &s.ContentDisposition) + delete(rawMsg, key) + case "rsce": + err = unpopulate(val, "ContentEncoding", &s.ContentEncoding) + delete(rawMsg, key) + case "rscl": + err = unpopulate(val, "ContentLanguage", &s.ContentLanguage) + delete(rawMsg, key) + case "rsct": + err = unpopulate(val, "ContentType", &s.ContentType) + delete(rawMsg, key) + case "signedIp": + err = unpopulate(val, "IPAddressOrRange", &s.IPAddressOrRange) + delete(rawMsg, key) + case "signedIdentifier": + err = unpopulate(val, "Identifier", &s.Identifier) + delete(rawMsg, key) + case "keyToSign": + err = unpopulate(val, "KeyToSign", &s.KeyToSign) + delete(rawMsg, key) + case "endPk": + err = unpopulate(val, "PartitionKeyEnd", &s.PartitionKeyEnd) + delete(rawMsg, key) + case "startPk": + err = unpopulate(val, "PartitionKeyStart", &s.PartitionKeyStart) + delete(rawMsg, key) + case "signedPermission": + err = unpopulate(val, "Permissions", &s.Permissions) + delete(rawMsg, key) + case "signedProtocol": + err = unpopulate(val, "Protocols", &s.Protocols) + delete(rawMsg, key) + case "signedResource": + err = unpopulate(val, "Resource", &s.Resource) + delete(rawMsg, key) + case "endRk": + err = unpopulate(val, "RowKeyEnd", &s.RowKeyEnd) + delete(rawMsg, key) + case "startRk": + err = unpopulate(val, "RowKeyStart", &s.RowKeyStart) + delete(rawMsg, key) + case "signedExpiry": + err = unpopulateTimeRFC3339(val, "SharedAccessExpiryTime", &s.SharedAccessExpiryTime) + delete(rawMsg, key) + case "signedStart": + err = unpopulateTimeRFC3339(val, "SharedAccessStartTime", &s.SharedAccessStartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricSpecifications", s.MetricSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification. +func (s *ServiceSpecification) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SignedIdentifier. +func (s SignedIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessPolicy", s.AccessPolicy) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SignedIdentifier. +func (s *SignedIdentifier) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessPolicy": + err = unpopulate(val, "AccessPolicy", &s.AccessPolicy) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SmbSetting. +func (s SmbSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMethods", s.AuthenticationMethods) + populate(objectMap, "channelEncryption", s.ChannelEncryption) + populate(objectMap, "kerberosTicketEncryption", s.KerberosTicketEncryption) + populate(objectMap, "multichannel", s.Multichannel) + populate(objectMap, "versions", s.Versions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SmbSetting. +func (s *SmbSetting) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authenticationMethods": + err = unpopulate(val, "AuthenticationMethods", &s.AuthenticationMethods) + delete(rawMsg, key) + case "channelEncryption": + err = unpopulate(val, "ChannelEncryption", &s.ChannelEncryption) + delete(rawMsg, key) + case "kerberosTicketEncryption": + err = unpopulate(val, "KerberosTicketEncryption", &s.KerberosTicketEncryption) + delete(rawMsg, key) + case "multichannel": + err = unpopulate(val, "Multichannel", &s.Multichannel) + delete(rawMsg, key) + case "versions": + err = unpopulate(val, "Versions", &s.Versions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Table. +func (t Table) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.TableProperties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Table. +func (t *Table) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "TableProperties", &t.TableProperties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TableAccessPolicy. +func (t TableAccessPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "expiryTime", t.ExpiryTime) + populate(objectMap, "permission", t.Permission) + populateTimeRFC3339(objectMap, "startTime", t.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableAccessPolicy. +func (t *TableAccessPolicy) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expiryTime": + err = unpopulateTimeRFC3339(val, "ExpiryTime", &t.ExpiryTime) + delete(rawMsg, key) + case "permission": + err = unpopulate(val, "Permission", &t.Permission) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &t.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TableProperties. +func (t TableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "signedIdentifiers", t.SignedIdentifiers) + populate(objectMap, "tableName", t.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableProperties. +func (t *TableProperties) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "signedIdentifiers": + err = unpopulate(val, "SignedIdentifiers", &t.SignedIdentifiers) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &t.TableName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TableServiceProperties. +func (t TableServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.TableServiceProperties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableServiceProperties. +func (t *TableServiceProperties) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "TableServiceProperties", &t.TableServiceProperties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TableServicePropertiesProperties. +func (t TableServicePropertiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cors", t.Cors) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableServicePropertiesProperties. +func (t *TableServicePropertiesProperties) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cors": + err = unpopulate(val, "Cors", &t.Cors) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TableSignedIdentifier. +func (t TableSignedIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessPolicy", t.AccessPolicy) + populate(objectMap, "id", t.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableSignedIdentifier. +func (t *TableSignedIdentifier) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessPolicy": + err = unpopulate(val, "AccessPolicy", &t.AccessPolicy) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagFilter. +func (t TagFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", t.Name) + populate(objectMap, "op", t.Op) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagFilter. +func (t *TagFilter) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "op": + err = unpopulate(val, "Op", &t.Op) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagProperty. +func (t TagProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "objectIdentifier", t.ObjectIdentifier) + populate(objectMap, "tag", t.Tag) + populate(objectMap, "tenantId", t.TenantID) + populateTimeRFC3339(objectMap, "timestamp", t.Timestamp) + populate(objectMap, "upn", t.Upn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagProperty. +func (t *TagProperty) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "objectIdentifier": + err = unpopulate(val, "ObjectIdentifier", &t.ObjectIdentifier) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &t.Tag) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &t.TenantID) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &t.Timestamp) + delete(rawMsg, key) + case "upn": + err = unpopulate(val, "Upn", &t.Upn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateHistoryProperty. +func (u UpdateHistoryProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowProtectedAppendWrites", u.AllowProtectedAppendWrites) + populate(objectMap, "allowProtectedAppendWritesAll", u.AllowProtectedAppendWritesAll) + populate(objectMap, "immutabilityPeriodSinceCreationInDays", u.ImmutabilityPeriodSinceCreationInDays) + populate(objectMap, "objectIdentifier", u.ObjectIdentifier) + populate(objectMap, "tenantId", u.TenantID) + populateTimeRFC3339(objectMap, "timestamp", u.Timestamp) + populate(objectMap, "update", u.Update) + populate(objectMap, "upn", u.Upn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateHistoryProperty. +func (u *UpdateHistoryProperty) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowProtectedAppendWrites": + err = unpopulate(val, "AllowProtectedAppendWrites", &u.AllowProtectedAppendWrites) + delete(rawMsg, key) + case "allowProtectedAppendWritesAll": + err = unpopulate(val, "AllowProtectedAppendWritesAll", &u.AllowProtectedAppendWritesAll) + delete(rawMsg, key) + case "immutabilityPeriodSinceCreationInDays": + err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &u.ImmutabilityPeriodSinceCreationInDays) + delete(rawMsg, key) + case "objectIdentifier": + err = unpopulate(val, "ObjectIdentifier", &u.ObjectIdentifier) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &u.TenantID) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &u.Timestamp) + delete(rawMsg, key) + case "update": + err = unpopulate(val, "Update", &u.Update) + delete(rawMsg, key) + case "upn": + err = unpopulate(val, "Upn", &u.Upn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", u.CurrentValue) + populate(objectMap, "limit", u.Limit) + populate(objectMap, "name", u.Name) + populate(objectMap, "unit", u.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Usage. +func (u *Usage) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, "CurrentValue", &u.CurrentValue) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &u.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &u.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UsageListResult. +func (u UsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsageListResult. +func (u *UsageListResult) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UsageName. +func (u UsageName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "localizedValue", u.LocalizedValue) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsageName. +func (u *UsageName) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &u.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule. +func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["action"] = "Allow" + populate(objectMap, "state", v.State) + populate(objectMap, "id", v.VirtualNetworkResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule. +func (v *VirtualNetworkRule) 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 "action": + err = unpopulate(val, "Action", &v.Action) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "VirtualNetworkResourceID", &v.VirtualNetworkResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_objectreplicationpolicies_client.go b/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go similarity index 98% rename from sdk/resourcemanager/storage/armstorage/zz_generated_objectreplicationpolicies_client.go rename to sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go index b9e84bc99db1..38c849f1a627 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_objectreplicationpolicies_client.go +++ b/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewObjectReplicationPoliciesClient(subscriptionID string, credential azcore // CreateOrUpdate - Create or update the object replication policy of the storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -105,7 +106,7 @@ func (client *ObjectReplicationPoliciesClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) @@ -122,7 +123,7 @@ func (client *ObjectReplicationPoliciesClient) createOrUpdateHandleResponse(resp // Delete - Deletes the object replication policy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -170,7 +171,7 @@ func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +179,7 @@ func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.C // Get - Get the object replication policy of the storage account by policy ID. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -226,7 +227,7 @@ func (client *ObjectReplicationPoliciesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,7 +244,7 @@ func (client *ObjectReplicationPoliciesClient) getHandleResponse(resp *http.Resp // NewListPager - List the object replication policies associated with the storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -291,7 +292,7 @@ func (client *ObjectReplicationPoliciesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_operations_client.go b/sdk/resourcemanager/storage/armstorage/operations_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_operations_client.go rename to sdk/resourcemanager/storage/armstorage/operations_client.go index 8f1a956ba8d5..da4ddc4b2f3a 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_operations_client.go +++ b/sdk/resourcemanager/storage/armstorage/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -50,7 +51,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Storage Rest API operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -82,7 +83,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_privateendpointconnections_client.go rename to sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go index 724b8f76aa11..5d5f23b3c3e7 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // Delete - Deletes the specified private endpoint connection associated with the storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -102,7 +103,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +111,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specified private endpoint connection associated with the storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -156,7 +157,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +174,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List all the private endpoint connections associated with the storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -221,7 +222,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +239,7 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // Put - Update the state of specified private endpoint connection associated with the storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -285,7 +286,7 @@ func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go similarity index 98% rename from sdk/resourcemanager/storage/armstorage/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go index 80e943cf293c..f23ef046d394 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // ListByStorageAccount - Gets the private link resources that need to be created for a storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -97,7 +98,7 @@ func (client *PrivateLinkResourcesClient) listByStorageAccountCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_queue_client.go b/sdk/resourcemanager/storage/armstorage/queue_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_queue_client.go rename to sdk/resourcemanager/storage/armstorage/queue_client.go index 692ceed577f7..d5c0dd3e91c6 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_queue_client.go +++ b/sdk/resourcemanager/storage/armstorage/queue_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewQueueClient(subscriptionID string, credential azcore.TokenCredential, op // Create - Creates a new queue with the specified queue name, under the specified account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -104,7 +105,7 @@ func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, queue) @@ -121,7 +122,7 @@ func (client *QueueClient) createHandleResponse(resp *http.Response) (QueueClien // Delete - Deletes the queue with the specified queue name, under the specified account if it exists. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -168,7 +169,7 @@ func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,7 +177,7 @@ func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets the queue with the specified queue name, under the specified account if it exists. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -223,7 +224,7 @@ func (client *QueueClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +241,7 @@ func (client *QueueClient) getHandleResponse(resp *http.Response) (QueueClientGe // NewListPager - Gets a list of all the queues under the specified storage account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -293,7 +294,7 @@ func (client *QueueClient) listCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", *options.Maxpagesize) } @@ -316,7 +317,7 @@ func (client *QueueClient) listHandleResponse(resp *http.Response) (QueueClientL // Update - Creates a new queue with the specified queue name, under the specified account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -364,7 +365,7 @@ func (client *QueueClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, queue) diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_queueservices_client.go b/sdk/resourcemanager/storage/armstorage/queueservices_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_queueservices_client.go rename to sdk/resourcemanager/storage/armstorage/queueservices_client.go index e279fee36045..9aefd353416a 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_queueservices_client.go +++ b/sdk/resourcemanager/storage/armstorage/queueservices_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -57,7 +58,7 @@ func NewQueueServicesClient(subscriptionID string, credential azcore.TokenCreden // GetServiceProperties - Gets the properties of a storage account’s Queue service, including properties for Storage Analytics // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -99,7 +100,7 @@ func (client *QueueServicesClient) getServicePropertiesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +117,7 @@ func (client *QueueServicesClient) getServicePropertiesHandleResponse(resp *http // List - List all queue services for the storage account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -156,7 +157,7 @@ func (client *QueueServicesClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +175,7 @@ func (client *QueueServicesClient) listHandleResponse(resp *http.Response) (Queu // SetServiceProperties - Sets the properties of a storage account’s Queue service, including properties for Storage Analytics // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -218,7 +219,7 @@ func (client *QueueServicesClient) setServicePropertiesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_response_types.go b/sdk/resourcemanager/storage/armstorage/response_types.go similarity index 99% rename from sdk/resourcemanager/storage/armstorage/zz_generated_response_types.go rename to sdk/resourcemanager/storage/armstorage/response_types.go index 6d24bd7096c9..e0554b7b1445 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_response_types.go +++ b/sdk/resourcemanager/storage/armstorage/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_skus_client.go b/sdk/resourcemanager/storage/armstorage/skus_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_skus_client.go rename to sdk/resourcemanager/storage/armstorage/skus_client.go index 4cb5754e7598..25c3c3136622 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_skus_client.go +++ b/sdk/resourcemanager/storage/armstorage/skus_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt // NewListPager - Lists the available SKUs supported by Microsoft.Storage for given subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // options - SKUsClientListOptions contains the optional parameters for the SKUsClient.List method. func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{ @@ -92,7 +93,7 @@ func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_table_client.go b/sdk/resourcemanager/storage/armstorage/table_client.go similarity index 93% rename from sdk/resourcemanager/storage/armstorage/zz_generated_table_client.go rename to sdk/resourcemanager/storage/armstorage/table_client.go index 0503d1212e9a..05a4e468562c 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_table_client.go +++ b/sdk/resourcemanager/storage/armstorage/table_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,15 +57,16 @@ func NewTableClient(subscriptionID string, credential azcore.TokenCredential, op // Create - Creates a new table with the specified table name, under the specified account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. // tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must // comprise of only alphanumeric characters and it cannot begin with a numeric character. +// parameters - The parameters to provide to create a table. // options - TableClientCreateOptions contains the optional parameters for the TableClient.Create method. -func (client *TableClient) Create(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientCreateOptions) (TableClientCreateResponse, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, tableName, options) +func (client *TableClient) Create(ctx context.Context, resourceGroupName string, accountName string, tableName string, parameters Table, options *TableClientCreateOptions) (TableClientCreateResponse, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, tableName, parameters, options) if err != nil { return TableClientCreateResponse{}, err } @@ -79,7 +81,7 @@ func (client *TableClient) Create(ctx context.Context, resourceGroupName string, } // createCreateRequest creates the Create request. -func (client *TableClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientCreateOptions) (*policy.Request, error) { +func (client *TableClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, parameters Table, options *TableClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -102,13 +104,10 @@ func (client *TableClient) createCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil + return req, runtime.MarshalAsJSON(req, parameters) } // createHandleResponse handles the Create response. @@ -122,7 +121,7 @@ func (client *TableClient) createHandleResponse(resp *http.Response) (TableClien // Delete - Deletes the table with the specified table name, under the specified account if it exists. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -168,7 +167,7 @@ func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,7 +175,7 @@ func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets the table with the specified table name, under the specified account if it exists. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -222,7 +221,7 @@ func (client *TableClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +238,7 @@ func (client *TableClient) getHandleResponse(resp *http.Response) (TableClientGe // NewListPager - Gets a list of all the tables under the specified storage account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -292,7 +291,7 @@ func (client *TableClient) listCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -309,15 +308,16 @@ func (client *TableClient) listHandleResponse(resp *http.Response) (TableClientL // Update - Creates a new table with the specified table name, under the specified account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. // tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must // comprise of only alphanumeric characters and it cannot begin with a numeric character. +// parameters - The parameters to provide to create a table. // options - TableClientUpdateOptions contains the optional parameters for the TableClient.Update method. -func (client *TableClient) Update(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientUpdateOptions) (TableClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, tableName, options) +func (client *TableClient) Update(ctx context.Context, resourceGroupName string, accountName string, tableName string, parameters Table, options *TableClientUpdateOptions) (TableClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, tableName, parameters, options) if err != nil { return TableClientUpdateResponse{}, err } @@ -332,7 +332,7 @@ func (client *TableClient) Update(ctx context.Context, resourceGroupName string, } // updateCreateRequest creates the Update request. -func (client *TableClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientUpdateOptions) (*policy.Request, error) { +func (client *TableClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, parameters Table, options *TableClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -355,13 +355,10 @@ func (client *TableClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) - } - return req, nil + return req, runtime.MarshalAsJSON(req, parameters) } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_tableservices_client.go b/sdk/resourcemanager/storage/armstorage/tableservices_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_tableservices_client.go rename to sdk/resourcemanager/storage/armstorage/tableservices_client.go index 617772745f9d..6a9f58e2bfc6 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_tableservices_client.go +++ b/sdk/resourcemanager/storage/armstorage/tableservices_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -57,7 +58,7 @@ func NewTableServicesClient(subscriptionID string, credential azcore.TokenCreden // GetServiceProperties - Gets the properties of a storage account’s Table service, including properties for Storage Analytics // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -99,7 +100,7 @@ func (client *TableServicesClient) getServicePropertiesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +117,7 @@ func (client *TableServicesClient) getServicePropertiesHandleResponse(resp *http // List - List all table services for the storage account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -156,7 +157,7 @@ func (client *TableServicesClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +175,7 @@ func (client *TableServicesClient) listHandleResponse(resp *http.Response) (Tabl // SetServiceProperties - Sets the properties of a storage account’s Table service, including properties for Storage Analytics // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -218,7 +219,7 @@ func (client *TableServicesClient) setServicePropertiesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_time_rfc3339.go b/sdk/resourcemanager/storage/armstorage/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/storage/armstorage/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/storage/armstorage/time_rfc3339.go index 2d1898d3f386..ae9528771bdc 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/storage/armstorage/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage diff --git a/sdk/resourcemanager/storage/armstorage/zz_generated_usages_client.go b/sdk/resourcemanager/storage/armstorage/usages_client.go similarity index 97% rename from sdk/resourcemanager/storage/armstorage/zz_generated_usages_client.go rename to sdk/resourcemanager/storage/armstorage/usages_client.go index ea1e3827c98c..b8f8ae1aaae8 100644 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_usages_client.go +++ b/sdk/resourcemanager/storage/armstorage/usages_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armstorage @@ -56,7 +57,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListByLocationPager - Gets the current usage count and the limit for the resources of the location under the subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01 +// Generated from API version 2022-05-01 // location - The location of the Azure Storage resource. // options - UsagesClientListByLocationOptions contains the optional parameters for the UsagesClient.ListByLocation method. func (client *UsagesClient) NewListByLocationPager(location string, options *UsagesClientListByLocationOptions) *runtime.Pager[UsagesClientListByLocationResponse] { @@ -97,7 +98,7 @@ func (client *UsagesClient) listByLocationCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01") + reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_blobcontainers_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_blobcontainers_client_test.go deleted file mode 100644 index 35b90b30ba4c..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_blobcontainers_client_test.go +++ /dev/null @@ -1,391 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersList.json -func ExampleBlobContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("res9290", - "sto1590", - &armstorage.BlobContainersClientListOptions{Maxpagesize: nil, - Filter: nil, - Include: 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersPutDefaultEncryptionScope.json -func ExampleBlobContainersClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "res3376", - "sto328", - "container6185", - armstorage.BlobContainer{ - ContainerProperties: &armstorage.ContainerProperties{ - DefaultEncryptionScope: to.Ptr("encryptionscope185"), - DenyEncryptionScopeOverride: to.Ptr(true), - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersPatch.json -func ExampleBlobContainersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "res3376", - "sto328", - "container6185", - armstorage.BlobContainer{ - ContainerProperties: &armstorage.ContainerProperties{ - Metadata: map[string]*string{ - "metadata": to.Ptr("true"), - }, - PublicAccess: to.Ptr(armstorage.PublicAccessContainer), - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersGetWithAllowProtectedAppendWritesAll.json -func ExampleBlobContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res9871", - "sto6217", - "container1634", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersDelete.json -func ExampleBlobContainersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res4079", - "sto4506", - "container9689", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersSetLegalHold.json -func ExampleBlobContainersClient_SetLegalHold() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SetLegalHold(ctx, - "res4303", - "sto7280", - "container8723", - armstorage.LegalHold{ - Tags: []*string{ - to.Ptr("tag1"), - to.Ptr("tag2"), - to.Ptr("tag3")}, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersClearLegalHold.json -func ExampleBlobContainersClient_ClearLegalHold() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ClearLegalHold(ctx, - "res4303", - "sto7280", - "container8723", - armstorage.LegalHold{ - Tags: []*string{ - to.Ptr("tag1"), - to.Ptr("tag2"), - to.Ptr("tag3")}, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersPutImmutabilityPolicy.json -func ExampleBlobContainersClient_CreateOrUpdateImmutabilityPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateImmutabilityPolicy(ctx, - "res1782", - "sto7069", - "container6397", - &armstorage.BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions{IfMatch: nil, - Parameters: &armstorage.ImmutabilityPolicy{ - Properties: &armstorage.ImmutabilityPolicyProperty{ - AllowProtectedAppendWrites: to.Ptr(true), - ImmutabilityPeriodSinceCreationInDays: to.Ptr[int32](3), - }, - }, - }) - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersGetImmutabilityPolicy.json -func ExampleBlobContainersClient_GetImmutabilityPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetImmutabilityPolicy(ctx, - "res5221", - "sto9177", - "container3489", - &armstorage.BlobContainersClientGetImmutabilityPolicyOptions{IfMatch: 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersDeleteImmutabilityPolicy.json -func ExampleBlobContainersClient_DeleteImmutabilityPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.DeleteImmutabilityPolicy(ctx, - "res1581", - "sto9621", - "container4910", - "\"8d59f81a7fa7be0\"", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersLockImmutabilityPolicy.json -func ExampleBlobContainersClient_LockImmutabilityPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.LockImmutabilityPolicy(ctx, - "res2702", - "sto5009", - "container1631", - "\"8d59f825b721dd3\"", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersExtendImmutabilityPolicy.json -func ExampleBlobContainersClient_ExtendImmutabilityPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ExtendImmutabilityPolicy(ctx, - "res6238", - "sto232", - "container5023", - "\"8d59f830d0c3bf9\"", - &armstorage.BlobContainersClientExtendImmutabilityPolicyOptions{Parameters: &armstorage.ImmutabilityPolicy{ - Properties: &armstorage.ImmutabilityPolicyProperty{ - ImmutabilityPeriodSinceCreationInDays: to.Ptr[int32](100), - }, - }, - }) - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobContainersLease_Acquire.json -func ExampleBlobContainersClient_Lease() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Lease(ctx, - "res3376", - "sto328", - "container6185", - &armstorage.BlobContainersClientLeaseOptions{Parameters: &armstorage.LeaseContainerRequest{ - Action: to.Ptr(armstorage.LeaseContainerRequestActionAcquire), - LeaseDuration: to.Ptr[int32](-1), - }, - }) - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/ObjectLevelWormContainerMigration.json -func ExampleBlobContainersClient_BeginObjectLevelWorm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobContainersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginObjectLevelWorm(ctx, - "res1782", - "sto7069", - "container6397", - 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/storage/armstorage/ze_generated_example_blobinventorypolicies_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_blobinventorypolicies_client_test.go deleted file mode 100644 index a37896ec18af..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_blobinventorypolicies_client_test.go +++ /dev/null @@ -1,177 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountGetBlobInventoryPolicy.json -func ExampleBlobInventoryPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobInventoryPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res7687", - "sto9699", - armstorage.BlobInventoryPolicyNameDefault, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountSetBlobInventoryPolicy.json -func ExampleBlobInventoryPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobInventoryPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "res7687", - "sto9699", - armstorage.BlobInventoryPolicyNameDefault, - armstorage.BlobInventoryPolicy{ - Properties: &armstorage.BlobInventoryPolicyProperties{ - Policy: &armstorage.BlobInventoryPolicySchema{ - Type: to.Ptr(armstorage.InventoryRuleTypeInventory), - Enabled: to.Ptr(true), - Rules: []*armstorage.BlobInventoryPolicyRule{ - { - Name: to.Ptr("inventoryPolicyRule1"), - Definition: &armstorage.BlobInventoryPolicyDefinition{ - Format: to.Ptr(armstorage.FormatCSV), - Filters: &armstorage.BlobInventoryPolicyFilter{ - BlobTypes: []*string{ - to.Ptr("blockBlob"), - to.Ptr("appendBlob"), - to.Ptr("pageBlob")}, - ExcludePrefix: []*string{ - to.Ptr("excludeprefix1"), - to.Ptr("excludeprefix2")}, - IncludeBlobVersions: to.Ptr(true), - IncludeSnapshots: to.Ptr(true), - PrefixMatch: []*string{ - to.Ptr("inventoryprefix1"), - to.Ptr("inventoryprefix2")}, - }, - ObjectType: to.Ptr(armstorage.ObjectTypeBlob), - Schedule: to.Ptr(armstorage.ScheduleDaily), - SchemaFields: []*string{ - to.Ptr("Name"), - to.Ptr("Creation-Time"), - to.Ptr("Last-Modified"), - to.Ptr("Content-Length"), - to.Ptr("Content-MD5"), - to.Ptr("BlobType"), - to.Ptr("AccessTier"), - to.Ptr("AccessTierChangeTime"), - to.Ptr("Snapshot"), - to.Ptr("VersionId"), - to.Ptr("IsCurrentVersion"), - to.Ptr("Metadata")}, - }, - Destination: to.Ptr("container1"), - Enabled: to.Ptr(true), - }, - { - Name: to.Ptr("inventoryPolicyRule2"), - Definition: &armstorage.BlobInventoryPolicyDefinition{ - Format: to.Ptr(armstorage.FormatParquet), - ObjectType: to.Ptr(armstorage.ObjectTypeContainer), - Schedule: to.Ptr(armstorage.ScheduleWeekly), - SchemaFields: []*string{ - to.Ptr("Name"), - to.Ptr("Last-Modified"), - to.Ptr("Metadata"), - to.Ptr("LeaseStatus"), - to.Ptr("LeaseState"), - to.Ptr("LeaseDuration"), - to.Ptr("PublicAccess"), - to.Ptr("HasImmutabilityPolicy"), - to.Ptr("HasLegalHold")}, - }, - Destination: to.Ptr("container2"), - Enabled: to.Ptr(true), - }}, - }, - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountDeleteBlobInventoryPolicy.json -func ExampleBlobInventoryPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobInventoryPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res6977", - "sto2527", - armstorage.BlobInventoryPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountListBlobInventoryPolicy.json -func ExampleBlobInventoryPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobInventoryPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("res7687", - "sto9699", - 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/storage/armstorage/ze_generated_example_blobservices_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_blobservices_client_test.go deleted file mode 100644 index f76d1f07ae48..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_blobservices_client_test.go +++ /dev/null @@ -1,98 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobServicesList.json -func ExampleBlobServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("res4410", - "sto8607", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobServicesPutAllowPermanentDelete.json -func ExampleBlobServicesClient_SetServiceProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SetServiceProperties(ctx, - "res4410", - "sto8607", - armstorage.BlobServiceProperties{ - BlobServiceProperties: &armstorage.BlobServicePropertiesProperties{ - DeleteRetentionPolicy: &armstorage.DeleteRetentionPolicy{ - AllowPermanentDelete: to.Ptr(true), - Days: to.Ptr[int32](300), - Enabled: to.Ptr(true), - }, - IsVersioningEnabled: to.Ptr(true), - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobServicesGet.json -func ExampleBlobServicesClient_GetServiceProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewBlobServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetServiceProperties(ctx, - "res4410", - "sto8607", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_deletedaccounts_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_deletedaccounts_client_test.go deleted file mode 100644 index 93249f20a7b6..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_deletedaccounts_client_test.go +++ /dev/null @@ -1,63 +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 armstorage_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/DeletedAccountList.json -func ExampleDeletedAccountsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewDeletedAccountsClient("{subscription-id}", 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 - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/DeletedAccountGet.json -func ExampleDeletedAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewDeletedAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sto1125", - "eastus", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_encryptionscopes_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_encryptionscopes_client_test.go deleted file mode 100644 index 8231ca95fefa..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_encryptionscopes_client_test.go +++ /dev/null @@ -1,122 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountPutEncryptionScope.json -func ExampleEncryptionScopesClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewEncryptionScopesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, - "resource-group-name", - "{storage-account-name}", - "{encryption-scope-name}", - armstorage.EncryptionScope{}, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountPatchEncryptionScope.json -func ExampleEncryptionScopesClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewEncryptionScopesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Patch(ctx, - "resource-group-name", - "{storage-account-name}", - "{encryption-scope-name}", - armstorage.EncryptionScope{ - EncryptionScopeProperties: &armstorage.EncryptionScopeProperties{ - KeyVaultProperties: &armstorage.EncryptionScopeKeyVaultProperties{ - KeyURI: to.Ptr("https://testvault.vault.core.windows.net/keys/key1/863425f1358359c"), - }, - Source: to.Ptr(armstorage.EncryptionScopeSourceMicrosoftKeyVault), - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountGetEncryptionScope.json -func ExampleEncryptionScopesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewEncryptionScopesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resource-group-name", - "{storage-account-name}", - "{encryption-scope-name}", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountEncryptionScopeList.json -func ExampleEncryptionScopesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewEncryptionScopesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("resource-group-name", - "{storage-account-name}", - 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/storage/armstorage/ze_generated_example_fileservices_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_fileservices_client_test.go deleted file mode 100644 index 0588eecd82fc..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_fileservices_client_test.go +++ /dev/null @@ -1,136 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileServicesList.json -func ExampleFileServicesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "res9290", - "sto1590", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileServicesPut.json -func ExampleFileServicesClient_SetServiceProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SetServiceProperties(ctx, - "res4410", - "sto8607", - armstorage.FileServiceProperties{ - FileServiceProperties: &armstorage.FileServicePropertiesProperties{ - Cors: &armstorage.CorsRules{ - CorsRules: []*armstorage.CorsRule{ - { - AllowedHeaders: []*string{ - to.Ptr("x-ms-meta-abc"), - to.Ptr("x-ms-meta-data*"), - to.Ptr("x-ms-meta-target*")}, - AllowedMethods: []*armstorage.CorsRuleAllowedMethodsItem{ - to.Ptr(armstorage.CorsRuleAllowedMethodsItemGET), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemHEAD), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemPOST), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemOPTIONS), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemMERGE), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemPUT)}, - AllowedOrigins: []*string{ - to.Ptr("http://www.contoso.com"), - to.Ptr("http://www.fabrikam.com")}, - ExposedHeaders: []*string{ - to.Ptr("x-ms-meta-*")}, - MaxAgeInSeconds: to.Ptr[int32](100), - }, - { - AllowedHeaders: []*string{ - to.Ptr("*")}, - AllowedMethods: []*armstorage.CorsRuleAllowedMethodsItem{ - to.Ptr(armstorage.CorsRuleAllowedMethodsItemGET)}, - AllowedOrigins: []*string{ - to.Ptr("*")}, - ExposedHeaders: []*string{ - to.Ptr("*")}, - MaxAgeInSeconds: to.Ptr[int32](2), - }, - { - AllowedHeaders: []*string{ - to.Ptr("x-ms-meta-12345675754564*")}, - AllowedMethods: []*armstorage.CorsRuleAllowedMethodsItem{ - to.Ptr(armstorage.CorsRuleAllowedMethodsItemGET), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemPUT)}, - AllowedOrigins: []*string{ - to.Ptr("http://www.abc23.com"), - to.Ptr("https://www.fabrikam.com/*")}, - ExposedHeaders: []*string{ - to.Ptr("x-ms-meta-abc"), - to.Ptr("x-ms-meta-data*"), - to.Ptr("x-ms-meta-target*")}, - MaxAgeInSeconds: to.Ptr[int32](2000), - }}, - }, - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileServicesGet.json -func ExampleFileServicesClient_GetServiceProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetServiceProperties(ctx, - "res4410", - "sto8607", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_fileshares_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_fileshares_client_test.go deleted file mode 100644 index b97263782dd9..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_fileshares_client_test.go +++ /dev/null @@ -1,214 +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 armstorage_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/DeletedFileSharesList.json -func ExampleFileSharesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileSharesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("res9290", - "sto1590", - &armstorage.FileSharesClientListOptions{Maxpagesize: nil, - Filter: nil, - Expand: to.Ptr("deleted"), - }) - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileSharesPut_NFS.json -func ExampleFileSharesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileSharesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "res346", - "sto666", - "share1235", - armstorage.FileShare{ - FileShareProperties: &armstorage.FileShareProperties{ - EnabledProtocols: to.Ptr(armstorage.EnabledProtocolsNFS), - }, - }, - &armstorage.FileSharesClientCreateOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileShareAclsPatch.json -func ExampleFileSharesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileSharesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "res3376", - "sto328", - "share6185", - armstorage.FileShare{ - FileShareProperties: &armstorage.FileShareProperties{ - SignedIdentifiers: []*armstorage.SignedIdentifier{ - { - AccessPolicy: &armstorage.AccessPolicy{ - ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-01T08:49:37.0000000Z"); return t }()), - Permission: to.Ptr("rwd"), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T08:49:37.0000000Z"); return t }()), - }, - ID: to.Ptr("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI"), - }}, - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileSharesGet_Stats.json -func ExampleFileSharesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileSharesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res9871", - "sto6217", - "share1634", - &armstorage.FileSharesClientGetOptions{Expand: to.Ptr("stats"), - XMSSnapshot: 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileSharesDelete.json -func ExampleFileSharesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileSharesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res4079", - "sto4506", - "share9689", - &armstorage.FileSharesClientDeleteOptions{XMSSnapshot: nil, - Include: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileSharesRestore.json -func ExampleFileSharesClient_Restore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileSharesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Restore(ctx, - "res3376", - "sto328", - "share1249", - armstorage.DeletedShare{ - DeletedShareName: to.Ptr("share1249"), - DeletedShareVersion: to.Ptr("1234567890"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/FileSharesLease_Acquire.json -func ExampleFileSharesClient_Lease() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewFileSharesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Lease(ctx, - "res3376", - "sto328", - "share124", - &armstorage.FileSharesClientLeaseOptions{XMSSnapshot: nil, - Parameters: &armstorage.LeaseShareRequest{ - Action: to.Ptr(armstorage.LeaseShareActionAcquire), - LeaseDuration: to.Ptr[int32](-1), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_localusers_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_localusers_client_test.go deleted file mode 100644 index 5c9ab1b1db63..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_localusers_client_test.go +++ /dev/null @@ -1,179 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/LocalUsersList.json -func ExampleLocalUsersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewLocalUsersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("res6977", - "sto2527", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/LocalUserGet.json -func ExampleLocalUsersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewLocalUsersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res6977", - "sto2527", - "user1", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/LocalUserCreate.json -func ExampleLocalUsersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewLocalUsersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "res6977", - "sto2527", - "user1", - armstorage.LocalUser{ - Properties: &armstorage.LocalUserProperties{ - HasSSHPassword: to.Ptr(true), - HomeDirectory: to.Ptr("homedirectory"), - PermissionScopes: []*armstorage.PermissionScope{ - { - Permissions: to.Ptr("rwd"), - ResourceName: to.Ptr("share1"), - Service: to.Ptr("file"), - }, - { - Permissions: to.Ptr("rw"), - ResourceName: to.Ptr("share2"), - Service: to.Ptr("file"), - }}, - SSHAuthorizedKeys: []*armstorage.SSHPublicKey{ - { - Description: to.Ptr("key name"), - Key: to.Ptr("ssh-rsa keykeykeykeykey="), - }}, - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/LocalUserDelete.json -func ExampleLocalUsersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewLocalUsersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res6977", - "sto2527", - "user1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/LocalUserListKeys.json -func ExampleLocalUsersClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewLocalUsersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "res6977", - "sto2527", - "user1", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/LocalUserRegeneratePassword.json -func ExampleLocalUsersClient_RegeneratePassword() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewLocalUsersClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegeneratePassword(ctx, - "res6977", - "sto2527", - "user1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_managementpolicies_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_managementpolicies_client_test.go deleted file mode 100644 index eca462f39832..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_managementpolicies_client_test.go +++ /dev/null @@ -1,160 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountGetManagementPolicy.json -func ExampleManagementPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewManagementPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res6977", - "sto2527", - armstorage.ManagementPolicyNameDefault, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountSetManagementPolicy.json -func ExampleManagementPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewManagementPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "res7687", - "sto9699", - armstorage.ManagementPolicyNameDefault, - armstorage.ManagementPolicy{ - Properties: &armstorage.ManagementPolicyProperties{ - Policy: &armstorage.ManagementPolicySchema{ - Rules: []*armstorage.ManagementPolicyRule{ - { - Name: to.Ptr("olcmtest1"), - Type: to.Ptr(armstorage.RuleTypeLifecycle), - Definition: &armstorage.ManagementPolicyDefinition{ - Actions: &armstorage.ManagementPolicyAction{ - BaseBlob: &armstorage.ManagementPolicyBaseBlob{ - Delete: &armstorage.DateAfterModification{ - DaysAfterModificationGreaterThan: to.Ptr[float32](1000), - }, - TierToArchive: &armstorage.DateAfterModification{ - DaysAfterModificationGreaterThan: to.Ptr[float32](90), - }, - TierToCool: &armstorage.DateAfterModification{ - DaysAfterModificationGreaterThan: to.Ptr[float32](30), - }, - }, - Snapshot: &armstorage.ManagementPolicySnapShot{ - Delete: &armstorage.DateAfterCreation{ - DaysAfterCreationGreaterThan: to.Ptr[float32](30), - }, - }, - }, - Filters: &armstorage.ManagementPolicyFilter{ - BlobTypes: []*string{ - to.Ptr("blockBlob")}, - PrefixMatch: []*string{ - to.Ptr("olcmtestcontainer1")}, - }, - }, - Enabled: to.Ptr(true), - }, - { - Name: to.Ptr("olcmtest2"), - Type: to.Ptr(armstorage.RuleTypeLifecycle), - Definition: &armstorage.ManagementPolicyDefinition{ - Actions: &armstorage.ManagementPolicyAction{ - BaseBlob: &armstorage.ManagementPolicyBaseBlob{ - Delete: &armstorage.DateAfterModification{ - DaysAfterModificationGreaterThan: to.Ptr[float32](1000), - }, - TierToArchive: &armstorage.DateAfterModification{ - DaysAfterModificationGreaterThan: to.Ptr[float32](90), - }, - TierToCool: &armstorage.DateAfterModification{ - DaysAfterModificationGreaterThan: to.Ptr[float32](30), - }, - }, - }, - Filters: &armstorage.ManagementPolicyFilter{ - BlobIndexMatch: []*armstorage.TagFilter{ - { - Name: to.Ptr("tag1"), - Op: to.Ptr("=="), - Value: to.Ptr("val1"), - }, - { - Name: to.Ptr("tag2"), - Op: to.Ptr("=="), - Value: to.Ptr("val2"), - }}, - BlobTypes: []*string{ - to.Ptr("blockBlob")}, - PrefixMatch: []*string{ - to.Ptr("olcmtestcontainer2")}, - }, - }, - Enabled: to.Ptr(true), - }}, - }, - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountDeleteManagementPolicy.json -func ExampleManagementPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewManagementPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res6977", - "sto2527", - armstorage.ManagementPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_objectreplicationpolicies_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_objectreplicationpolicies_client_test.go deleted file mode 100644 index 2d3807204b77..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_objectreplicationpolicies_client_test.go +++ /dev/null @@ -1,127 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountListObjectReplicationPolicies.json -func ExampleObjectReplicationPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewObjectReplicationPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("res6977", - "sto2527", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountGetObjectReplicationPolicy.json -func ExampleObjectReplicationPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewObjectReplicationPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res6977", - "sto2527", - "{objectReplicationPolicy-Id}", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountCreateObjectReplicationPolicyOnDestination.json -func ExampleObjectReplicationPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewObjectReplicationPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "res7687", - "dst112", - "default", - armstorage.ObjectReplicationPolicy{ - Properties: &armstorage.ObjectReplicationPolicyProperties{ - DestinationAccount: to.Ptr("dst112"), - Rules: []*armstorage.ObjectReplicationPolicyRule{ - { - DestinationContainer: to.Ptr("dcont139"), - Filters: &armstorage.ObjectReplicationPolicyFilter{ - PrefixMatch: []*string{ - to.Ptr("blobA"), - to.Ptr("blobB")}, - }, - SourceContainer: to.Ptr("scont139"), - }}, - SourceAccount: to.Ptr("src1122"), - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountDeleteObjectReplicationPolicy.json -func ExampleObjectReplicationPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewObjectReplicationPoliciesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res6977", - "sto2527", - "{objectReplicationPolicy-Id}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_operations_client_test.go deleted file mode 100644 index 9820765ef1c8..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_operations_client_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 armstorage_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/OperationsList.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 := armstorage.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/storage/armstorage/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index 3aa557d0e992..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_privateendpointconnections_client_test.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. - -package armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountListPrivateEndpointConnections.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewPrivateEndpointConnectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("res6977", - "sto2527", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountGetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewPrivateEndpointConnectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res6977", - "sto2527", - "{privateEndpointConnectionName}", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountPutPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewPrivateEndpointConnectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, - "res7687", - "sto9699", - "{privateEndpointConnectionName}", - armstorage.PrivateEndpointConnection{ - Properties: &armstorage.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armstorage.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armstorage.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountDeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewPrivateEndpointConnectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res6977", - "sto2527", - "{privateEndpointConnectionName}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 879cb5374755..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,39 +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 armstorage_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountListPrivateLinkResources.json -func ExamplePrivateLinkResourcesClient_ListByStorageAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewPrivateLinkResourcesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByStorageAccount(ctx, - "res6977", - "sto2527", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_queue_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_queue_client_test.go deleted file mode 100644 index 03a3f77f60e5..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_queue_client_test.go +++ /dev/null @@ -1,137 +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 armstorage_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/QueueOperationPut.json -func ExampleQueueClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewQueueClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "res3376", - "sto328", - "queue6185", - armstorage.Queue{}, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/QueueOperationPatch.json -func ExampleQueueClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewQueueClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "res3376", - "sto328", - "queue6185", - armstorage.Queue{}, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/QueueOperationGet.json -func ExampleQueueClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewQueueClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res3376", - "sto328", - "queue6185", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/QueueOperationDelete.json -func ExampleQueueClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewQueueClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res3376", - "sto328", - "queue6185", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/QueueOperationList.json -func ExampleQueueClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewQueueClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("res9290", - "sto328", - &armstorage.QueueClientListOptions{Maxpagesize: nil, - Filter: 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/storage/armstorage/ze_generated_example_queueservices_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_queueservices_client_test.go deleted file mode 100644 index 455217a2795e..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_queueservices_client_test.go +++ /dev/null @@ -1,136 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/QueueServicesList.json -func ExampleQueueServicesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewQueueServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "res9290", - "sto1590", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/QueueServicesPut.json -func ExampleQueueServicesClient_SetServiceProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewQueueServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SetServiceProperties(ctx, - "res4410", - "sto8607", - armstorage.QueueServiceProperties{ - QueueServiceProperties: &armstorage.QueueServicePropertiesProperties{ - Cors: &armstorage.CorsRules{ - CorsRules: []*armstorage.CorsRule{ - { - AllowedHeaders: []*string{ - to.Ptr("x-ms-meta-abc"), - to.Ptr("x-ms-meta-data*"), - to.Ptr("x-ms-meta-target*")}, - AllowedMethods: []*armstorage.CorsRuleAllowedMethodsItem{ - to.Ptr(armstorage.CorsRuleAllowedMethodsItemGET), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemHEAD), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemPOST), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemOPTIONS), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemMERGE), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemPUT)}, - AllowedOrigins: []*string{ - to.Ptr("http://www.contoso.com"), - to.Ptr("http://www.fabrikam.com")}, - ExposedHeaders: []*string{ - to.Ptr("x-ms-meta-*")}, - MaxAgeInSeconds: to.Ptr[int32](100), - }, - { - AllowedHeaders: []*string{ - to.Ptr("*")}, - AllowedMethods: []*armstorage.CorsRuleAllowedMethodsItem{ - to.Ptr(armstorage.CorsRuleAllowedMethodsItemGET)}, - AllowedOrigins: []*string{ - to.Ptr("*")}, - ExposedHeaders: []*string{ - to.Ptr("*")}, - MaxAgeInSeconds: to.Ptr[int32](2), - }, - { - AllowedHeaders: []*string{ - to.Ptr("x-ms-meta-12345675754564*")}, - AllowedMethods: []*armstorage.CorsRuleAllowedMethodsItem{ - to.Ptr(armstorage.CorsRuleAllowedMethodsItemGET), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemPUT)}, - AllowedOrigins: []*string{ - to.Ptr("http://www.abc23.com"), - to.Ptr("https://www.fabrikam.com/*")}, - ExposedHeaders: []*string{ - to.Ptr("x-ms-meta-abc"), - to.Ptr("x-ms-meta-data*"), - to.Ptr("x-ms-meta-target*")}, - MaxAgeInSeconds: to.Ptr[int32](2000), - }}, - }, - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/QueueServicesGet.json -func ExampleQueueServicesClient_GetServiceProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewQueueServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetServiceProperties(ctx, - "res4410", - "sto8607", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_skus_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_skus_client_test.go deleted file mode 100644 index ff09e910dd78..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_skus_client_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 armstorage_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/SKUList.json -func ExampleSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewSKUsClient("{subscription-id}", 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/storage/armstorage/ze_generated_example_storageaccounts_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_storageaccounts_client_test.go deleted file mode 100644 index f62d15aa926a..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_storageaccounts_client_test.go +++ /dev/null @@ -1,458 +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 armstorage_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountCheckNameAvailability.json -func ExampleAccountsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - armstorage.AccountCheckNameAvailabilityParameters{ - Name: to.Ptr("sto3363"), - Type: to.Ptr("Microsoft.Storage/storageAccounts"), - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/NfsV3AccountCreate.json -func ExampleAccountsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "res9101", - "sto4445", - armstorage.AccountCreateParameters{ - Kind: to.Ptr(armstorage.KindBlockBlobStorage), - Location: to.Ptr("eastus"), - Properties: &armstorage.AccountPropertiesCreateParameters{ - IsHnsEnabled: to.Ptr(true), - EnableNfsV3: to.Ptr(true), - NetworkRuleSet: &armstorage.NetworkRuleSet{ - Bypass: to.Ptr(armstorage.BypassAzureServices), - DefaultAction: to.Ptr(armstorage.DefaultActionAllow), - IPRules: []*armstorage.IPRule{}, - VirtualNetworkRules: []*armstorage.VirtualNetworkRule{ - { - VirtualNetworkResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12"), - }}, - }, - EnableHTTPSTrafficOnly: to.Ptr(false), - }, - SKU: &armstorage.SKU{ - Name: to.Ptr(armstorage.SKUNamePremiumLRS), - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountDelete.json -func ExampleAccountsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res4228", - "sto2434", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountGetAsyncSkuConversionStatus.json -func ExampleAccountsClient_GetProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetProperties(ctx, - "res9407", - "sto8596", - &armstorage.AccountsClientGetPropertiesOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountEnableAD.json -func ExampleAccountsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "res9407", - "sto8596", - armstorage.AccountUpdateParameters{ - Properties: &armstorage.AccountPropertiesUpdateParameters{ - AzureFilesIdentityBasedAuthentication: &armstorage.AzureFilesIdentityBasedAuthentication{ - ActiveDirectoryProperties: &armstorage.ActiveDirectoryProperties{ - AccountType: to.Ptr(armstorage.ActiveDirectoryPropertiesAccountTypeUser), - AzureStorageSid: to.Ptr("S-1-5-21-2400535526-2334094090-2402026252-0012"), - DomainGUID: to.Ptr("aebfc118-9fa9-4732-a21f-d98e41a77ae1"), - DomainName: to.Ptr("adtest.com"), - DomainSid: to.Ptr("S-1-5-21-2400535526-2334094090-2402026252"), - ForestName: to.Ptr("adtest.com"), - NetBiosDomainName: to.Ptr("adtest.com"), - SamAccountName: to.Ptr("sam12498"), - }, - DirectoryServiceOptions: to.Ptr(armstorage.DirectoryServiceOptionsAD), - }, - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountList.json -func ExampleAccountsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", 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 - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountListByResourceGroup.json -func ExampleAccountsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("res6117", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountListKeys.json -func ExampleAccountsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "res418", - "sto2220", - &armstorage.AccountsClientListKeysOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountRegenerateKerbKey.json -func ExampleAccountsClient_RegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegenerateKey(ctx, - "res4167", - "sto3539", - armstorage.AccountRegenerateKeyParameters{ - KeyName: to.Ptr("kerb1"), - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountListAccountSAS.json -func ExampleAccountsClient_ListAccountSAS() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListAccountSAS(ctx, - "res7985", - "sto8588", - armstorage.AccountSasParameters{ - KeyToSign: to.Ptr("key1"), - SharedAccessExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-24T11:42:03.1567373Z"); return t }()), - Permissions: to.Ptr(armstorage.PermissionsR), - Protocols: to.Ptr(armstorage.HTTPProtocolHTTPSHTTP), - ResourceTypes: to.Ptr(armstorage.SignedResourceTypesS), - Services: to.Ptr(armstorage.ServicesB), - SharedAccessStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-24T10:42:03.1567373Z"); return t }()), - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountListServiceSAS.json -func ExampleAccountsClient_ListServiceSAS() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListServiceSAS(ctx, - "res7439", - "sto1299", - armstorage.ServiceSasParameters{ - CanonicalizedResource: to.Ptr("/blob/sto1299/music"), - SharedAccessExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-05-24T11:32:48.8457197Z"); return t }()), - Permissions: to.Ptr(armstorage.PermissionsL), - Resource: to.Ptr(armstorage.SignedResourceC), - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountFailover.json -func ExampleAccountsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "res4228", - "sto2434", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountHierarchicalNamespaceMigration.json -func ExampleAccountsClient_BeginHierarchicalNamespaceMigration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginHierarchicalNamespaceMigration(ctx, - "res4228", - "sto2434", - "HnsOnValidationRequest", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountAbortHierarchicalNamespaceMigration.json -func ExampleAccountsClient_BeginAbortHierarchicalNamespaceMigration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAbortHierarchicalNamespaceMigration(ctx, - "res4228", - "sto2434", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/BlobRangesRestore.json -func ExampleAccountsClient_BeginRestoreBlobRanges() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestoreBlobRanges(ctx, - "res9101", - "sto4445", - armstorage.BlobRestoreParameters{ - BlobRanges: []*armstorage.BlobRestoreRange{ - { - EndRange: to.Ptr("container/blobpath2"), - StartRange: to.Ptr("container/blobpath1"), - }, - { - EndRange: to.Ptr(""), - StartRange: to.Ptr("container2/blobpath3"), - }}, - TimeToRestore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-20T15:30:00.0000000Z"); return t }()), - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountRevokeUserDelegationKeys.json -func ExampleAccountsClient_RevokeUserDelegationKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewAccountsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RevokeUserDelegationKeys(ctx, - "res4167", - "sto3539", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_table_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_table_client_test.go deleted file mode 100644 index 240dc859930c..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_table_client_test.go +++ /dev/null @@ -1,133 +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 armstorage_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/TableOperationPut.json -func ExampleTableClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewTableClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "res3376", - "sto328", - "table6185", - &armstorage.TableClientCreateOptions{Parameters: 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/TableOperationPatch.json -func ExampleTableClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewTableClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "res3376", - "sto328", - "table6185", - &armstorage.TableClientUpdateOptions{Parameters: 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/TableOperationGet.json -func ExampleTableClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewTableClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res3376", - "sto328", - "table6185", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/TableOperationDelete.json -func ExampleTableClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewTableClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "res3376", - "sto328", - "table6185", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/TableOperationList.json -func ExampleTableClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewTableClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("res9290", - "sto328", - 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/storage/armstorage/ze_generated_example_tableservices_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_tableservices_client_test.go deleted file mode 100644 index e59d96c324cf..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_tableservices_client_test.go +++ /dev/null @@ -1,136 +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 armstorage_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/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/TableServicesList.json -func ExampleTableServicesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewTableServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "res9290", - "sto1590", - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/TableServicesPut.json -func ExampleTableServicesClient_SetServiceProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewTableServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SetServiceProperties(ctx, - "res4410", - "sto8607", - armstorage.TableServiceProperties{ - TableServiceProperties: &armstorage.TableServicePropertiesProperties{ - Cors: &armstorage.CorsRules{ - CorsRules: []*armstorage.CorsRule{ - { - AllowedHeaders: []*string{ - to.Ptr("x-ms-meta-abc"), - to.Ptr("x-ms-meta-data*"), - to.Ptr("x-ms-meta-target*")}, - AllowedMethods: []*armstorage.CorsRuleAllowedMethodsItem{ - to.Ptr(armstorage.CorsRuleAllowedMethodsItemGET), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemHEAD), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemPOST), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemOPTIONS), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemMERGE), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemPUT)}, - AllowedOrigins: []*string{ - to.Ptr("http://www.contoso.com"), - to.Ptr("http://www.fabrikam.com")}, - ExposedHeaders: []*string{ - to.Ptr("x-ms-meta-*")}, - MaxAgeInSeconds: to.Ptr[int32](100), - }, - { - AllowedHeaders: []*string{ - to.Ptr("*")}, - AllowedMethods: []*armstorage.CorsRuleAllowedMethodsItem{ - to.Ptr(armstorage.CorsRuleAllowedMethodsItemGET)}, - AllowedOrigins: []*string{ - to.Ptr("*")}, - ExposedHeaders: []*string{ - to.Ptr("*")}, - MaxAgeInSeconds: to.Ptr[int32](2), - }, - { - AllowedHeaders: []*string{ - to.Ptr("x-ms-meta-12345675754564*")}, - AllowedMethods: []*armstorage.CorsRuleAllowedMethodsItem{ - to.Ptr(armstorage.CorsRuleAllowedMethodsItemGET), - to.Ptr(armstorage.CorsRuleAllowedMethodsItemPUT)}, - AllowedOrigins: []*string{ - to.Ptr("http://www.abc23.com"), - to.Ptr("https://www.fabrikam.com/*")}, - ExposedHeaders: []*string{ - to.Ptr("x-ms-meta-abc"), - to.Ptr("x-ms-meta-data*"), - to.Ptr("x-ms-meta-target*")}, - MaxAgeInSeconds: to.Ptr[int32](2000), - }}, - }, - }, - }, - 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/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/TableServicesGet.json -func ExampleTableServicesClient_GetServiceProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewTableServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetServiceProperties(ctx, - "res4410", - "sto8607", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storage/armstorage/ze_generated_example_usages_client_test.go b/sdk/resourcemanager/storage/armstorage/ze_generated_example_usages_client_test.go deleted file mode 100644 index 187e3d5e3972..000000000000 --- a/sdk/resourcemanager/storage/armstorage/ze_generated_example_usages_client_test.go +++ /dev/null @@ -1,42 +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 armstorage_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storage/resource-manager/Microsoft.Storage/stable/2021-09-01/examples/StorageAccountListLocationUsage.json -func ExampleUsagesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstorage.NewUsagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("eastus2(stage)", - 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/storage/armstorage/zz_generated_models_serde.go b/sdk/resourcemanager/storage/armstorage/zz_generated_models_serde.go deleted file mode 100644 index 11f8613adcaa..000000000000 --- a/sdk/resourcemanager/storage/armstorage/zz_generated_models_serde.go +++ /dev/null @@ -1,1551 +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 armstorage - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AccessPolicy. -func (a AccessPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expiryTime", a.ExpiryTime) - populate(objectMap, "permission", a.Permission) - populateTimeRFC3339(objectMap, "startTime", a.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicy. -func (a *AccessPolicy) 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", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "expiryTime": - err = unpopulateTimeRFC3339(val, "ExpiryTime", &a.ExpiryTime) - delete(rawMsg, key) - case "permission": - err = unpopulate(val, "Permission", &a.Permission) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Account. -func (a Account) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", a.ExtendedLocation) - populate(objectMap, "id", a.ID) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "kind", a.Kind) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AccountCreateParameters. -func (a AccountCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedLocation", a.ExtendedLocation) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "kind", a.Kind) - populate(objectMap, "location", a.Location) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccountKey. -func (a *AccountKey) 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", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &a.CreationTime) - delete(rawMsg, key) - case "keyName": - err = unpopulate(val, "KeyName", &a.KeyName) - delete(rawMsg, key) - case "permissions": - err = unpopulate(val, "Permissions", &a.Permissions) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AccountProperties. -func (a AccountProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accessTier", a.AccessTier) - populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess) - populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication) - populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess) - populate(objectMap, "allowedCopyScope", a.AllowedCopyScope) - populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication) - populate(objectMap, "blobRestoreStatus", a.BlobRestoreStatus) - populateTimeRFC3339(objectMap, "creationTime", a.CreationTime) - populate(objectMap, "customDomain", a.CustomDomain) - populate(objectMap, "dnsEndpointType", a.DNSEndpointType) - populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication) - populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly) - populate(objectMap, "isNfsV3Enabled", a.EnableNfsV3) - populate(objectMap, "encryption", a.Encryption) - populate(objectMap, "failoverInProgress", a.FailoverInProgress) - populate(objectMap, "geoReplicationStats", a.GeoReplicationStats) - populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning) - populate(objectMap, "isHnsEnabled", a.IsHnsEnabled) - populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled) - populate(objectMap, "isSftpEnabled", a.IsSftpEnabled) - populate(objectMap, "keyCreationTime", a.KeyCreationTime) - populate(objectMap, "keyPolicy", a.KeyPolicy) - populate(objectMap, "largeFileSharesState", a.LargeFileSharesState) - populateTimeRFC3339(objectMap, "lastGeoFailoverTime", a.LastGeoFailoverTime) - populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion) - populate(objectMap, "networkAcls", a.NetworkRuleSet) - populate(objectMap, "primaryEndpoints", a.PrimaryEndpoints) - populate(objectMap, "primaryLocation", a.PrimaryLocation) - populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess) - populate(objectMap, "routingPreference", a.RoutingPreference) - populate(objectMap, "sasPolicy", a.SasPolicy) - populate(objectMap, "secondaryEndpoints", a.SecondaryEndpoints) - populate(objectMap, "secondaryLocation", a.SecondaryLocation) - populate(objectMap, "statusOfPrimary", a.StatusOfPrimary) - populate(objectMap, "statusOfSecondary", a.StatusOfSecondary) - populate(objectMap, "storageAccountSkuConversionStatus", a.StorageAccountSKUConversionStatus) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccountProperties. -func (a *AccountProperties) 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", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "accessTier": - err = unpopulate(val, "AccessTier", &a.AccessTier) - delete(rawMsg, key) - case "allowBlobPublicAccess": - err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess) - delete(rawMsg, key) - case "allowCrossTenantReplication": - err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication) - delete(rawMsg, key) - case "allowSharedKeyAccess": - err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess) - delete(rawMsg, key) - case "allowedCopyScope": - err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope) - delete(rawMsg, key) - case "azureFilesIdentityBasedAuthentication": - err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication) - delete(rawMsg, key) - case "blobRestoreStatus": - err = unpopulate(val, "BlobRestoreStatus", &a.BlobRestoreStatus) - delete(rawMsg, key) - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &a.CreationTime) - delete(rawMsg, key) - case "customDomain": - err = unpopulate(val, "CustomDomain", &a.CustomDomain) - delete(rawMsg, key) - case "dnsEndpointType": - err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType) - delete(rawMsg, key) - case "defaultToOAuthAuthentication": - err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication) - delete(rawMsg, key) - case "supportsHttpsTrafficOnly": - err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly) - delete(rawMsg, key) - case "isNfsV3Enabled": - err = unpopulate(val, "EnableNfsV3", &a.EnableNfsV3) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &a.Encryption) - delete(rawMsg, key) - case "failoverInProgress": - err = unpopulate(val, "FailoverInProgress", &a.FailoverInProgress) - delete(rawMsg, key) - case "geoReplicationStats": - err = unpopulate(val, "GeoReplicationStats", &a.GeoReplicationStats) - delete(rawMsg, key) - case "immutableStorageWithVersioning": - err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning) - delete(rawMsg, key) - case "isHnsEnabled": - err = unpopulate(val, "IsHnsEnabled", &a.IsHnsEnabled) - delete(rawMsg, key) - case "isLocalUserEnabled": - err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled) - delete(rawMsg, key) - case "isSftpEnabled": - err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled) - delete(rawMsg, key) - case "keyCreationTime": - err = unpopulate(val, "KeyCreationTime", &a.KeyCreationTime) - delete(rawMsg, key) - case "keyPolicy": - err = unpopulate(val, "KeyPolicy", &a.KeyPolicy) - delete(rawMsg, key) - case "largeFileSharesState": - err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState) - delete(rawMsg, key) - case "lastGeoFailoverTime": - err = unpopulateTimeRFC3339(val, "LastGeoFailoverTime", &a.LastGeoFailoverTime) - delete(rawMsg, key) - case "minimumTlsVersion": - err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion) - delete(rawMsg, key) - case "networkAcls": - err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet) - delete(rawMsg, key) - case "primaryEndpoints": - err = unpopulate(val, "PrimaryEndpoints", &a.PrimaryEndpoints) - delete(rawMsg, key) - case "primaryLocation": - err = unpopulate(val, "PrimaryLocation", &a.PrimaryLocation) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &a.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess) - delete(rawMsg, key) - case "routingPreference": - err = unpopulate(val, "RoutingPreference", &a.RoutingPreference) - delete(rawMsg, key) - case "sasPolicy": - err = unpopulate(val, "SasPolicy", &a.SasPolicy) - delete(rawMsg, key) - case "secondaryEndpoints": - err = unpopulate(val, "SecondaryEndpoints", &a.SecondaryEndpoints) - delete(rawMsg, key) - case "secondaryLocation": - err = unpopulate(val, "SecondaryLocation", &a.SecondaryLocation) - delete(rawMsg, key) - case "statusOfPrimary": - err = unpopulate(val, "StatusOfPrimary", &a.StatusOfPrimary) - delete(rawMsg, key) - case "statusOfSecondary": - err = unpopulate(val, "StatusOfSecondary", &a.StatusOfSecondary) - delete(rawMsg, key) - case "storageAccountSkuConversionStatus": - err = unpopulate(val, "StorageAccountSKUConversionStatus", &a.StorageAccountSKUConversionStatus) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AccountSasParameters. -func (a AccountSasParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "signedIp", a.IPAddressOrRange) - populate(objectMap, "keyToSign", a.KeyToSign) - populate(objectMap, "signedPermission", a.Permissions) - populate(objectMap, "signedProtocol", a.Protocols) - populate(objectMap, "signedResourceTypes", a.ResourceTypes) - populate(objectMap, "signedServices", a.Services) - populateTimeRFC3339(objectMap, "signedExpiry", a.SharedAccessExpiryTime) - populateTimeRFC3339(objectMap, "signedStart", a.SharedAccessStartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSasParameters. -func (a *AccountSasParameters) 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", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "signedIp": - err = unpopulate(val, "IPAddressOrRange", &a.IPAddressOrRange) - delete(rawMsg, key) - case "keyToSign": - err = unpopulate(val, "KeyToSign", &a.KeyToSign) - delete(rawMsg, key) - case "signedPermission": - err = unpopulate(val, "Permissions", &a.Permissions) - delete(rawMsg, key) - case "signedProtocol": - err = unpopulate(val, "Protocols", &a.Protocols) - delete(rawMsg, key) - case "signedResourceTypes": - err = unpopulate(val, "ResourceTypes", &a.ResourceTypes) - delete(rawMsg, key) - case "signedServices": - err = unpopulate(val, "Services", &a.Services) - delete(rawMsg, key) - case "signedExpiry": - err = unpopulateTimeRFC3339(val, "SharedAccessExpiryTime", &a.SharedAccessExpiryTime) - delete(rawMsg, key) - case "signedStart": - err = unpopulateTimeRFC3339(val, "SharedAccessStartTime", &a.SharedAccessStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AccountUpdateParameters. -func (a AccountUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "kind", a.Kind) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BlobContainer. -func (b BlobContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", b.ContainerProperties) - populate(objectMap, "etag", b.Etag) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyDefinition. -func (b BlobInventoryPolicyDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filters", b.Filters) - populate(objectMap, "format", b.Format) - populate(objectMap, "objectType", b.ObjectType) - populate(objectMap, "schedule", b.Schedule) - populate(objectMap, "schemaFields", b.SchemaFields) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyFilter. -func (b BlobInventoryPolicyFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobTypes", b.BlobTypes) - populate(objectMap, "excludePrefix", b.ExcludePrefix) - populate(objectMap, "includeBlobVersions", b.IncludeBlobVersions) - populate(objectMap, "includeDeleted", b.IncludeDeleted) - populate(objectMap, "includeSnapshots", b.IncludeSnapshots) - populate(objectMap, "prefixMatch", b.PrefixMatch) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyProperties. -func (b BlobInventoryPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastModifiedTime", b.LastModifiedTime) - populate(objectMap, "policy", b.Policy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyProperties. -func (b *BlobInventoryPolicyProperties) 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 "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &b.LastModifiedTime) - delete(rawMsg, key) - case "policy": - err = unpopulate(val, "Policy", &b.Policy) - 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 BlobInventoryPolicySchema. -func (b BlobInventoryPolicySchema) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destination", b.Destination) - populate(objectMap, "enabled", b.Enabled) - populate(objectMap, "rules", b.Rules) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BlobRestoreParameters. -func (b BlobRestoreParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobRanges", b.BlobRanges) - populateTimeRFC3339(objectMap, "timeToRestore", b.TimeToRestore) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreParameters. -func (b *BlobRestoreParameters) 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 "blobRanges": - err = unpopulate(val, "BlobRanges", &b.BlobRanges) - delete(rawMsg, key) - case "timeToRestore": - err = unpopulateTimeRFC3339(val, "TimeToRestore", &b.TimeToRestore) - 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 ContainerProperties. -func (c ContainerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultEncryptionScope", c.DefaultEncryptionScope) - populate(objectMap, "deleted", c.Deleted) - populateTimeRFC3339(objectMap, "deletedTime", c.DeletedTime) - populate(objectMap, "denyEncryptionScopeOverride", c.DenyEncryptionScopeOverride) - populate(objectMap, "enableNfsV3AllSquash", c.EnableNfsV3AllSquash) - populate(objectMap, "enableNfsV3RootSquash", c.EnableNfsV3RootSquash) - populate(objectMap, "hasImmutabilityPolicy", c.HasImmutabilityPolicy) - populate(objectMap, "hasLegalHold", c.HasLegalHold) - populate(objectMap, "immutabilityPolicy", c.ImmutabilityPolicy) - populate(objectMap, "immutableStorageWithVersioning", c.ImmutableStorageWithVersioning) - populateTimeRFC3339(objectMap, "lastModifiedTime", c.LastModifiedTime) - populate(objectMap, "leaseDuration", c.LeaseDuration) - populate(objectMap, "leaseState", c.LeaseState) - populate(objectMap, "leaseStatus", c.LeaseStatus) - populate(objectMap, "legalHold", c.LegalHold) - populate(objectMap, "metadata", c.Metadata) - populate(objectMap, "publicAccess", c.PublicAccess) - populate(objectMap, "remainingRetentionDays", c.RemainingRetentionDays) - populate(objectMap, "version", c.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProperties. -func (c *ContainerProperties) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultEncryptionScope": - err = unpopulate(val, "DefaultEncryptionScope", &c.DefaultEncryptionScope) - delete(rawMsg, key) - case "deleted": - err = unpopulate(val, "Deleted", &c.Deleted) - delete(rawMsg, key) - case "deletedTime": - err = unpopulateTimeRFC3339(val, "DeletedTime", &c.DeletedTime) - delete(rawMsg, key) - case "denyEncryptionScopeOverride": - err = unpopulate(val, "DenyEncryptionScopeOverride", &c.DenyEncryptionScopeOverride) - delete(rawMsg, key) - case "enableNfsV3AllSquash": - err = unpopulate(val, "EnableNfsV3AllSquash", &c.EnableNfsV3AllSquash) - delete(rawMsg, key) - case "enableNfsV3RootSquash": - err = unpopulate(val, "EnableNfsV3RootSquash", &c.EnableNfsV3RootSquash) - delete(rawMsg, key) - case "hasImmutabilityPolicy": - err = unpopulate(val, "HasImmutabilityPolicy", &c.HasImmutabilityPolicy) - delete(rawMsg, key) - case "hasLegalHold": - err = unpopulate(val, "HasLegalHold", &c.HasLegalHold) - delete(rawMsg, key) - case "immutabilityPolicy": - err = unpopulate(val, "ImmutabilityPolicy", &c.ImmutabilityPolicy) - delete(rawMsg, key) - case "immutableStorageWithVersioning": - err = unpopulate(val, "ImmutableStorageWithVersioning", &c.ImmutableStorageWithVersioning) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &c.LastModifiedTime) - delete(rawMsg, key) - case "leaseDuration": - err = unpopulate(val, "LeaseDuration", &c.LeaseDuration) - delete(rawMsg, key) - case "leaseState": - err = unpopulate(val, "LeaseState", &c.LeaseState) - delete(rawMsg, key) - case "leaseStatus": - err = unpopulate(val, "LeaseStatus", &c.LeaseStatus) - delete(rawMsg, key) - case "legalHold": - err = unpopulate(val, "LegalHold", &c.LegalHold) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &c.Metadata) - delete(rawMsg, key) - case "publicAccess": - err = unpopulate(val, "PublicAccess", &c.PublicAccess) - delete(rawMsg, key) - case "remainingRetentionDays": - err = unpopulate(val, "RemainingRetentionDays", &c.RemainingRetentionDays) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &c.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CorsRule. -func (c CorsRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedHeaders", c.AllowedHeaders) - populate(objectMap, "allowedMethods", c.AllowedMethods) - populate(objectMap, "allowedOrigins", c.AllowedOrigins) - populate(objectMap, "exposedHeaders", c.ExposedHeaders) - populate(objectMap, "maxAgeInSeconds", c.MaxAgeInSeconds) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CorsRules. -func (c CorsRules) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "corsRules", c.CorsRules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionScope. -func (e EncryptionScope) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.EncryptionScopeProperties) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeKeyVaultProperties. -func (e EncryptionScopeKeyVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "currentVersionedKeyIdentifier", e.CurrentVersionedKeyIdentifier) - populate(objectMap, "keyUri", e.KeyURI) - populateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", e.LastKeyRotationTimestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeKeyVaultProperties. -func (e *EncryptionScopeKeyVaultProperties) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentVersionedKeyIdentifier": - err = unpopulate(val, "CurrentVersionedKeyIdentifier", &e.CurrentVersionedKeyIdentifier) - delete(rawMsg, key) - case "keyUri": - err = unpopulate(val, "KeyURI", &e.KeyURI) - delete(rawMsg, key) - case "lastKeyRotationTimestamp": - err = unpopulateTimeRFC3339(val, "LastKeyRotationTimestamp", &e.LastKeyRotationTimestamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeProperties. -func (e EncryptionScopeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", e.CreationTime) - populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) - populateTimeRFC3339(objectMap, "lastModifiedTime", e.LastModifiedTime) - populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption) - populate(objectMap, "source", e.Source) - populate(objectMap, "state", e.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeProperties. -func (e *EncryptionScopeProperties) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &e.CreationTime) - delete(rawMsg, key) - case "keyVaultProperties": - err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &e.LastModifiedTime) - delete(rawMsg, key) - case "requireInfrastructureEncryption": - err = unpopulate(val, "RequireInfrastructureEncryption", &e.RequireInfrastructureEncryption) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &e.Source) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionService. -func (e EncryptionService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", e.Enabled) - populate(objectMap, "keyType", e.KeyType) - populateTimeRFC3339(objectMap, "lastEnabledTime", e.LastEnabledTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionService. -func (e *EncryptionService) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &e.Enabled) - delete(rawMsg, key) - case "keyType": - err = unpopulate(val, "KeyType", &e.KeyType) - delete(rawMsg, key) - case "lastEnabledTime": - err = unpopulateTimeRFC3339(val, "LastEnabledTime", &e.LastEnabledTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FileShare. -func (f FileShare) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", f.Etag) - populate(objectMap, "properties", f.FileShareProperties) - populate(objectMap, "id", f.ID) - populate(objectMap, "name", f.Name) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FileShareProperties. -func (f FileShareProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accessTier", f.AccessTier) - populateTimeRFC3339(objectMap, "accessTierChangeTime", f.AccessTierChangeTime) - populate(objectMap, "accessTierStatus", f.AccessTierStatus) - populate(objectMap, "deleted", f.Deleted) - populateTimeRFC3339(objectMap, "deletedTime", f.DeletedTime) - populate(objectMap, "enabledProtocols", f.EnabledProtocols) - populateTimeRFC3339(objectMap, "lastModifiedTime", f.LastModifiedTime) - populate(objectMap, "leaseDuration", f.LeaseDuration) - populate(objectMap, "leaseState", f.LeaseState) - populate(objectMap, "leaseStatus", f.LeaseStatus) - populate(objectMap, "metadata", f.Metadata) - populate(objectMap, "remainingRetentionDays", f.RemainingRetentionDays) - populate(objectMap, "rootSquash", f.RootSquash) - populate(objectMap, "shareQuota", f.ShareQuota) - populate(objectMap, "shareUsageBytes", f.ShareUsageBytes) - populate(objectMap, "signedIdentifiers", f.SignedIdentifiers) - populateTimeRFC3339(objectMap, "snapshotTime", f.SnapshotTime) - populate(objectMap, "version", f.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareProperties. -func (f *FileShareProperties) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "accessTier": - err = unpopulate(val, "AccessTier", &f.AccessTier) - delete(rawMsg, key) - case "accessTierChangeTime": - err = unpopulateTimeRFC3339(val, "AccessTierChangeTime", &f.AccessTierChangeTime) - delete(rawMsg, key) - case "accessTierStatus": - err = unpopulate(val, "AccessTierStatus", &f.AccessTierStatus) - delete(rawMsg, key) - case "deleted": - err = unpopulate(val, "Deleted", &f.Deleted) - delete(rawMsg, key) - case "deletedTime": - err = unpopulateTimeRFC3339(val, "DeletedTime", &f.DeletedTime) - delete(rawMsg, key) - case "enabledProtocols": - err = unpopulate(val, "EnabledProtocols", &f.EnabledProtocols) - delete(rawMsg, key) - case "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &f.LastModifiedTime) - delete(rawMsg, key) - case "leaseDuration": - err = unpopulate(val, "LeaseDuration", &f.LeaseDuration) - delete(rawMsg, key) - case "leaseState": - err = unpopulate(val, "LeaseState", &f.LeaseState) - delete(rawMsg, key) - case "leaseStatus": - err = unpopulate(val, "LeaseStatus", &f.LeaseStatus) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &f.Metadata) - delete(rawMsg, key) - case "remainingRetentionDays": - err = unpopulate(val, "RemainingRetentionDays", &f.RemainingRetentionDays) - delete(rawMsg, key) - case "rootSquash": - err = unpopulate(val, "RootSquash", &f.RootSquash) - delete(rawMsg, key) - case "shareQuota": - err = unpopulate(val, "ShareQuota", &f.ShareQuota) - delete(rawMsg, key) - case "shareUsageBytes": - err = unpopulate(val, "ShareUsageBytes", &f.ShareUsageBytes) - delete(rawMsg, key) - case "signedIdentifiers": - err = unpopulate(val, "SignedIdentifiers", &f.SignedIdentifiers) - delete(rawMsg, key) - case "snapshotTime": - err = unpopulateTimeRFC3339(val, "SnapshotTime", &f.SnapshotTime) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &f.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GeoReplicationStats. -func (g GeoReplicationStats) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "canFailover", g.CanFailover) - populateTimeRFC3339(objectMap, "lastSyncTime", g.LastSyncTime) - populate(objectMap, "status", g.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GeoReplicationStats. -func (g *GeoReplicationStats) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "canFailover": - err = unpopulate(val, "CanFailover", &g.CanFailover) - delete(rawMsg, key) - case "lastSyncTime": - err = unpopulateTimeRFC3339(val, "LastSyncTime", &g.LastSyncTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &g.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - 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) -} - -// MarshalJSON implements the json.Marshaller interface for type ImmutabilityPolicyProperties. -func (i ImmutabilityPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", i.Etag) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "updateHistory", i.UpdateHistory) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ImmutableStorageWithVersioning. -func (i ImmutableStorageWithVersioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", i.Enabled) - populate(objectMap, "migrationState", i.MigrationState) - populateTimeRFC3339(objectMap, "timeStamp", i.TimeStamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutableStorageWithVersioning. -func (i *ImmutableStorageWithVersioning) 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 "enabled": - err = unpopulate(val, "Enabled", &i.Enabled) - delete(rawMsg, key) - case "migrationState": - err = unpopulate(val, "MigrationState", &i.MigrationState) - delete(rawMsg, key) - case "timeStamp": - err = unpopulateTimeRFC3339(val, "TimeStamp", &i.TimeStamp) - 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 KeyCreationTime. -func (k KeyCreationTime) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "key1", k.Key1) - populateTimeRFC3339(objectMap, "key2", k.Key2) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyCreationTime. -func (k *KeyCreationTime) 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", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "key1": - err = unpopulateTimeRFC3339(val, "Key1", &k.Key1) - delete(rawMsg, key) - case "key2": - err = unpopulateTimeRFC3339(val, "Key2", &k.Key2) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. -func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "currentVersionedKeyExpirationTimestamp", k.CurrentVersionedKeyExpirationTimestamp) - populate(objectMap, "currentVersionedKeyIdentifier", k.CurrentVersionedKeyIdentifier) - populate(objectMap, "keyname", k.KeyName) - populate(objectMap, "keyvaulturi", k.KeyVaultURI) - populate(objectMap, "keyversion", k.KeyVersion) - populateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", k.LastKeyRotationTimestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. -func (k *KeyVaultProperties) 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", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "currentVersionedKeyExpirationTimestamp": - err = unpopulateTimeRFC3339(val, "CurrentVersionedKeyExpirationTimestamp", &k.CurrentVersionedKeyExpirationTimestamp) - delete(rawMsg, key) - case "currentVersionedKeyIdentifier": - err = unpopulate(val, "CurrentVersionedKeyIdentifier", &k.CurrentVersionedKeyIdentifier) - delete(rawMsg, key) - case "keyname": - err = unpopulate(val, "KeyName", &k.KeyName) - delete(rawMsg, key) - case "keyvaulturi": - err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI) - delete(rawMsg, key) - case "keyversion": - err = unpopulate(val, "KeyVersion", &k.KeyVersion) - delete(rawMsg, key) - case "lastKeyRotationTimestamp": - err = unpopulateTimeRFC3339(val, "LastKeyRotationTimestamp", &k.LastKeyRotationTimestamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LastAccessTimeTrackingPolicy. -func (l LastAccessTimeTrackingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobType", l.BlobType) - populate(objectMap, "enable", l.Enable) - populate(objectMap, "name", l.Name) - populate(objectMap, "trackingGranularityInDays", l.TrackingGranularityInDays) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LegalHold. -func (l LegalHold) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowProtectedAppendWritesAll", l.AllowProtectedAppendWritesAll) - populate(objectMap, "hasLegalHold", l.HasLegalHold) - populate(objectMap, "tags", l.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LegalHoldProperties. -func (l LegalHoldProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hasLegalHold", l.HasLegalHold) - populate(objectMap, "protectedAppendWritesHistory", l.ProtectedAppendWritesHistory) - populate(objectMap, "tags", l.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ListQueueProperties. -func (l ListQueueProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metadata", l.Metadata) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LocalUserProperties. -func (l LocalUserProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hasSshKey", l.HasSSHKey) - populate(objectMap, "hasSshPassword", l.HasSSHPassword) - populate(objectMap, "hasSharedKey", l.HasSharedKey) - populate(objectMap, "homeDirectory", l.HomeDirectory) - populate(objectMap, "permissionScopes", l.PermissionScopes) - populate(objectMap, "sshAuthorizedKeys", l.SSHAuthorizedKeys) - populate(objectMap, "sid", l.Sid) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyFilter. -func (m ManagementPolicyFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobIndexMatch", m.BlobIndexMatch) - populate(objectMap, "blobTypes", m.BlobTypes) - populate(objectMap, "prefixMatch", m.PrefixMatch) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyProperties. -func (m ManagementPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastModifiedTime", m.LastModifiedTime) - populate(objectMap, "policy", m.Policy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyProperties. -func (m *ManagementPolicyProperties) 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 "lastModifiedTime": - err = unpopulateTimeRFC3339(val, "LastModifiedTime", &m.LastModifiedTime) - delete(rawMsg, key) - case "policy": - err = unpopulate(val, "Policy", &m.Policy) - 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 ManagementPolicySchema. -func (m ManagementPolicySchema) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "rules", m.Rules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. -func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bypass", n.Bypass) - populate(objectMap, "defaultAction", n.DefaultAction) - populate(objectMap, "ipRules", n.IPRules) - populate(objectMap, "resourceAccessRules", n.ResourceAccessRules) - populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyFilter. -func (o ObjectReplicationPolicyFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "minCreationTime", o.MinCreationTime) - populate(objectMap, "prefixMatch", o.PrefixMatch) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyProperties. -func (o ObjectReplicationPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "destinationAccount", o.DestinationAccount) - populateTimeRFC3339(objectMap, "enabledTime", o.EnabledTime) - populate(objectMap, "policyId", o.PolicyID) - populate(objectMap, "rules", o.Rules) - populate(objectMap, "sourceAccount", o.SourceAccount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyProperties. -func (o *ObjectReplicationPolicyProperties) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationAccount": - err = unpopulate(val, "DestinationAccount", &o.DestinationAccount) - delete(rawMsg, key) - case "enabledTime": - err = unpopulateTimeRFC3339(val, "EnabledTime", &o.EnabledTime) - delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &o.PolicyID) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &o.Rules) - delete(rawMsg, key) - case "sourceAccount": - err = unpopulate(val, "SourceAccount", &o.SourceAccount) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProtectedAppendWritesHistory. -func (p ProtectedAppendWritesHistory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowProtectedAppendWritesAll", p.AllowProtectedAppendWritesAll) - populateTimeRFC3339(objectMap, "timestamp", p.Timestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedAppendWritesHistory. -func (p *ProtectedAppendWritesHistory) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowProtectedAppendWritesAll": - err = unpopulate(val, "AllowProtectedAppendWritesAll", &p.AllowProtectedAppendWritesAll) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &p.Timestamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Queue. -func (q Queue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", q.ID) - populate(objectMap, "name", q.Name) - populate(objectMap, "properties", q.QueueProperties) - populate(objectMap, "type", q.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type QueueProperties. -func (q QueueProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "approximateMessageCount", q.ApproximateMessageCount) - populate(objectMap, "metadata", q.Metadata) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorePolicyProperties. -func (r RestorePolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "days", r.Days) - populate(objectMap, "enabled", r.Enabled) - populateTimeRFC3339(objectMap, "lastEnabledTime", r.LastEnabledTime) - populateTimeRFC3339(objectMap, "minRestoreTime", r.MinRestoreTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePolicyProperties. -func (r *RestorePolicyProperties) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "days": - err = unpopulate(val, "Days", &r.Days) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - case "lastEnabledTime": - err = unpopulateTimeRFC3339(val, "LastEnabledTime", &r.LastEnabledTime) - delete(rawMsg, key) - case "minRestoreTime": - err = unpopulateTimeRFC3339(val, "MinRestoreTime", &r.MinRestoreTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceSasParameters. -func (s ServiceSasParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "rscc", s.CacheControl) - populate(objectMap, "canonicalizedResource", s.CanonicalizedResource) - populate(objectMap, "rscd", s.ContentDisposition) - populate(objectMap, "rsce", s.ContentEncoding) - populate(objectMap, "rscl", s.ContentLanguage) - populate(objectMap, "rsct", s.ContentType) - populate(objectMap, "signedIp", s.IPAddressOrRange) - populate(objectMap, "signedIdentifier", s.Identifier) - populate(objectMap, "keyToSign", s.KeyToSign) - populate(objectMap, "endPk", s.PartitionKeyEnd) - populate(objectMap, "startPk", s.PartitionKeyStart) - populate(objectMap, "signedPermission", s.Permissions) - populate(objectMap, "signedProtocol", s.Protocols) - populate(objectMap, "signedResource", s.Resource) - populate(objectMap, "endRk", s.RowKeyEnd) - populate(objectMap, "startRk", s.RowKeyStart) - populateTimeRFC3339(objectMap, "signedExpiry", s.SharedAccessExpiryTime) - populateTimeRFC3339(objectMap, "signedStart", s.SharedAccessStartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSasParameters. -func (s *ServiceSasParameters) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "rscc": - err = unpopulate(val, "CacheControl", &s.CacheControl) - delete(rawMsg, key) - case "canonicalizedResource": - err = unpopulate(val, "CanonicalizedResource", &s.CanonicalizedResource) - delete(rawMsg, key) - case "rscd": - err = unpopulate(val, "ContentDisposition", &s.ContentDisposition) - delete(rawMsg, key) - case "rsce": - err = unpopulate(val, "ContentEncoding", &s.ContentEncoding) - delete(rawMsg, key) - case "rscl": - err = unpopulate(val, "ContentLanguage", &s.ContentLanguage) - delete(rawMsg, key) - case "rsct": - err = unpopulate(val, "ContentType", &s.ContentType) - delete(rawMsg, key) - case "signedIp": - err = unpopulate(val, "IPAddressOrRange", &s.IPAddressOrRange) - delete(rawMsg, key) - case "signedIdentifier": - err = unpopulate(val, "Identifier", &s.Identifier) - delete(rawMsg, key) - case "keyToSign": - err = unpopulate(val, "KeyToSign", &s.KeyToSign) - delete(rawMsg, key) - case "endPk": - err = unpopulate(val, "PartitionKeyEnd", &s.PartitionKeyEnd) - delete(rawMsg, key) - case "startPk": - err = unpopulate(val, "PartitionKeyStart", &s.PartitionKeyStart) - delete(rawMsg, key) - case "signedPermission": - err = unpopulate(val, "Permissions", &s.Permissions) - delete(rawMsg, key) - case "signedProtocol": - err = unpopulate(val, "Protocols", &s.Protocols) - delete(rawMsg, key) - case "signedResource": - err = unpopulate(val, "Resource", &s.Resource) - delete(rawMsg, key) - case "endRk": - err = unpopulate(val, "RowKeyEnd", &s.RowKeyEnd) - delete(rawMsg, key) - case "startRk": - err = unpopulate(val, "RowKeyStart", &s.RowKeyStart) - delete(rawMsg, key) - case "signedExpiry": - err = unpopulateTimeRFC3339(val, "SharedAccessExpiryTime", &s.SharedAccessExpiryTime) - delete(rawMsg, key) - case "signedStart": - err = unpopulateTimeRFC3339(val, "SharedAccessStartTime", &s.SharedAccessStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Table. -func (t Table) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.TableProperties) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TableAccessPolicy. -func (t TableAccessPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expiryTime", t.ExpiryTime) - populate(objectMap, "permission", t.Permission) - populateTimeRFC3339(objectMap, "startTime", t.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TableAccessPolicy. -func (t *TableAccessPolicy) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "expiryTime": - err = unpopulateTimeRFC3339(val, "ExpiryTime", &t.ExpiryTime) - delete(rawMsg, key) - case "permission": - err = unpopulate(val, "Permission", &t.Permission) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &t.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TableProperties. -func (t TableProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "signedIdentifiers", t.SignedIdentifiers) - populate(objectMap, "tableName", t.TableName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TagProperty. -func (t TagProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "objectIdentifier", t.ObjectIdentifier) - populate(objectMap, "tag", t.Tag) - populate(objectMap, "tenantId", t.TenantID) - populateTimeRFC3339(objectMap, "timestamp", t.Timestamp) - populate(objectMap, "upn", t.Upn) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TagProperty. -func (t *TagProperty) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "objectIdentifier": - err = unpopulate(val, "ObjectIdentifier", &t.ObjectIdentifier) - delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &t.Tag) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &t.TenantID) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &t.Timestamp) - delete(rawMsg, key) - case "upn": - err = unpopulate(val, "Upn", &t.Upn) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UpdateHistoryProperty. -func (u UpdateHistoryProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowProtectedAppendWrites", u.AllowProtectedAppendWrites) - populate(objectMap, "allowProtectedAppendWritesAll", u.AllowProtectedAppendWritesAll) - populate(objectMap, "immutabilityPeriodSinceCreationInDays", u.ImmutabilityPeriodSinceCreationInDays) - populate(objectMap, "objectIdentifier", u.ObjectIdentifier) - populate(objectMap, "tenantId", u.TenantID) - populateTimeRFC3339(objectMap, "timestamp", u.Timestamp) - populate(objectMap, "update", u.Update) - populate(objectMap, "upn", u.Upn) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateHistoryProperty. -func (u *UpdateHistoryProperty) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowProtectedAppendWrites": - err = unpopulate(val, "AllowProtectedAppendWrites", &u.AllowProtectedAppendWrites) - delete(rawMsg, key) - case "allowProtectedAppendWritesAll": - err = unpopulate(val, "AllowProtectedAppendWritesAll", &u.AllowProtectedAppendWritesAll) - delete(rawMsg, key) - case "immutabilityPeriodSinceCreationInDays": - err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &u.ImmutabilityPeriodSinceCreationInDays) - delete(rawMsg, key) - case "objectIdentifier": - err = unpopulate(val, "ObjectIdentifier", &u.ObjectIdentifier) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &u.TenantID) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &u.Timestamp) - delete(rawMsg, key) - case "update": - err = unpopulate(val, "Update", &u.Update) - delete(rawMsg, key) - case "upn": - err = unpopulate(val, "Upn", &u.Upn) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}