diff --git a/sdk/resourcemanager/storagesync/armstoragesync/CHANGELOG.md b/sdk/resourcemanager/storagesync/armstoragesync/CHANGELOG.md index 3e52b7f07766..6eca2daa437d 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/CHANGELOG.md +++ b/sdk/resourcemanager/storagesync/armstoragesync/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History +## 1.1.0 (2022-09-01) +### Features Added + +- New const `CloudTieringLowDiskModeStateDisabled` +- New const `CloudTieringLowDiskModeStateEnabled` +- New type alias `CloudTieringLowDiskModeState` +- New function `PossibleCloudTieringLowDiskModeStateValues() []CloudTieringLowDiskModeState` +- New function `*CloudEndpointsClient.AfsShareMetadataCertificatePublicKeys(context.Context, string, string, string, string, *CloudEndpointsClientAfsShareMetadataCertificatePublicKeysOptions) (CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse, error)` +- New struct `CloudEndpointAfsShareMetadataCertificatePublicKeys` +- New struct `CloudEndpointsClientAfsShareMetadataCertificatePublicKeysOptions` +- New struct `CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse` +- New struct `CloudTieringLowDiskMode` +- New field `LowDiskMode` in struct `ServerEndpointCloudTieringStatus` + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagesync/armstoragesync` 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/storagesync/armstoragesync/autorest.md b/sdk/resourcemanager/storagesync/armstoragesync/autorest.md index dd4d334a85e5..7c68b18afc5d 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/autorest.md +++ b/sdk/resourcemanager/storagesync/armstoragesync/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storagesync/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/storagesync/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/storagesync/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/storagesync/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_cloudendpoints_client.go b/sdk/resourcemanager/storagesync/armstoragesync/cloudendpoints_client.go similarity index 88% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_cloudendpoints_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/cloudendpoints_client.go index 27f8496860b2..676e3ade7a7e 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_cloudendpoints_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/cloudendpoints_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 armstoragesync @@ -54,9 +55,82 @@ func NewCloudEndpointsClient(subscriptionID string, credential azcore.TokenCrede return client, nil } +// AfsShareMetadataCertificatePublicKeys - Get the AFS file share metadata signing certificate public keys. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-06-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// storageSyncServiceName - Name of Storage Sync Service resource. +// syncGroupName - Name of Sync Group resource. +// cloudEndpointName - Name of Cloud Endpoint object. +// options - CloudEndpointsClientAfsShareMetadataCertificatePublicKeysOptions contains the optional parameters for the CloudEndpointsClient.AfsShareMetadataCertificatePublicKeys +// method. +func (client *CloudEndpointsClient) AfsShareMetadataCertificatePublicKeys(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, options *CloudEndpointsClientAfsShareMetadataCertificatePublicKeysOptions) (CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse, error) { + req, err := client.afsShareMetadataCertificatePublicKeysCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, options) + if err != nil { + return CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse{}, runtime.NewResponseError(resp) + } + return client.afsShareMetadataCertificatePublicKeysHandleResponse(resp) +} + +// afsShareMetadataCertificatePublicKeysCreateRequest creates the AfsShareMetadataCertificatePublicKeys request. +func (client *CloudEndpointsClient) afsShareMetadataCertificatePublicKeysCreateRequest(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, options *CloudEndpointsClientAfsShareMetadataCertificatePublicKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints/{cloudEndpointName}/afsShareMetadataCertificatePublicKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if storageSyncServiceName == "" { + return nil, errors.New("parameter storageSyncServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{storageSyncServiceName}", url.PathEscape(storageSyncServiceName)) + if syncGroupName == "" { + return nil, errors.New("parameter syncGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{syncGroupName}", url.PathEscape(syncGroupName)) + if cloudEndpointName == "" { + return nil, errors.New("parameter cloudEndpointName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{cloudEndpointName}", url.PathEscape(cloudEndpointName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-06-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// afsShareMetadataCertificatePublicKeysHandleResponse handles the AfsShareMetadataCertificatePublicKeys response. +func (client *CloudEndpointsClient) afsShareMetadataCertificatePublicKeysHandleResponse(resp *http.Response) (CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse, error) { + result := CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse{} + if val := resp.Header.Get("x-ms-request-id"); val != "" { + result.XMSRequestID = &val + } + if val := resp.Header.Get("x-ms-correlation-request-id"); val != "" { + result.XMSCorrelationRequestID = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.CloudEndpointAfsShareMetadataCertificatePublicKeys); err != nil { + return CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse{}, err + } + return result, nil +} + // BeginCreate - Create a new CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -78,7 +152,7 @@ func (client *CloudEndpointsClient) BeginCreate(ctx context.Context, resourceGro // Create - Create a new CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *CloudEndpointsClient) create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters CloudEndpointCreateParameters, options *CloudEndpointsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, options) if err != nil { @@ -122,7 +196,7 @@ func (client *CloudEndpointsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -130,7 +204,7 @@ func (client *CloudEndpointsClient) createCreateRequest(ctx context.Context, res // BeginDelete - Delete a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -151,7 +225,7 @@ func (client *CloudEndpointsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *CloudEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, options *CloudEndpointsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, options) if err != nil { @@ -195,7 +269,7 @@ func (client *CloudEndpointsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +277,7 @@ func (client *CloudEndpointsClient) deleteCreateRequest(ctx context.Context, res // Get - Get a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -252,7 +326,7 @@ func (client *CloudEndpointsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,7 +349,7 @@ func (client *CloudEndpointsClient) getHandleResponse(resp *http.Response) (Clou // NewListBySyncGroupPager - Get a CloudEndpoint List. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -327,7 +401,7 @@ func (client *CloudEndpointsClient) listBySyncGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +424,7 @@ func (client *CloudEndpointsClient) listBySyncGroupHandleResponse(resp *http.Res // BeginPostBackup - Post Backup a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -372,7 +446,7 @@ func (client *CloudEndpointsClient) BeginPostBackup(ctx context.Context, resourc // PostBackup - Post Backup a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *CloudEndpointsClient) postBackup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters BackupRequest, options *CloudEndpointsClientBeginPostBackupOptions) (*http.Response, error) { req, err := client.postBackupCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, options) if err != nil { @@ -416,7 +490,7 @@ func (client *CloudEndpointsClient) postBackupCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -424,7 +498,7 @@ func (client *CloudEndpointsClient) postBackupCreateRequest(ctx context.Context, // BeginPostRestore - Post Restore a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -446,7 +520,7 @@ func (client *CloudEndpointsClient) BeginPostRestore(ctx context.Context, resour // PostRestore - Post Restore a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *CloudEndpointsClient) postRestore(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters PostRestoreRequest, options *CloudEndpointsClientBeginPostRestoreOptions) (*http.Response, error) { req, err := client.postRestoreCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, options) if err != nil { @@ -490,7 +564,7 @@ func (client *CloudEndpointsClient) postRestoreCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -498,7 +572,7 @@ func (client *CloudEndpointsClient) postRestoreCreateRequest(ctx context.Context // BeginPreBackup - Pre Backup a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -520,7 +594,7 @@ func (client *CloudEndpointsClient) BeginPreBackup(ctx context.Context, resource // PreBackup - Pre Backup a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *CloudEndpointsClient) preBackup(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters BackupRequest, options *CloudEndpointsClientBeginPreBackupOptions) (*http.Response, error) { req, err := client.preBackupCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, options) if err != nil { @@ -564,7 +638,7 @@ func (client *CloudEndpointsClient) preBackupCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -572,7 +646,7 @@ func (client *CloudEndpointsClient) preBackupCreateRequest(ctx context.Context, // BeginPreRestore - Pre Restore a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -594,7 +668,7 @@ func (client *CloudEndpointsClient) BeginPreRestore(ctx context.Context, resourc // PreRestore - Pre Restore a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *CloudEndpointsClient) preRestore(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters PreRestoreRequest, options *CloudEndpointsClientBeginPreRestoreOptions) (*http.Response, error) { req, err := client.preRestoreCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, options) if err != nil { @@ -638,7 +712,7 @@ func (client *CloudEndpointsClient) preRestoreCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -646,7 +720,7 @@ func (client *CloudEndpointsClient) preRestoreCreateRequest(ctx context.Context, // Restoreheartbeat - Restore Heartbeat a given CloudEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -696,7 +770,7 @@ func (client *CloudEndpointsClient) restoreheartbeatCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -717,7 +791,7 @@ func (client *CloudEndpointsClient) restoreheartbeatHandleResponse(resp *http.Re // BeginTriggerChangeDetection - Triggers detection of changes performed on Azure File share connected to the specified Azure // File Sync Cloud Endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -740,7 +814,7 @@ func (client *CloudEndpointsClient) BeginTriggerChangeDetection(ctx context.Cont // TriggerChangeDetection - Triggers detection of changes performed on Azure File share connected to the specified Azure File // Sync Cloud Endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *CloudEndpointsClient) triggerChangeDetection(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, cloudEndpointName string, parameters TriggerChangeDetectionParameters, options *CloudEndpointsClientBeginTriggerChangeDetectionOptions) (*http.Response, error) { req, err := client.triggerChangeDetectionCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, options) if err != nil { @@ -784,7 +858,7 @@ func (client *CloudEndpointsClient) triggerChangeDetectionCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-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/storagesync/armstoragesync/zz_generated_constants.go b/sdk/resourcemanager/storagesync/armstoragesync/constants.go similarity index 95% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_constants.go rename to sdk/resourcemanager/storagesync/armstoragesync/constants.go index b1bfcaa9e503..a366276a64f4 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_constants.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/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 armstoragesync const ( moduleName = "armstoragesync" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) // ChangeDetectionMode - Change Detection Mode. Applies to a directory specified in directoryPath parameter. @@ -61,6 +62,22 @@ func PossibleCloudEndpointChangeEnumerationTotalCountsStateValues() []CloudEndpo } } +// CloudTieringLowDiskModeState - Type of the cloud tiering low disk mode state +type CloudTieringLowDiskModeState string + +const ( + CloudTieringLowDiskModeStateDisabled CloudTieringLowDiskModeState = "Disabled" + CloudTieringLowDiskModeStateEnabled CloudTieringLowDiskModeState = "Enabled" +) + +// PossibleCloudTieringLowDiskModeStateValues returns the possible values for the CloudTieringLowDiskModeState const type. +func PossibleCloudTieringLowDiskModeStateValues() []CloudTieringLowDiskModeState { + return []CloudTieringLowDiskModeState{ + CloudTieringLowDiskModeStateDisabled, + CloudTieringLowDiskModeStateEnabled, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string diff --git a/sdk/resourcemanager/storagesync/armstoragesync/go.mod b/sdk/resourcemanager/storagesync/armstoragesync/go.mod index 4ead94506640..055dedb313cb 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/go.mod +++ b/sdk/resourcemanager/storagesync/armstoragesync/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagesync/armstor 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 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/storagesync/armstoragesync/go.sum b/sdk/resourcemanager/storagesync/armstoragesync/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/go.sum +++ b/sdk/resourcemanager/storagesync/armstoragesync/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_microsoftstoragesync_client.go b/sdk/resourcemanager/storagesync/armstoragesync/microsoftstoragesync_client.go similarity index 98% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_microsoftstoragesync_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/microsoftstoragesync_client.go index ec701fd2a39b..d1cdd3e71cf5 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_microsoftstoragesync_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/microsoftstoragesync_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 armstoragesync @@ -56,7 +57,7 @@ func NewMicrosoftStorageSyncClient(subscriptionID string, credential azcore.Toke // LocationOperationStatus - Get Operation status // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // locationName - The desired region to obtain information from. // operationID - operation Id // options - MicrosoftStorageSyncClientLocationOperationStatusOptions contains the optional parameters for the MicrosoftStorageSyncClient.LocationOperationStatus @@ -96,7 +97,7 @@ func (client *MicrosoftStorageSyncClient) locationOperationStatusCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_models.go b/sdk/resourcemanager/storagesync/armstoragesync/models.go similarity index 98% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_models.go rename to sdk/resourcemanager/storagesync/armstoragesync/models.go index 004b159b1b9b..acc722d28246 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_models.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/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 armstoragesync @@ -39,7 +40,8 @@ type CheckNameAvailabilityParameters struct { // REQUIRED; The name to check for availability Name *string `json:"name,omitempty"` - // REQUIRED; The resource type. Must be set to Microsoft.StorageSync/storageSyncServices + // CONSTANT; The resource type. Must be set to Microsoft.StorageSync/storageSyncServices + // Field has constant value "Microsoft.StorageSync/storageSyncServices", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -75,6 +77,16 @@ type CloudEndpoint struct { Type *string `json:"type,omitempty" azure:"ro"` } +// CloudEndpointAfsShareMetadataCertificatePublicKeys - Cloud endpoint AFS file share metadata signing certificate public +// keys. +type CloudEndpointAfsShareMetadataCertificatePublicKeys struct { + // READ-ONLY; The first public key. + FirstKey *string `json:"firstKey,omitempty" azure:"ro"` + + // READ-ONLY; The second public key. + SecondKey *string `json:"secondKey,omitempty" azure:"ro"` +} + // CloudEndpointArray - Array of CloudEndpoint type CloudEndpointArray struct { // Collection of CloudEndpoint. @@ -222,6 +234,12 @@ type CloudEndpointProperties struct { ChangeEnumerationStatus *CloudEndpointChangeEnumerationStatus `json:"changeEnumerationStatus,omitempty" azure:"ro"` } +// CloudEndpointsClientAfsShareMetadataCertificatePublicKeysOptions contains the optional parameters for the CloudEndpointsClient.AfsShareMetadataCertificatePublicKeys +// method. +type CloudEndpointsClientAfsShareMetadataCertificatePublicKeysOptions struct { + // placeholder for future optional parameters +} + // CloudEndpointsClientBeginCreateOptions contains the optional parameters for the CloudEndpointsClient.BeginCreate method. type CloudEndpointsClientBeginCreateOptions struct { // Resumes the LRO from the provided token. @@ -322,6 +340,15 @@ type CloudTieringFilesNotTiering struct { TotalFileCount *int64 `json:"totalFileCount,omitempty" azure:"ro"` } +// CloudTieringLowDiskMode - Information regarding the low disk mode state +type CloudTieringLowDiskMode struct { + // READ-ONLY; Last updated timestamp + LastUpdatedTimestamp *time.Time `json:"lastUpdatedTimestamp,omitempty" azure:"ro"` + + // READ-ONLY; Low disk mode state + State *CloudTieringLowDiskModeState `json:"state,omitempty" azure:"ro"` +} + // CloudTieringSpaceSavings - Server endpoint cloud tiering status object. type CloudTieringSpaceSavings struct { // READ-ONLY; Cached content size on the server @@ -1069,6 +1096,9 @@ type ServerEndpointCloudTieringStatus struct { // READ-ONLY; Last updated timestamp LastUpdatedTimestamp *time.Time `json:"lastUpdatedTimestamp,omitempty" azure:"ro"` + // READ-ONLY; Information regarding the low disk mode state + LowDiskMode *CloudTieringLowDiskMode `json:"lowDiskMode,omitempty" azure:"ro"` + // READ-ONLY; Information regarding how much local space cloud tiering is saving. SpaceSavings *CloudTieringSpaceSavings `json:"spaceSavings,omitempty" azure:"ro"` diff --git a/sdk/resourcemanager/storagesync/armstoragesync/models_serde.go b/sdk/resourcemanager/storagesync/armstoragesync/models_serde.go new file mode 100644 index 000000000000..559e7e7a1a63 --- /dev/null +++ b/sdk/resourcemanager/storagesync/armstoragesync/models_serde.go @@ -0,0 +1,3688 @@ +//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 armstoragesync + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type APIError. +func (a APIError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", a.Code) + populate(objectMap, "details", a.Details) + populate(objectMap, "innererror", a.Innererror) + populate(objectMap, "message", a.Message) + populate(objectMap, "target", a.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIError. +func (a *APIError) 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 "code": + err = unpopulate(val, "Code", &a.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &a.Details) + delete(rawMsg, key) + case "innererror": + err = unpopulate(val, "Innererror", &a.Innererror) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &a.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &a.Target) + 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 BackupRequest. +func (b BackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureFileShare", b.AzureFileShare) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupRequest. +func (b *BackupRequest) 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 "azureFileShare": + err = unpopulate(val, "AzureFileShare", &b.AzureFileShare) + 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 CheckNameAvailabilityParameters. +func (c CheckNameAvailabilityParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + objectMap["type"] = "Microsoft.StorageSync/storageSyncServices" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityParameters. +func (c *CheckNameAvailabilityParameters) 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 "type": + err = unpopulate(val, "Type", &c.Type) + 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 CloudEndpoint. +func (c CloudEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpoint. +func (c *CloudEndpoint) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 CloudEndpointAfsShareMetadataCertificatePublicKeys. +func (c CloudEndpointAfsShareMetadataCertificatePublicKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "firstKey", c.FirstKey) + populate(objectMap, "secondKey", c.SecondKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointAfsShareMetadataCertificatePublicKeys. +func (c *CloudEndpointAfsShareMetadataCertificatePublicKeys) 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 "firstKey": + err = unpopulate(val, "FirstKey", &c.FirstKey) + delete(rawMsg, key) + case "secondKey": + err = unpopulate(val, "SecondKey", &c.SecondKey) + 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 CloudEndpointArray. +func (c CloudEndpointArray) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointArray. +func (c *CloudEndpointArray) 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 "value": + err = unpopulate(val, "Value", &c.Value) + 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 CloudEndpointChangeEnumerationActivity. +func (c CloudEndpointChangeEnumerationActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deletesProgressPercent", c.DeletesProgressPercent) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) + populate(objectMap, "minutesRemaining", c.MinutesRemaining) + populate(objectMap, "operationState", c.OperationState) + populate(objectMap, "processedDirectoriesCount", c.ProcessedDirectoriesCount) + populate(objectMap, "processedFilesCount", c.ProcessedFilesCount) + populate(objectMap, "progressPercent", c.ProgressPercent) + populateTimeRFC3339(objectMap, "startedTimestamp", c.StartedTimestamp) + populate(objectMap, "statusCode", c.StatusCode) + populate(objectMap, "totalCountsState", c.TotalCountsState) + populate(objectMap, "totalDirectoriesCount", c.TotalDirectoriesCount) + populate(objectMap, "totalFilesCount", c.TotalFilesCount) + populate(objectMap, "totalSizeBytes", c.TotalSizeBytes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointChangeEnumerationActivity. +func (c *CloudEndpointChangeEnumerationActivity) 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 "deletesProgressPercent": + err = unpopulate(val, "DeletesProgressPercent", &c.DeletesProgressPercent) + delete(rawMsg, key) + case "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) + delete(rawMsg, key) + case "minutesRemaining": + err = unpopulate(val, "MinutesRemaining", &c.MinutesRemaining) + delete(rawMsg, key) + case "operationState": + err = unpopulate(val, "OperationState", &c.OperationState) + delete(rawMsg, key) + case "processedDirectoriesCount": + err = unpopulate(val, "ProcessedDirectoriesCount", &c.ProcessedDirectoriesCount) + delete(rawMsg, key) + case "processedFilesCount": + err = unpopulate(val, "ProcessedFilesCount", &c.ProcessedFilesCount) + delete(rawMsg, key) + case "progressPercent": + err = unpopulate(val, "ProgressPercent", &c.ProgressPercent) + delete(rawMsg, key) + case "startedTimestamp": + err = unpopulateTimeRFC3339(val, "StartedTimestamp", &c.StartedTimestamp) + delete(rawMsg, key) + case "statusCode": + err = unpopulate(val, "StatusCode", &c.StatusCode) + delete(rawMsg, key) + case "totalCountsState": + err = unpopulate(val, "TotalCountsState", &c.TotalCountsState) + delete(rawMsg, key) + case "totalDirectoriesCount": + err = unpopulate(val, "TotalDirectoriesCount", &c.TotalDirectoriesCount) + delete(rawMsg, key) + case "totalFilesCount": + err = unpopulate(val, "TotalFilesCount", &c.TotalFilesCount) + delete(rawMsg, key) + case "totalSizeBytes": + err = unpopulate(val, "TotalSizeBytes", &c.TotalSizeBytes) + 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 CloudEndpointChangeEnumerationStatus. +func (c CloudEndpointChangeEnumerationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "activity", c.Activity) + populate(objectMap, "lastEnumerationStatus", c.LastEnumerationStatus) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointChangeEnumerationStatus. +func (c *CloudEndpointChangeEnumerationStatus) 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 "activity": + err = unpopulate(val, "Activity", &c.Activity) + delete(rawMsg, key) + case "lastEnumerationStatus": + err = unpopulate(val, "LastEnumerationStatus", &c.LastEnumerationStatus) + delete(rawMsg, key) + case "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) + 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 CloudEndpointCreateParameters. +func (c CloudEndpointCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointCreateParameters. +func (c *CloudEndpointCreateParameters) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 CloudEndpointCreateParametersProperties. +func (c CloudEndpointCreateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureFileShareName", c.AzureFileShareName) + populate(objectMap, "friendlyName", c.FriendlyName) + populate(objectMap, "storageAccountResourceId", c.StorageAccountResourceID) + populate(objectMap, "storageAccountTenantId", c.StorageAccountTenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointCreateParametersProperties. +func (c *CloudEndpointCreateParametersProperties) 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 "azureFileShareName": + err = unpopulate(val, "AzureFileShareName", &c.AzureFileShareName) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &c.FriendlyName) + delete(rawMsg, key) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &c.StorageAccountResourceID) + delete(rawMsg, key) + case "storageAccountTenantId": + err = unpopulate(val, "StorageAccountTenantID", &c.StorageAccountTenantID) + 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 CloudEndpointLastChangeEnumerationStatus. +func (c CloudEndpointLastChangeEnumerationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "completedTimestamp", c.CompletedTimestamp) + populate(objectMap, "namespaceDirectoriesCount", c.NamespaceDirectoriesCount) + populate(objectMap, "namespaceFilesCount", c.NamespaceFilesCount) + populate(objectMap, "namespaceSizeBytes", c.NamespaceSizeBytes) + populateTimeRFC3339(objectMap, "nextRunTimestamp", c.NextRunTimestamp) + populateTimeRFC3339(objectMap, "startedTimestamp", c.StartedTimestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointLastChangeEnumerationStatus. +func (c *CloudEndpointLastChangeEnumerationStatus) 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 "completedTimestamp": + err = unpopulateTimeRFC3339(val, "CompletedTimestamp", &c.CompletedTimestamp) + delete(rawMsg, key) + case "namespaceDirectoriesCount": + err = unpopulate(val, "NamespaceDirectoriesCount", &c.NamespaceDirectoriesCount) + delete(rawMsg, key) + case "namespaceFilesCount": + err = unpopulate(val, "NamespaceFilesCount", &c.NamespaceFilesCount) + delete(rawMsg, key) + case "namespaceSizeBytes": + err = unpopulate(val, "NamespaceSizeBytes", &c.NamespaceSizeBytes) + delete(rawMsg, key) + case "nextRunTimestamp": + err = unpopulateTimeRFC3339(val, "NextRunTimestamp", &c.NextRunTimestamp) + delete(rawMsg, key) + case "startedTimestamp": + err = unpopulateTimeRFC3339(val, "StartedTimestamp", &c.StartedTimestamp) + 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 CloudEndpointProperties. +func (c CloudEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureFileShareName", c.AzureFileShareName) + populate(objectMap, "backupEnabled", c.BackupEnabled) + populate(objectMap, "changeEnumerationStatus", c.ChangeEnumerationStatus) + populate(objectMap, "friendlyName", c.FriendlyName) + populate(objectMap, "lastOperationName", c.LastOperationName) + populate(objectMap, "lastWorkflowId", c.LastWorkflowID) + populate(objectMap, "partnershipId", c.PartnershipID) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "storageAccountResourceId", c.StorageAccountResourceID) + populate(objectMap, "storageAccountTenantId", c.StorageAccountTenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointProperties. +func (c *CloudEndpointProperties) 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 "azureFileShareName": + err = unpopulate(val, "AzureFileShareName", &c.AzureFileShareName) + delete(rawMsg, key) + case "backupEnabled": + err = unpopulate(val, "BackupEnabled", &c.BackupEnabled) + delete(rawMsg, key) + case "changeEnumerationStatus": + err = unpopulate(val, "ChangeEnumerationStatus", &c.ChangeEnumerationStatus) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &c.FriendlyName) + delete(rawMsg, key) + case "lastOperationName": + err = unpopulate(val, "LastOperationName", &c.LastOperationName) + delete(rawMsg, key) + case "lastWorkflowId": + err = unpopulate(val, "LastWorkflowID", &c.LastWorkflowID) + delete(rawMsg, key) + case "partnershipId": + err = unpopulate(val, "PartnershipID", &c.PartnershipID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &c.StorageAccountResourceID) + delete(rawMsg, key) + case "storageAccountTenantId": + err = unpopulate(val, "StorageAccountTenantID", &c.StorageAccountTenantID) + 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 CloudTieringCachePerformance. +func (c CloudTieringCachePerformance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cacheHitBytes", c.CacheHitBytes) + populate(objectMap, "cacheHitBytesPercent", c.CacheHitBytesPercent) + populate(objectMap, "cacheMissBytes", c.CacheMissBytes) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringCachePerformance. +func (c *CloudTieringCachePerformance) 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 "cacheHitBytes": + err = unpopulate(val, "CacheHitBytes", &c.CacheHitBytes) + delete(rawMsg, key) + case "cacheHitBytesPercent": + err = unpopulate(val, "CacheHitBytesPercent", &c.CacheHitBytesPercent) + delete(rawMsg, key) + case "cacheMissBytes": + err = unpopulate(val, "CacheMissBytes", &c.CacheMissBytes) + delete(rawMsg, key) + case "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) + 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 CloudTieringDatePolicyStatus. +func (c CloudTieringDatePolicyStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) + populateTimeRFC3339(objectMap, "tieredFilesMostRecentAccessTimestamp", c.TieredFilesMostRecentAccessTimestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringDatePolicyStatus. +func (c *CloudTieringDatePolicyStatus) 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 "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) + delete(rawMsg, key) + case "tieredFilesMostRecentAccessTimestamp": + err = unpopulateTimeRFC3339(val, "TieredFilesMostRecentAccessTimestamp", &c.TieredFilesMostRecentAccessTimestamp) + 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 CloudTieringFilesNotTiering. +func (c CloudTieringFilesNotTiering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errors", c.Errors) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) + populate(objectMap, "totalFileCount", c.TotalFileCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringFilesNotTiering. +func (c *CloudTieringFilesNotTiering) 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 "errors": + err = unpopulate(val, "Errors", &c.Errors) + delete(rawMsg, key) + case "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) + delete(rawMsg, key) + case "totalFileCount": + err = unpopulate(val, "TotalFileCount", &c.TotalFileCount) + 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 CloudTieringLowDiskMode. +func (c CloudTieringLowDiskMode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) + populate(objectMap, "state", c.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringLowDiskMode. +func (c *CloudTieringLowDiskMode) 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 "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + 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 CloudTieringSpaceSavings. +func (c CloudTieringSpaceSavings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cachedSizeBytes", c.CachedSizeBytes) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) + populate(objectMap, "spaceSavingsBytes", c.SpaceSavingsBytes) + populate(objectMap, "spaceSavingsPercent", c.SpaceSavingsPercent) + populate(objectMap, "totalSizeCloudBytes", c.TotalSizeCloudBytes) + populate(objectMap, "volumeSizeBytes", c.VolumeSizeBytes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringSpaceSavings. +func (c *CloudTieringSpaceSavings) 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 "cachedSizeBytes": + err = unpopulate(val, "CachedSizeBytes", &c.CachedSizeBytes) + delete(rawMsg, key) + case "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) + delete(rawMsg, key) + case "spaceSavingsBytes": + err = unpopulate(val, "SpaceSavingsBytes", &c.SpaceSavingsBytes) + delete(rawMsg, key) + case "spaceSavingsPercent": + err = unpopulate(val, "SpaceSavingsPercent", &c.SpaceSavingsPercent) + delete(rawMsg, key) + case "totalSizeCloudBytes": + err = unpopulate(val, "TotalSizeCloudBytes", &c.TotalSizeCloudBytes) + delete(rawMsg, key) + case "volumeSizeBytes": + err = unpopulate(val, "VolumeSizeBytes", &c.VolumeSizeBytes) + 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 CloudTieringVolumeFreeSpacePolicyStatus. +func (c CloudTieringVolumeFreeSpacePolicyStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentVolumeFreeSpacePercent", c.CurrentVolumeFreeSpacePercent) + populate(objectMap, "effectiveVolumeFreeSpacePolicy", c.EffectiveVolumeFreeSpacePolicy) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringVolumeFreeSpacePolicyStatus. +func (c *CloudTieringVolumeFreeSpacePolicyStatus) 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 "currentVolumeFreeSpacePercent": + err = unpopulate(val, "CurrentVolumeFreeSpacePercent", &c.CurrentVolumeFreeSpacePercent) + delete(rawMsg, key) + case "effectiveVolumeFreeSpacePolicy": + err = unpopulate(val, "EffectiveVolumeFreeSpacePolicy", &c.EffectiveVolumeFreeSpacePolicy) + delete(rawMsg, key) + case "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) + 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 Error. +func (e Error) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", e.Error) + populate(objectMap, "innererror", e.Innererror) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Error. +func (e *Error) 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) + case "innererror": + err = unpopulate(val, "Innererror", &e.Innererror) + 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 ErrorDetails. +func (e ErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "exceptionType", e.ExceptionType) + populate(objectMap, "httpErrorCode", e.HTTPErrorCode) + populate(objectMap, "httpMethod", e.HTTPMethod) + populate(objectMap, "hashedMessage", e.HashedMessage) + populate(objectMap, "message", e.Message) + populate(objectMap, "requestUri", e.RequestURI) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetails. +func (e *ErrorDetails) 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 "exceptionType": + err = unpopulate(val, "ExceptionType", &e.ExceptionType) + delete(rawMsg, key) + case "httpErrorCode": + err = unpopulate(val, "HTTPErrorCode", &e.HTTPErrorCode) + delete(rawMsg, key) + case "httpMethod": + err = unpopulate(val, "HTTPMethod", &e.HTTPMethod) + delete(rawMsg, key) + case "hashedMessage": + err = unpopulate(val, "HashedMessage", &e.HashedMessage) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "requestUri": + err = unpopulate(val, "RequestURI", &e.RequestURI) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + 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 FilesNotTieringError. +func (f FilesNotTieringError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorCode", f.ErrorCode) + populate(objectMap, "fileCount", f.FileCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FilesNotTieringError. +func (f *FilesNotTieringError) 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 "errorCode": + err = unpopulate(val, "ErrorCode", &f.ErrorCode) + delete(rawMsg, key) + case "fileCount": + err = unpopulate(val, "FileCount", &f.FileCount) + 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 InnerErrorDetails. +func (i InnerErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "callStack", i.CallStack) + populate(objectMap, "innerException", i.InnerException) + populate(objectMap, "innerExceptionCallStack", i.InnerExceptionCallStack) + populate(objectMap, "message", i.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InnerErrorDetails. +func (i *InnerErrorDetails) 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 "callStack": + err = unpopulate(val, "CallStack", &i.CallStack) + delete(rawMsg, key) + case "innerException": + err = unpopulate(val, "InnerException", &i.InnerException) + delete(rawMsg, key) + case "innerExceptionCallStack": + err = unpopulate(val, "InnerExceptionCallStack", &i.InnerExceptionCallStack) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &i.Message) + 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 LocationOperationStatus. +func (l LocationOperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", l.EndTime) + populate(objectMap, "error", l.Error) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "percentComplete", l.PercentComplete) + populateTimeRFC3339(objectMap, "startTime", l.StartTime) + populate(objectMap, "status", l.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationOperationStatus. +func (l *LocationOperationStatus) 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 "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &l.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &l.Error) + 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 "percentComplete": + err = unpopulate(val, "PercentComplete", &l.PercentComplete) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &l.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + 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 OperationDisplayInfo. +func (o OperationDisplayInfo) 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 OperationDisplayInfo. +func (o *OperationDisplayInfo) 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 OperationDisplayResource. +func (o OperationDisplayResource) 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 OperationDisplayResource. +func (o *OperationDisplayResource) 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 OperationEntity. +func (o OperationEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationEntity. +func (o *OperationEntity) 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 "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + 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 OperationEntityListResult. +func (o OperationEntityListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationEntityListResult. +func (o *OperationEntityListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, 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 OperationResourceMetricSpecification. +func (o OperationResourceMetricSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregationType", o.AggregationType) + populate(objectMap, "dimensions", o.Dimensions) + populate(objectMap, "displayDescription", o.DisplayDescription) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "fillGapWithZero", o.FillGapWithZero) + populate(objectMap, "name", o.Name) + populate(objectMap, "supportedAggregationTypes", o.SupportedAggregationTypes) + populate(objectMap, "unit", o.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResourceMetricSpecification. +func (o *OperationResourceMetricSpecification) 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 "aggregationType": + err = unpopulate(val, "AggregationType", &o.AggregationType) + delete(rawMsg, key) + case "dimensions": + err = unpopulate(val, "Dimensions", &o.Dimensions) + delete(rawMsg, key) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &o.DisplayDescription) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "fillGapWithZero": + err = unpopulate(val, "FillGapWithZero", &o.FillGapWithZero) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "supportedAggregationTypes": + err = unpopulate(val, "SupportedAggregationTypes", &o.SupportedAggregationTypes) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &o.Unit) + 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 OperationResourceMetricSpecificationDimension. +func (o OperationResourceMetricSpecificationDimension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "name", o.Name) + populate(objectMap, "toBeExportedForShoebox", o.ToBeExportedForShoebox) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResourceMetricSpecificationDimension. +func (o *OperationResourceMetricSpecificationDimension) 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 "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "toBeExportedForShoebox": + err = unpopulate(val, "ToBeExportedForShoebox", &o.ToBeExportedForShoebox) + 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 OperationResourceServiceSpecification. +func (o OperationResourceServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricSpecifications", o.MetricSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResourceServiceSpecification. +func (o *OperationResourceServiceSpecification) 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 "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &o.MetricSpecifications) + 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 OperationStatus. +func (o OperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "name", o.Name) + populateTimeRFC3339(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. +func (o *OperationStatus) 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 "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + 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 PostBackupResponse. +func (p PostBackupResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupMetadata", p.BackupMetadata) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PostBackupResponse. +func (p *PostBackupResponse) 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 "backupMetadata": + err = unpopulate(val, "BackupMetadata", &p.BackupMetadata) + 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 PostBackupResponseProperties. +func (p PostBackupResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cloudEndpointName", p.CloudEndpointName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PostBackupResponseProperties. +func (p *PostBackupResponseProperties) 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 "cloudEndpointName": + err = unpopulate(val, "CloudEndpointName", &p.CloudEndpointName) + 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 PostRestoreRequest. +func (p PostRestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureFileShareUri", p.AzureFileShareURI) + populate(objectMap, "failedFileList", p.FailedFileList) + populate(objectMap, "partition", p.Partition) + populate(objectMap, "replicaGroup", p.ReplicaGroup) + populate(objectMap, "requestId", p.RequestID) + populate(objectMap, "restoreFileSpec", p.RestoreFileSpec) + populate(objectMap, "sourceAzureFileShareUri", p.SourceAzureFileShareURI) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PostRestoreRequest. +func (p *PostRestoreRequest) 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 "azureFileShareUri": + err = unpopulate(val, "AzureFileShareURI", &p.AzureFileShareURI) + delete(rawMsg, key) + case "failedFileList": + err = unpopulate(val, "FailedFileList", &p.FailedFileList) + delete(rawMsg, key) + case "partition": + err = unpopulate(val, "Partition", &p.Partition) + delete(rawMsg, key) + case "replicaGroup": + err = unpopulate(val, "ReplicaGroup", &p.ReplicaGroup) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &p.RequestID) + delete(rawMsg, key) + case "restoreFileSpec": + err = unpopulate(val, "RestoreFileSpec", &p.RestoreFileSpec) + delete(rawMsg, key) + case "sourceAzureFileShareUri": + err = unpopulate(val, "SourceAzureFileShareURI", &p.SourceAzureFileShareURI) + 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 PreRestoreRequest. +func (p PreRestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureFileShareUri", p.AzureFileShareURI) + populate(objectMap, "backupMetadataPropertyBag", p.BackupMetadataPropertyBag) + populate(objectMap, "partition", p.Partition) + populate(objectMap, "pauseWaitForSyncDrainTimePeriodInSeconds", p.PauseWaitForSyncDrainTimePeriodInSeconds) + populate(objectMap, "replicaGroup", p.ReplicaGroup) + populate(objectMap, "requestId", p.RequestID) + populate(objectMap, "restoreFileSpec", p.RestoreFileSpec) + populate(objectMap, "sourceAzureFileShareUri", p.SourceAzureFileShareURI) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PreRestoreRequest. +func (p *PreRestoreRequest) 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 "azureFileShareUri": + err = unpopulate(val, "AzureFileShareURI", &p.AzureFileShareURI) + delete(rawMsg, key) + case "backupMetadataPropertyBag": + err = unpopulate(val, "BackupMetadataPropertyBag", &p.BackupMetadataPropertyBag) + delete(rawMsg, key) + case "partition": + err = unpopulate(val, "Partition", &p.Partition) + delete(rawMsg, key) + case "pauseWaitForSyncDrainTimePeriodInSeconds": + err = unpopulate(val, "PauseWaitForSyncDrainTimePeriodInSeconds", &p.PauseWaitForSyncDrainTimePeriodInSeconds) + delete(rawMsg, key) + case "replicaGroup": + err = unpopulate(val, "ReplicaGroup", &p.ReplicaGroup) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &p.RequestID) + delete(rawMsg, key) + case "restoreFileSpec": + err = unpopulate(val, "RestoreFileSpec", &p.RestoreFileSpec) + delete(rawMsg, key) + case "sourceAzureFileShareUri": + err = unpopulate(val, "SourceAzureFileShareURI", &p.SourceAzureFileShareURI) + 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 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, "systemData", p.SystemData) + 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 "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + 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, "systemData", p.SystemData) + 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 "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + 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, "actionsRequired", p.ActionsRequired) + 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 "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + 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 ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + 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 "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + 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 RecallActionParameters. +func (r RecallActionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "pattern", r.Pattern) + populate(objectMap, "recallPath", r.RecallPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecallActionParameters. +func (r *RecallActionParameters) 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 "pattern": + err = unpopulate(val, "Pattern", &r.Pattern) + delete(rawMsg, key) + case "recallPath": + err = unpopulate(val, "RecallPath", &r.RecallPath) + 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 RegisteredServer. +func (r RegisteredServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredServer. +func (r *RegisteredServer) 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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + 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 RegisteredServerArray. +func (r RegisteredServerArray) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredServerArray. +func (r *RegisteredServerArray) 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 "value": + err = unpopulate(val, "Value", &r.Value) + 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 RegisteredServerCreateParameters. +func (r RegisteredServerCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredServerCreateParameters. +func (r *RegisteredServerCreateParameters) 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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + 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 RegisteredServerCreateParametersProperties. +func (r RegisteredServerCreateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentVersion", r.AgentVersion) + populate(objectMap, "clusterId", r.ClusterID) + populate(objectMap, "clusterName", r.ClusterName) + populate(objectMap, "friendlyName", r.FriendlyName) + populate(objectMap, "lastHeartBeat", r.LastHeartBeat) + populate(objectMap, "serverCertificate", r.ServerCertificate) + populate(objectMap, "serverId", r.ServerID) + populate(objectMap, "serverOSVersion", r.ServerOSVersion) + populate(objectMap, "serverRole", r.ServerRole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredServerCreateParametersProperties. +func (r *RegisteredServerCreateParametersProperties) 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 "agentVersion": + err = unpopulate(val, "AgentVersion", &r.AgentVersion) + delete(rawMsg, key) + case "clusterId": + err = unpopulate(val, "ClusterID", &r.ClusterID) + delete(rawMsg, key) + case "clusterName": + err = unpopulate(val, "ClusterName", &r.ClusterName) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &r.FriendlyName) + delete(rawMsg, key) + case "lastHeartBeat": + err = unpopulate(val, "LastHeartBeat", &r.LastHeartBeat) + delete(rawMsg, key) + case "serverCertificate": + err = unpopulate(val, "ServerCertificate", &r.ServerCertificate) + delete(rawMsg, key) + case "serverId": + err = unpopulate(val, "ServerID", &r.ServerID) + delete(rawMsg, key) + case "serverOSVersion": + err = unpopulate(val, "ServerOSVersion", &r.ServerOSVersion) + delete(rawMsg, key) + case "serverRole": + err = unpopulate(val, "ServerRole", &r.ServerRole) + 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 RegisteredServerProperties. +func (r RegisteredServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentVersion", r.AgentVersion) + populateTimeRFC3339(objectMap, "agentVersionExpirationDate", r.AgentVersionExpirationDate) + populate(objectMap, "agentVersionStatus", r.AgentVersionStatus) + populate(objectMap, "clusterId", r.ClusterID) + populate(objectMap, "clusterName", r.ClusterName) + populate(objectMap, "discoveryEndpointUri", r.DiscoveryEndpointURI) + populate(objectMap, "friendlyName", r.FriendlyName) + populate(objectMap, "lastHeartBeat", r.LastHeartBeat) + populate(objectMap, "lastOperationName", r.LastOperationName) + populate(objectMap, "lastWorkflowId", r.LastWorkflowID) + populate(objectMap, "managementEndpointUri", r.ManagementEndpointURI) + populate(objectMap, "monitoringConfiguration", r.MonitoringConfiguration) + populate(objectMap, "monitoringEndpointUri", r.MonitoringEndpointURI) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "resourceLocation", r.ResourceLocation) + populate(objectMap, "serverCertificate", r.ServerCertificate) + populate(objectMap, "serverId", r.ServerID) + populate(objectMap, "serverManagementErrorCode", r.ServerManagementErrorCode) + populate(objectMap, "serverName", r.ServerName) + populate(objectMap, "serverOSVersion", r.ServerOSVersion) + populate(objectMap, "serverRole", r.ServerRole) + populate(objectMap, "serviceLocation", r.ServiceLocation) + populate(objectMap, "storageSyncServiceUid", r.StorageSyncServiceUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredServerProperties. +func (r *RegisteredServerProperties) 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 "agentVersion": + err = unpopulate(val, "AgentVersion", &r.AgentVersion) + delete(rawMsg, key) + case "agentVersionExpirationDate": + err = unpopulateTimeRFC3339(val, "AgentVersionExpirationDate", &r.AgentVersionExpirationDate) + delete(rawMsg, key) + case "agentVersionStatus": + err = unpopulate(val, "AgentVersionStatus", &r.AgentVersionStatus) + delete(rawMsg, key) + case "clusterId": + err = unpopulate(val, "ClusterID", &r.ClusterID) + delete(rawMsg, key) + case "clusterName": + err = unpopulate(val, "ClusterName", &r.ClusterName) + delete(rawMsg, key) + case "discoveryEndpointUri": + err = unpopulate(val, "DiscoveryEndpointURI", &r.DiscoveryEndpointURI) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &r.FriendlyName) + delete(rawMsg, key) + case "lastHeartBeat": + err = unpopulate(val, "LastHeartBeat", &r.LastHeartBeat) + delete(rawMsg, key) + case "lastOperationName": + err = unpopulate(val, "LastOperationName", &r.LastOperationName) + delete(rawMsg, key) + case "lastWorkflowId": + err = unpopulate(val, "LastWorkflowID", &r.LastWorkflowID) + delete(rawMsg, key) + case "managementEndpointUri": + err = unpopulate(val, "ManagementEndpointURI", &r.ManagementEndpointURI) + delete(rawMsg, key) + case "monitoringConfiguration": + err = unpopulate(val, "MonitoringConfiguration", &r.MonitoringConfiguration) + delete(rawMsg, key) + case "monitoringEndpointUri": + err = unpopulate(val, "MonitoringEndpointURI", &r.MonitoringEndpointURI) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "resourceLocation": + err = unpopulate(val, "ResourceLocation", &r.ResourceLocation) + delete(rawMsg, key) + case "serverCertificate": + err = unpopulate(val, "ServerCertificate", &r.ServerCertificate) + delete(rawMsg, key) + case "serverId": + err = unpopulate(val, "ServerID", &r.ServerID) + delete(rawMsg, key) + case "serverManagementErrorCode": + err = unpopulate(val, "ServerManagementErrorCode", &r.ServerManagementErrorCode) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &r.ServerName) + delete(rawMsg, key) + case "serverOSVersion": + err = unpopulate(val, "ServerOSVersion", &r.ServerOSVersion) + delete(rawMsg, key) + case "serverRole": + err = unpopulate(val, "ServerRole", &r.ServerRole) + delete(rawMsg, key) + case "serviceLocation": + err = unpopulate(val, "ServiceLocation", &r.ServiceLocation) + delete(rawMsg, key) + case "storageSyncServiceUid": + err = unpopulate(val, "StorageSyncServiceUID", &r.StorageSyncServiceUID) + 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 Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + 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 "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + 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 ResourcesMoveInfo. +func (r ResourcesMoveInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resources", r.Resources) + populate(objectMap, "targetResourceGroup", r.TargetResourceGroup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourcesMoveInfo. +func (r *ResourcesMoveInfo) 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 "resources": + err = unpopulate(val, "Resources", &r.Resources) + delete(rawMsg, key) + case "targetResourceGroup": + err = unpopulate(val, "TargetResourceGroup", &r.TargetResourceGroup) + 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 RestoreFileSpec. +func (r RestoreFileSpec) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isdir", r.Isdir) + populate(objectMap, "path", r.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreFileSpec. +func (r *RestoreFileSpec) 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 "isdir": + err = unpopulate(val, "Isdir", &r.Isdir) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &r.Path) + 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 ServerEndpoint. +func (s ServerEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpoint. +func (s *ServerEndpoint) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerEndpointArray. +func (s ServerEndpointArray) 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 ServerEndpointArray. +func (s *ServerEndpointArray) 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 ServerEndpointBackgroundDataDownloadActivity. +func (s ServerEndpointBackgroundDataDownloadActivity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "downloadedBytes", s.DownloadedBytes) + populate(objectMap, "percentProgress", s.PercentProgress) + populateTimeRFC3339(objectMap, "startedTimestamp", s.StartedTimestamp) + populateTimeRFC3339(objectMap, "timestamp", s.Timestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointBackgroundDataDownloadActivity. +func (s *ServerEndpointBackgroundDataDownloadActivity) 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 "downloadedBytes": + err = unpopulate(val, "DownloadedBytes", &s.DownloadedBytes) + delete(rawMsg, key) + case "percentProgress": + err = unpopulate(val, "PercentProgress", &s.PercentProgress) + delete(rawMsg, key) + case "startedTimestamp": + err = unpopulateTimeRFC3339(val, "StartedTimestamp", &s.StartedTimestamp) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) + 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 ServerEndpointCloudTieringStatus. +func (s ServerEndpointCloudTieringStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cachePerformance", s.CachePerformance) + populate(objectMap, "datePolicyStatus", s.DatePolicyStatus) + populate(objectMap, "filesNotTiering", s.FilesNotTiering) + populate(objectMap, "health", s.Health) + populateTimeRFC3339(objectMap, "healthLastUpdatedTimestamp", s.HealthLastUpdatedTimestamp) + populate(objectMap, "lastCloudTieringResult", s.LastCloudTieringResult) + populateTimeRFC3339(objectMap, "lastSuccessTimestamp", s.LastSuccessTimestamp) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", s.LastUpdatedTimestamp) + populate(objectMap, "lowDiskMode", s.LowDiskMode) + populate(objectMap, "spaceSavings", s.SpaceSavings) + populate(objectMap, "volumeFreeSpacePolicyStatus", s.VolumeFreeSpacePolicyStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointCloudTieringStatus. +func (s *ServerEndpointCloudTieringStatus) 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 "cachePerformance": + err = unpopulate(val, "CachePerformance", &s.CachePerformance) + delete(rawMsg, key) + case "datePolicyStatus": + err = unpopulate(val, "DatePolicyStatus", &s.DatePolicyStatus) + delete(rawMsg, key) + case "filesNotTiering": + err = unpopulate(val, "FilesNotTiering", &s.FilesNotTiering) + delete(rawMsg, key) + case "health": + err = unpopulate(val, "Health", &s.Health) + delete(rawMsg, key) + case "healthLastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "HealthLastUpdatedTimestamp", &s.HealthLastUpdatedTimestamp) + delete(rawMsg, key) + case "lastCloudTieringResult": + err = unpopulate(val, "LastCloudTieringResult", &s.LastCloudTieringResult) + delete(rawMsg, key) + case "lastSuccessTimestamp": + err = unpopulateTimeRFC3339(val, "LastSuccessTimestamp", &s.LastSuccessTimestamp) + delete(rawMsg, key) + case "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &s.LastUpdatedTimestamp) + delete(rawMsg, key) + case "lowDiskMode": + err = unpopulate(val, "LowDiskMode", &s.LowDiskMode) + delete(rawMsg, key) + case "spaceSavings": + err = unpopulate(val, "SpaceSavings", &s.SpaceSavings) + delete(rawMsg, key) + case "volumeFreeSpacePolicyStatus": + err = unpopulate(val, "VolumeFreeSpacePolicyStatus", &s.VolumeFreeSpacePolicyStatus) + 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 ServerEndpointCreateParameters. +func (s ServerEndpointCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointCreateParameters. +func (s *ServerEndpointCreateParameters) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerEndpointCreateParametersProperties. +func (s ServerEndpointCreateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cloudTiering", s.CloudTiering) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "initialDownloadPolicy", s.InitialDownloadPolicy) + populate(objectMap, "initialUploadPolicy", s.InitialUploadPolicy) + populate(objectMap, "localCacheMode", s.LocalCacheMode) + populate(objectMap, "offlineDataTransfer", s.OfflineDataTransfer) + populate(objectMap, "offlineDataTransferShareName", s.OfflineDataTransferShareName) + populate(objectMap, "serverLocalPath", s.ServerLocalPath) + populate(objectMap, "serverResourceId", s.ServerResourceID) + populate(objectMap, "tierFilesOlderThanDays", s.TierFilesOlderThanDays) + populate(objectMap, "volumeFreeSpacePercent", s.VolumeFreeSpacePercent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointCreateParametersProperties. +func (s *ServerEndpointCreateParametersProperties) 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 "cloudTiering": + err = unpopulate(val, "CloudTiering", &s.CloudTiering) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) + delete(rawMsg, key) + case "initialDownloadPolicy": + err = unpopulate(val, "InitialDownloadPolicy", &s.InitialDownloadPolicy) + delete(rawMsg, key) + case "initialUploadPolicy": + err = unpopulate(val, "InitialUploadPolicy", &s.InitialUploadPolicy) + delete(rawMsg, key) + case "localCacheMode": + err = unpopulate(val, "LocalCacheMode", &s.LocalCacheMode) + delete(rawMsg, key) + case "offlineDataTransfer": + err = unpopulate(val, "OfflineDataTransfer", &s.OfflineDataTransfer) + delete(rawMsg, key) + case "offlineDataTransferShareName": + err = unpopulate(val, "OfflineDataTransferShareName", &s.OfflineDataTransferShareName) + delete(rawMsg, key) + case "serverLocalPath": + err = unpopulate(val, "ServerLocalPath", &s.ServerLocalPath) + delete(rawMsg, key) + case "serverResourceId": + err = unpopulate(val, "ServerResourceID", &s.ServerResourceID) + delete(rawMsg, key) + case "tierFilesOlderThanDays": + err = unpopulate(val, "TierFilesOlderThanDays", &s.TierFilesOlderThanDays) + delete(rawMsg, key) + case "volumeFreeSpacePercent": + err = unpopulate(val, "VolumeFreeSpacePercent", &s.VolumeFreeSpacePercent) + 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 ServerEndpointFilesNotSyncingError. +func (s ServerEndpointFilesNotSyncingError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorCode", s.ErrorCode) + populate(objectMap, "persistentCount", s.PersistentCount) + populate(objectMap, "transientCount", s.TransientCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointFilesNotSyncingError. +func (s *ServerEndpointFilesNotSyncingError) 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 "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) + delete(rawMsg, key) + case "persistentCount": + err = unpopulate(val, "PersistentCount", &s.PersistentCount) + delete(rawMsg, key) + case "transientCount": + err = unpopulate(val, "TransientCount", &s.TransientCount) + 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 ServerEndpointProperties. +func (s ServerEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cloudTiering", s.CloudTiering) + populate(objectMap, "cloudTieringStatus", s.CloudTieringStatus) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "initialDownloadPolicy", s.InitialDownloadPolicy) + populate(objectMap, "initialUploadPolicy", s.InitialUploadPolicy) + populate(objectMap, "lastOperationName", s.LastOperationName) + populate(objectMap, "lastWorkflowId", s.LastWorkflowID) + populate(objectMap, "localCacheMode", s.LocalCacheMode) + populate(objectMap, "offlineDataTransfer", s.OfflineDataTransfer) + populate(objectMap, "offlineDataTransferShareName", s.OfflineDataTransferShareName) + populate(objectMap, "offlineDataTransferStorageAccountResourceId", s.OfflineDataTransferStorageAccountResourceID) + populate(objectMap, "offlineDataTransferStorageAccountTenantId", s.OfflineDataTransferStorageAccountTenantID) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "recallStatus", s.RecallStatus) + populate(objectMap, "serverLocalPath", s.ServerLocalPath) + populate(objectMap, "serverName", s.ServerName) + populate(objectMap, "serverResourceId", s.ServerResourceID) + populate(objectMap, "syncStatus", s.SyncStatus) + populate(objectMap, "tierFilesOlderThanDays", s.TierFilesOlderThanDays) + populate(objectMap, "volumeFreeSpacePercent", s.VolumeFreeSpacePercent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointProperties. +func (s *ServerEndpointProperties) 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 "cloudTiering": + err = unpopulate(val, "CloudTiering", &s.CloudTiering) + delete(rawMsg, key) + case "cloudTieringStatus": + err = unpopulate(val, "CloudTieringStatus", &s.CloudTieringStatus) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) + delete(rawMsg, key) + case "initialDownloadPolicy": + err = unpopulate(val, "InitialDownloadPolicy", &s.InitialDownloadPolicy) + delete(rawMsg, key) + case "initialUploadPolicy": + err = unpopulate(val, "InitialUploadPolicy", &s.InitialUploadPolicy) + delete(rawMsg, key) + case "lastOperationName": + err = unpopulate(val, "LastOperationName", &s.LastOperationName) + delete(rawMsg, key) + case "lastWorkflowId": + err = unpopulate(val, "LastWorkflowID", &s.LastWorkflowID) + delete(rawMsg, key) + case "localCacheMode": + err = unpopulate(val, "LocalCacheMode", &s.LocalCacheMode) + delete(rawMsg, key) + case "offlineDataTransfer": + err = unpopulate(val, "OfflineDataTransfer", &s.OfflineDataTransfer) + delete(rawMsg, key) + case "offlineDataTransferShareName": + err = unpopulate(val, "OfflineDataTransferShareName", &s.OfflineDataTransferShareName) + delete(rawMsg, key) + case "offlineDataTransferStorageAccountResourceId": + err = unpopulate(val, "OfflineDataTransferStorageAccountResourceID", &s.OfflineDataTransferStorageAccountResourceID) + delete(rawMsg, key) + case "offlineDataTransferStorageAccountTenantId": + err = unpopulate(val, "OfflineDataTransferStorageAccountTenantID", &s.OfflineDataTransferStorageAccountTenantID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "recallStatus": + err = unpopulate(val, "RecallStatus", &s.RecallStatus) + delete(rawMsg, key) + case "serverLocalPath": + err = unpopulate(val, "ServerLocalPath", &s.ServerLocalPath) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &s.ServerName) + delete(rawMsg, key) + case "serverResourceId": + err = unpopulate(val, "ServerResourceID", &s.ServerResourceID) + delete(rawMsg, key) + case "syncStatus": + err = unpopulate(val, "SyncStatus", &s.SyncStatus) + delete(rawMsg, key) + case "tierFilesOlderThanDays": + err = unpopulate(val, "TierFilesOlderThanDays", &s.TierFilesOlderThanDays) + delete(rawMsg, key) + case "volumeFreeSpacePercent": + err = unpopulate(val, "VolumeFreeSpacePercent", &s.VolumeFreeSpacePercent) + 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 ServerEndpointRecallError. +func (s ServerEndpointRecallError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "count", s.Count) + populate(objectMap, "errorCode", s.ErrorCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointRecallError. +func (s *ServerEndpointRecallError) 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 "count": + err = unpopulate(val, "Count", &s.Count) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) + 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 ServerEndpointRecallStatus. +func (s ServerEndpointRecallStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", s.LastUpdatedTimestamp) + populate(objectMap, "recallErrors", s.RecallErrors) + populate(objectMap, "totalRecallErrorsCount", s.TotalRecallErrorsCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointRecallStatus. +func (s *ServerEndpointRecallStatus) 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 "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &s.LastUpdatedTimestamp) + delete(rawMsg, key) + case "recallErrors": + err = unpopulate(val, "RecallErrors", &s.RecallErrors) + delete(rawMsg, key) + case "totalRecallErrorsCount": + err = unpopulate(val, "TotalRecallErrorsCount", &s.TotalRecallErrorsCount) + 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 ServerEndpointSyncActivityStatus. +func (s ServerEndpointSyncActivityStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appliedBytes", s.AppliedBytes) + populate(objectMap, "appliedItemCount", s.AppliedItemCount) + populate(objectMap, "perItemErrorCount", s.PerItemErrorCount) + populate(objectMap, "sessionMinutesRemaining", s.SessionMinutesRemaining) + populate(objectMap, "syncMode", s.SyncMode) + populateTimeRFC3339(objectMap, "timestamp", s.Timestamp) + populate(objectMap, "totalBytes", s.TotalBytes) + populate(objectMap, "totalItemCount", s.TotalItemCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointSyncActivityStatus. +func (s *ServerEndpointSyncActivityStatus) 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 "appliedBytes": + err = unpopulate(val, "AppliedBytes", &s.AppliedBytes) + delete(rawMsg, key) + case "appliedItemCount": + err = unpopulate(val, "AppliedItemCount", &s.AppliedItemCount) + delete(rawMsg, key) + case "perItemErrorCount": + err = unpopulate(val, "PerItemErrorCount", &s.PerItemErrorCount) + delete(rawMsg, key) + case "sessionMinutesRemaining": + err = unpopulate(val, "SessionMinutesRemaining", &s.SessionMinutesRemaining) + delete(rawMsg, key) + case "syncMode": + err = unpopulate(val, "SyncMode", &s.SyncMode) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) + delete(rawMsg, key) + case "totalBytes": + err = unpopulate(val, "TotalBytes", &s.TotalBytes) + delete(rawMsg, key) + case "totalItemCount": + err = unpopulate(val, "TotalItemCount", &s.TotalItemCount) + 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 ServerEndpointSyncSessionStatus. +func (s ServerEndpointSyncSessionStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "filesNotSyncingErrors", s.FilesNotSyncingErrors) + populate(objectMap, "lastSyncMode", s.LastSyncMode) + populate(objectMap, "lastSyncPerItemErrorCount", s.LastSyncPerItemErrorCount) + populate(objectMap, "lastSyncResult", s.LastSyncResult) + populateTimeRFC3339(objectMap, "lastSyncSuccessTimestamp", s.LastSyncSuccessTimestamp) + populateTimeRFC3339(objectMap, "lastSyncTimestamp", s.LastSyncTimestamp) + populate(objectMap, "persistentFilesNotSyncingCount", s.PersistentFilesNotSyncingCount) + populate(objectMap, "transientFilesNotSyncingCount", s.TransientFilesNotSyncingCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointSyncSessionStatus. +func (s *ServerEndpointSyncSessionStatus) 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 "filesNotSyncingErrors": + err = unpopulate(val, "FilesNotSyncingErrors", &s.FilesNotSyncingErrors) + delete(rawMsg, key) + case "lastSyncMode": + err = unpopulate(val, "LastSyncMode", &s.LastSyncMode) + delete(rawMsg, key) + case "lastSyncPerItemErrorCount": + err = unpopulate(val, "LastSyncPerItemErrorCount", &s.LastSyncPerItemErrorCount) + delete(rawMsg, key) + case "lastSyncResult": + err = unpopulate(val, "LastSyncResult", &s.LastSyncResult) + delete(rawMsg, key) + case "lastSyncSuccessTimestamp": + err = unpopulateTimeRFC3339(val, "LastSyncSuccessTimestamp", &s.LastSyncSuccessTimestamp) + delete(rawMsg, key) + case "lastSyncTimestamp": + err = unpopulateTimeRFC3339(val, "LastSyncTimestamp", &s.LastSyncTimestamp) + delete(rawMsg, key) + case "persistentFilesNotSyncingCount": + err = unpopulate(val, "PersistentFilesNotSyncingCount", &s.PersistentFilesNotSyncingCount) + delete(rawMsg, key) + case "transientFilesNotSyncingCount": + err = unpopulate(val, "TransientFilesNotSyncingCount", &s.TransientFilesNotSyncingCount) + 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 ServerEndpointSyncStatus. +func (s ServerEndpointSyncStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backgroundDataDownloadActivity", s.BackgroundDataDownloadActivity) + populate(objectMap, "combinedHealth", s.CombinedHealth) + populate(objectMap, "downloadActivity", s.DownloadActivity) + populate(objectMap, "downloadHealth", s.DownloadHealth) + populate(objectMap, "downloadStatus", s.DownloadStatus) + populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", s.LastUpdatedTimestamp) + populate(objectMap, "offlineDataTransferStatus", s.OfflineDataTransferStatus) + populate(objectMap, "syncActivity", s.SyncActivity) + populate(objectMap, "totalPersistentFilesNotSyncingCount", s.TotalPersistentFilesNotSyncingCount) + populate(objectMap, "uploadActivity", s.UploadActivity) + populate(objectMap, "uploadHealth", s.UploadHealth) + populate(objectMap, "uploadStatus", s.UploadStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointSyncStatus. +func (s *ServerEndpointSyncStatus) 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 "backgroundDataDownloadActivity": + err = unpopulate(val, "BackgroundDataDownloadActivity", &s.BackgroundDataDownloadActivity) + delete(rawMsg, key) + case "combinedHealth": + err = unpopulate(val, "CombinedHealth", &s.CombinedHealth) + delete(rawMsg, key) + case "downloadActivity": + err = unpopulate(val, "DownloadActivity", &s.DownloadActivity) + delete(rawMsg, key) + case "downloadHealth": + err = unpopulate(val, "DownloadHealth", &s.DownloadHealth) + delete(rawMsg, key) + case "downloadStatus": + err = unpopulate(val, "DownloadStatus", &s.DownloadStatus) + delete(rawMsg, key) + case "lastUpdatedTimestamp": + err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &s.LastUpdatedTimestamp) + delete(rawMsg, key) + case "offlineDataTransferStatus": + err = unpopulate(val, "OfflineDataTransferStatus", &s.OfflineDataTransferStatus) + delete(rawMsg, key) + case "syncActivity": + err = unpopulate(val, "SyncActivity", &s.SyncActivity) + delete(rawMsg, key) + case "totalPersistentFilesNotSyncingCount": + err = unpopulate(val, "TotalPersistentFilesNotSyncingCount", &s.TotalPersistentFilesNotSyncingCount) + delete(rawMsg, key) + case "uploadActivity": + err = unpopulate(val, "UploadActivity", &s.UploadActivity) + delete(rawMsg, key) + case "uploadHealth": + err = unpopulate(val, "UploadHealth", &s.UploadHealth) + delete(rawMsg, key) + case "uploadStatus": + err = unpopulate(val, "UploadStatus", &s.UploadStatus) + 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 ServerEndpointUpdateParameters. +func (s ServerEndpointUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointUpdateParameters. +func (s *ServerEndpointUpdateParameters) 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 "properties": + err = unpopulate(val, "Properties", &s.Properties) + 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 ServerEndpointUpdateProperties. +func (s ServerEndpointUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cloudTiering", s.CloudTiering) + populate(objectMap, "localCacheMode", s.LocalCacheMode) + populate(objectMap, "offlineDataTransfer", s.OfflineDataTransfer) + populate(objectMap, "offlineDataTransferShareName", s.OfflineDataTransferShareName) + populate(objectMap, "tierFilesOlderThanDays", s.TierFilesOlderThanDays) + populate(objectMap, "volumeFreeSpacePercent", s.VolumeFreeSpacePercent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointUpdateProperties. +func (s *ServerEndpointUpdateProperties) 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 "cloudTiering": + err = unpopulate(val, "CloudTiering", &s.CloudTiering) + delete(rawMsg, key) + case "localCacheMode": + err = unpopulate(val, "LocalCacheMode", &s.LocalCacheMode) + delete(rawMsg, key) + case "offlineDataTransfer": + err = unpopulate(val, "OfflineDataTransfer", &s.OfflineDataTransfer) + delete(rawMsg, key) + case "offlineDataTransferShareName": + err = unpopulate(val, "OfflineDataTransferShareName", &s.OfflineDataTransferShareName) + delete(rawMsg, key) + case "tierFilesOlderThanDays": + err = unpopulate(val, "TierFilesOlderThanDays", &s.TierFilesOlderThanDays) + delete(rawMsg, key) + case "volumeFreeSpacePercent": + err = unpopulate(val, "VolumeFreeSpacePercent", &s.VolumeFreeSpacePercent) + 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 Service. +func (s Service) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Service. +func (s *Service) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 ServiceArray. +func (s ServiceArray) 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 ServiceArray. +func (s *ServiceArray) 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 ServiceCreateParameters. +func (s ServiceCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "location", s.Location) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCreateParameters. +func (s *ServiceCreateParameters) 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 "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + 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 ServiceCreateParametersProperties. +func (s ServiceCreateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "incomingTrafficPolicy", s.IncomingTrafficPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCreateParametersProperties. +func (s *ServiceCreateParametersProperties) 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 "incomingTrafficPolicy": + err = unpopulate(val, "IncomingTrafficPolicy", &s.IncomingTrafficPolicy) + 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 ServiceProperties. +func (s ServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "incomingTrafficPolicy", s.IncomingTrafficPolicy) + populate(objectMap, "lastOperationName", s.LastOperationName) + populate(objectMap, "lastWorkflowId", s.LastWorkflowID) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "storageSyncServiceStatus", s.StorageSyncServiceStatus) + populate(objectMap, "storageSyncServiceUid", s.StorageSyncServiceUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties. +func (s *ServiceProperties) 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 "incomingTrafficPolicy": + err = unpopulate(val, "IncomingTrafficPolicy", &s.IncomingTrafficPolicy) + delete(rawMsg, key) + case "lastOperationName": + err = unpopulate(val, "LastOperationName", &s.LastOperationName) + delete(rawMsg, key) + case "lastWorkflowId": + err = unpopulate(val, "LastWorkflowID", &s.LastWorkflowID) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "storageSyncServiceStatus": + err = unpopulate(val, "StorageSyncServiceStatus", &s.StorageSyncServiceStatus) + delete(rawMsg, key) + case "storageSyncServiceUid": + err = unpopulate(val, "StorageSyncServiceUID", &s.StorageSyncServiceUID) + 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 ServiceUpdateParameters. +func (s ServiceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdateParameters. +func (s *ServiceUpdateParameters) 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 "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + 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 ServiceUpdateProperties. +func (s ServiceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "incomingTrafficPolicy", s.IncomingTrafficPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdateProperties. +func (s *ServiceUpdateProperties) 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 "incomingTrafficPolicy": + err = unpopulate(val, "IncomingTrafficPolicy", &s.IncomingTrafficPolicy) + 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 SubscriptionState. +func (s SubscriptionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "istransitioning", s.Istransitioning) + populate(objectMap, "properties", &s.Properties) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionState. +func (s *SubscriptionState) 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 "istransitioning": + err = unpopulate(val, "Istransitioning", &s.Istransitioning) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + 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 SyncGroup. +func (s SyncGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroup. +func (s *SyncGroup) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupArray. +func (s SyncGroupArray) 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 SyncGroupArray. +func (s *SyncGroupArray) 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 SyncGroupCreateParameters. +func (s SyncGroupCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", &s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupCreateParameters. +func (s *SyncGroupCreateParameters) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupProperties. +func (s SyncGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "syncGroupStatus", s.SyncGroupStatus) + populate(objectMap, "uniqueId", s.UniqueID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupProperties. +func (s *SyncGroupProperties) 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 "syncGroupStatus": + err = unpopulate(val, "SyncGroupStatus", &s.SyncGroupStatus) + delete(rawMsg, key) + case "uniqueId": + err = unpopulate(val, "UniqueID", &s.UniqueID) + 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 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, "systemData", t.SystemData) + 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 "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + 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 TriggerChangeDetectionParameters. +func (t TriggerChangeDetectionParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "changeDetectionMode", t.ChangeDetectionMode) + populate(objectMap, "directoryPath", t.DirectoryPath) + populate(objectMap, "paths", t.Paths) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerChangeDetectionParameters. +func (t *TriggerChangeDetectionParameters) 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 "changeDetectionMode": + err = unpopulate(val, "ChangeDetectionMode", &t.ChangeDetectionMode) + delete(rawMsg, key) + case "directoryPath": + err = unpopulate(val, "DirectoryPath", &t.DirectoryPath) + delete(rawMsg, key) + case "paths": + err = unpopulate(val, "Paths", &t.Paths) + 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 TriggerRolloverRequest. +func (t TriggerRolloverRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "serverCertificate", t.ServerCertificate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerRolloverRequest. +func (t *TriggerRolloverRequest) 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 "serverCertificate": + err = unpopulate(val, "ServerCertificate", &t.ServerCertificate) + 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 Workflow. +func (w Workflow) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Workflow. +func (w *Workflow) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkflowArray. +func (w WorkflowArray) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowArray. +func (w *WorkflowArray) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkflowProperties. +func (w WorkflowProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "commandName", w.CommandName) + populateTimeRFC3339(objectMap, "createdTimestamp", w.CreatedTimestamp) + populate(objectMap, "lastOperationId", w.LastOperationID) + populateTimeRFC3339(objectMap, "lastStatusTimestamp", w.LastStatusTimestamp) + populate(objectMap, "lastStepName", w.LastStepName) + populate(objectMap, "operation", w.Operation) + populate(objectMap, "status", w.Status) + populate(objectMap, "steps", w.Steps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowProperties. +func (w *WorkflowProperties) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "commandName": + err = unpopulate(val, "CommandName", &w.CommandName) + delete(rawMsg, key) + case "createdTimestamp": + err = unpopulateTimeRFC3339(val, "CreatedTimestamp", &w.CreatedTimestamp) + delete(rawMsg, key) + case "lastOperationId": + err = unpopulate(val, "LastOperationID", &w.LastOperationID) + delete(rawMsg, key) + case "lastStatusTimestamp": + err = unpopulateTimeRFC3339(val, "LastStatusTimestamp", &w.LastStatusTimestamp) + delete(rawMsg, key) + case "lastStepName": + err = unpopulate(val, "LastStepName", &w.LastStepName) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &w.Operation) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &w.Status) + delete(rawMsg, key) + case "steps": + err = unpopulate(val, "Steps", &w.Steps) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, 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/storagesync/armstoragesync/zz_generated_operations_client.go b/sdk/resourcemanager/storagesync/armstoragesync/operations_client.go similarity index 97% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_operations_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/operations_client.go index 25ae69dea773..e9c655e881da 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_operations_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/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 armstoragesync @@ -50,7 +51,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Storage Sync Rest API operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-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]{ @@ -88,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_operationstatus_client.go b/sdk/resourcemanager/storagesync/armstoragesync/operationstatus_client.go similarity index 98% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_operationstatus_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/operationstatus_client.go index 0217e81f08ee..90931a11b079 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_operationstatus_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/operationstatus_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 armstoragesync @@ -56,7 +57,7 @@ func NewOperationStatusClient(subscriptionID string, credential azcore.TokenCred // Get - Get Operation status // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // locationName - The desired region to obtain information from. // workflowID - workflow Id @@ -105,7 +106,7 @@ func (client *OperationStatusClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/storagesync/armstoragesync/privateendpointconnections_client.go similarity index 97% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_privateendpointconnections_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/privateendpointconnections_client.go index eceebdd16d91..71beb12e8ff0 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/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 armstoragesync @@ -56,7 +57,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreate - Update the state of specified private endpoint connection associated with the storage sync service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - The name of the storage sync service name within the specified resource group. // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -77,7 +78,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreate(ctx context.Context, // Create - Update the state of specified private endpoint connection associated with the storage sync service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *PrivateEndpointConnectionsClient) create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties, options) if err != nil { @@ -117,7 +118,7 @@ func (client *PrivateEndpointConnectionsClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) @@ -125,7 +126,7 @@ func (client *PrivateEndpointConnectionsClient) createCreateRequest(ctx context. // BeginDelete - Deletes the specified private endpoint connection associated with the storage sync service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - The name of the storage sync service name within the specified resource group. // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -145,7 +146,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified private endpoint connection associated with the storage sync service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, storageSyncServiceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, options) if err != nil { @@ -185,7 +186,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +194,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specified private endpoint connection associated with the storage sync service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - The name of the storage sync service name within the specified resource group. // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -238,7 +239,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +256,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByStorageSyncServicePager - Get a PrivateEndpointConnection List. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // options - PrivateEndpointConnectionsClientListByStorageSyncServiceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByStorageSyncService @@ -302,7 +303,7 @@ func (client *PrivateEndpointConnectionsClient) listByStorageSyncServiceCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/storagesync/armstoragesync/privatelinkresources_client.go similarity index 98% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/privatelinkresources_client.go index 654c54bb407f..c764075df4b2 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/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 armstoragesync @@ -56,7 +57,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // ListByStorageSyncService - Gets the private link resources that need to be created for a storage sync service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - The name of the storage sync service name within the specified resource group. // options - PrivateLinkResourcesClientListByStorageSyncServiceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByStorageSyncService @@ -96,7 +97,7 @@ func (client *PrivateLinkResourcesClient) listByStorageSyncServiceCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_registeredservers_client.go b/sdk/resourcemanager/storagesync/armstoragesync/registeredservers_client.go similarity index 97% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_registeredservers_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/registeredservers_client.go index 76a0152dd477..91b0b6af510c 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_registeredservers_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/registeredservers_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 armstoragesync @@ -56,7 +57,7 @@ func NewRegisteredServersClient(subscriptionID string, credential azcore.TokenCr // BeginCreate - Add a new registered server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // serverID - GUID identifying the on-premises server. @@ -77,7 +78,7 @@ func (client *RegisteredServersClient) BeginCreate(ctx context.Context, resource // Create - Add a new registered server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *RegisteredServersClient) create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string, parameters RegisteredServerCreateParameters, options *RegisteredServersClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, storageSyncServiceName, serverID, parameters, options) if err != nil { @@ -117,7 +118,7 @@ func (client *RegisteredServersClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,7 +126,7 @@ func (client *RegisteredServersClient) createCreateRequest(ctx context.Context, // BeginDelete - Delete the given registered server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // serverID - GUID identifying the on-premises server. @@ -145,7 +146,7 @@ func (client *RegisteredServersClient) BeginDelete(ctx context.Context, resource // Delete - Delete the given registered server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *RegisteredServersClient) deleteOperation(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string, options *RegisteredServersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, storageSyncServiceName, serverID, options) if err != nil { @@ -185,7 +186,7 @@ func (client *RegisteredServersClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +194,7 @@ func (client *RegisteredServersClient) deleteCreateRequest(ctx context.Context, // Get - Get a given registered server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // serverID - GUID identifying the on-premises server. @@ -237,7 +238,7 @@ func (client *RegisteredServersClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +261,7 @@ func (client *RegisteredServersClient) getHandleResponse(resp *http.Response) (R // NewListByStorageSyncServicePager - Get a given registered server list. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // options - RegisteredServersClientListByStorageSyncServiceOptions contains the optional parameters for the RegisteredServersClient.ListByStorageSyncService @@ -307,7 +308,7 @@ func (client *RegisteredServersClient) listByStorageSyncServiceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +331,7 @@ func (client *RegisteredServersClient) listByStorageSyncServiceHandleResponse(re // BeginTriggerRollover - Triggers Server certificate rollover. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // serverID - Server Id @@ -351,7 +352,7 @@ func (client *RegisteredServersClient) BeginTriggerRollover(ctx context.Context, // TriggerRollover - Triggers Server certificate rollover. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *RegisteredServersClient) triggerRollover(ctx context.Context, resourceGroupName string, storageSyncServiceName string, serverID string, parameters TriggerRolloverRequest, options *RegisteredServersClientBeginTriggerRolloverOptions) (*http.Response, error) { req, err := client.triggerRolloverCreateRequest(ctx, resourceGroupName, storageSyncServiceName, serverID, parameters, options) if err != nil { @@ -391,7 +392,7 @@ func (client *RegisteredServersClient) triggerRolloverCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-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/storagesync/armstoragesync/zz_generated_response_types.go b/sdk/resourcemanager/storagesync/armstoragesync/response_types.go similarity index 96% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_response_types.go rename to sdk/resourcemanager/storagesync/armstoragesync/response_types.go index 996a827035be..d358fc6af170 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_response_types.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/response_types.go @@ -5,9 +5,20 @@ // 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 armstoragesync +// CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse contains the response from method CloudEndpointsClient.AfsShareMetadataCertificatePublicKeys. +type CloudEndpointsClientAfsShareMetadataCertificatePublicKeysResponse struct { + CloudEndpointAfsShareMetadataCertificatePublicKeys + // XMSCorrelationRequestID contains the information returned from the x-ms-correlation-request-id header response. + XMSCorrelationRequestID *string + + // XMSRequestID contains the information returned from the x-ms-request-id header response. + XMSRequestID *string +} + // CloudEndpointsClientCreateResponse contains the response from method CloudEndpointsClient.Create. type CloudEndpointsClientCreateResponse struct { CloudEndpoint diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_serverendpoints_client.go b/sdk/resourcemanager/storagesync/armstoragesync/serverendpoints_client.go similarity index 97% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_serverendpoints_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/serverendpoints_client.go index 476f45845b15..623b4ca180e5 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_serverendpoints_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/serverendpoints_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 armstoragesync @@ -56,7 +57,7 @@ func NewServerEndpointsClient(subscriptionID string, credential azcore.TokenCred // BeginCreate - Create a new ServerEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -78,7 +79,7 @@ func (client *ServerEndpointsClient) BeginCreate(ctx context.Context, resourceGr // Create - Create a new ServerEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *ServerEndpointsClient) create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters ServerEndpointCreateParameters, options *ServerEndpointsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, options) if err != nil { @@ -122,7 +123,7 @@ func (client *ServerEndpointsClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -130,7 +131,7 @@ func (client *ServerEndpointsClient) createCreateRequest(ctx context.Context, re // BeginDelete - Delete a given ServerEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -151,7 +152,7 @@ func (client *ServerEndpointsClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete a given ServerEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *ServerEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, options *ServerEndpointsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, options) if err != nil { @@ -195,7 +196,7 @@ func (client *ServerEndpointsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +204,7 @@ func (client *ServerEndpointsClient) deleteCreateRequest(ctx context.Context, re // Get - Get a ServerEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -252,7 +253,7 @@ func (client *ServerEndpointsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,7 +276,7 @@ func (client *ServerEndpointsClient) getHandleResponse(resp *http.Response) (Ser // NewListBySyncGroupPager - Get a ServerEndpoint list. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -327,7 +328,7 @@ func (client *ServerEndpointsClient) listBySyncGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,7 +354,7 @@ func (client *ServerEndpointsClient) listBySyncGroupHandleResponse(resp *http.Re // BeginRecallAction - Recall a server endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -375,7 +376,7 @@ func (client *ServerEndpointsClient) BeginRecallAction(ctx context.Context, reso // RecallAction - Recall a server endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *ServerEndpointsClient) recallAction(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, parameters RecallActionParameters, options *ServerEndpointsClientBeginRecallActionOptions) (*http.Response, error) { req, err := client.recallActionCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, options) if err != nil { @@ -419,7 +420,7 @@ func (client *ServerEndpointsClient) recallActionCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -427,7 +428,7 @@ func (client *ServerEndpointsClient) recallActionCreateRequest(ctx context.Conte // BeginUpdate - Patch a given ServerEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -448,7 +449,7 @@ func (client *ServerEndpointsClient) BeginUpdate(ctx context.Context, resourceGr // Update - Patch a given ServerEndpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *ServerEndpointsClient) update(ctx context.Context, resourceGroupName string, storageSyncServiceName string, syncGroupName string, serverEndpointName string, options *ServerEndpointsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, options) if err != nil { @@ -492,7 +493,7 @@ func (client *ServerEndpointsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_services_client.go b/sdk/resourcemanager/storagesync/armstoragesync/services_client.go similarity index 96% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_services_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/services_client.go index dc8504b30ff7..c426d3ed2f4c 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_services_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/services_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 armstoragesync @@ -56,7 +57,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Check the give namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // locationName - The desired region for the name check. // parameters - Parameters to check availability of the given namespace name // options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability @@ -92,7 +93,7 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -109,7 +110,7 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res // BeginCreate - Create a new StorageSyncService. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // parameters - Storage Sync Service resource name. @@ -128,7 +129,7 @@ func (client *ServicesClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Create a new StorageSyncService. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *ServicesClient) create(ctx context.Context, resourceGroupName string, storageSyncServiceName string, parameters ServiceCreateParameters, options *ServicesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, storageSyncServiceName, parameters, options) if err != nil { @@ -164,7 +165,7 @@ func (client *ServicesClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -172,7 +173,7 @@ func (client *ServicesClient) createCreateRequest(ctx context.Context, resourceG // BeginDelete - Delete a given StorageSyncService. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // options - ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. @@ -190,7 +191,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a given StorageSyncService. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, storageSyncServiceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, storageSyncServiceName, options) if err != nil { @@ -226,7 +227,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +235,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a given StorageSyncService. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. @@ -273,7 +274,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -296,7 +297,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListByResourceGroupPager - Get a StorageSyncService list by Resource group name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.ListByResourceGroup // method. @@ -338,7 +339,7 @@ func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -361,7 +362,7 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Get a StorageSyncService list by subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.ListBySubscription // method. func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse] { @@ -398,7 +399,7 @@ func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -421,7 +422,7 @@ func (client *ServicesClient) listBySubscriptionHandleResponse(resp *http.Respon // BeginUpdate - Patch a given StorageSyncService. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // options - ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. @@ -439,7 +440,7 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Patch a given StorageSyncService. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, storageSyncServiceName string, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, storageSyncServiceName, options) if err != nil { @@ -475,7 +476,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_syncgroups_client.go b/sdk/resourcemanager/storagesync/armstoragesync/syncgroups_client.go similarity index 97% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_syncgroups_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/syncgroups_client.go index e23366c59925..8ec2ad1dfafa 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_syncgroups_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/syncgroups_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 armstoragesync @@ -56,7 +57,7 @@ func NewSyncGroupsClient(subscriptionID string, credential azcore.TokenCredentia // Create - Create a new SyncGroup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -101,7 +102,7 @@ func (client *SyncGroupsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -124,7 +125,7 @@ func (client *SyncGroupsClient) createHandleResponse(resp *http.Response) (SyncG // Delete - Delete a given SyncGroup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -168,7 +169,7 @@ func (client *SyncGroupsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +189,7 @@ func (client *SyncGroupsClient) deleteHandleResponse(resp *http.Response) (SyncG // Get - Get a given SyncGroup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // syncGroupName - Name of Sync Group resource. @@ -232,7 +233,7 @@ func (client *SyncGroupsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +256,7 @@ func (client *SyncGroupsClient) getHandleResponse(resp *http.Response) (SyncGrou // NewListByStorageSyncServicePager - Get a SyncGroup List. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // options - SyncGroupsClientListByStorageSyncServiceOptions contains the optional parameters for the SyncGroupsClient.ListByStorageSyncService @@ -302,7 +303,7 @@ func (client *SyncGroupsClient) listByStorageSyncServiceCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_time_rfc3339.go b/sdk/resourcemanager/storagesync/armstoragesync/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/storagesync/armstoragesync/time_rfc3339.go index 5b2ebe376cea..eed23e1601ad 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/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 armstoragesync diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_workflows_client.go b/sdk/resourcemanager/storagesync/armstoragesync/workflows_client.go similarity index 97% rename from sdk/resourcemanager/storagesync/armstoragesync/zz_generated_workflows_client.go rename to sdk/resourcemanager/storagesync/armstoragesync/workflows_client.go index 2c3f241794e7..b69feea29de8 100644 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_workflows_client.go +++ b/sdk/resourcemanager/storagesync/armstoragesync/workflows_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 armstoragesync @@ -56,7 +57,7 @@ func NewWorkflowsClient(subscriptionID string, credential azcore.TokenCredential // Abort - Abort the given workflow. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // workflowID - workflow Id @@ -100,7 +101,7 @@ func (client *WorkflowsClient) abortCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,7 +121,7 @@ func (client *WorkflowsClient) abortHandleResponse(resp *http.Response) (Workflo // Get - Get Workflows resource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // workflowID - workflow Id @@ -164,7 +165,7 @@ func (client *WorkflowsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,7 +188,7 @@ func (client *WorkflowsClient) getHandleResponse(resp *http.Response) (Workflows // NewListByStorageSyncServicePager - Get a Workflow List // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-09-01 +// Generated from API version 2022-06-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // storageSyncServiceName - Name of Storage Sync Service resource. // options - WorkflowsClientListByStorageSyncServiceOptions contains the optional parameters for the WorkflowsClient.ListByStorageSyncService @@ -234,7 +235,7 @@ func (client *WorkflowsClient) listByStorageSyncServiceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-09-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_cloudendpoints_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_cloudendpoints_client_test.go deleted file mode 100644 index 0c37e107b300..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_cloudendpoints_client_test.go +++ /dev/null @@ -1,337 +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 armstoragesync_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/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_Create.json -func ExampleCloudEndpointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleCloudEndpoint_1", - armstoragesync.CloudEndpointCreateParameters{ - Properties: &armstoragesync.CloudEndpointCreateParametersProperties{ - AzureFileShareName: to.Ptr("cvcloud-afscv-0719-058-a94a1354-a1fd-4e9a-9a50-919fad8c4ba4"), - FriendlyName: to.Ptr("ankushbsubscriptionmgmtmab"), - StorageAccountResourceID: to.Ptr("/subscriptions/744f4d70-6d17-4921-8970-a765d14f763f/resourceGroups/tminienv59svc/providers/Microsoft.Storage/storageAccounts/tminienv59storage"), - StorageAccountTenantID: to.Ptr("\"72f988bf-86f1-41af-91ab-2d7cd011db47\""), - }, - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_Get.json -func ExampleCloudEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleCloudEndpoint_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_Delete.json -func ExampleCloudEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleCloudEndpoint_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_ListBySyncGroup.json -func ExampleCloudEndpointsClient_NewListBySyncGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySyncGroupPager("SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_PreBackup.json -func ExampleCloudEndpointsClient_BeginPreBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPreBackup(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleCloudEndpoint_1", - armstoragesync.BackupRequest{ - AzureFileShare: to.Ptr("https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare"), - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_PostBackup.json -func ExampleCloudEndpointsClient_BeginPostBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPostBackup(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleCloudEndpoint_1", - armstoragesync.BackupRequest{ - AzureFileShare: to.Ptr("https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare"), - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_PreRestore.json -func ExampleCloudEndpointsClient_BeginPreRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPreRestore(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleCloudEndpoint_1", - armstoragesync.PreRestoreRequest{ - AzureFileShareURI: to.Ptr("https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare"), - RestoreFileSpec: []*armstoragesync.RestoreFileSpec{ - { - Path: to.Ptr("text1.txt"), - Isdir: to.Ptr(false), - }, - { - Path: to.Ptr("MyDir"), - Isdir: to.Ptr(true), - }, - { - Path: to.Ptr("MyDir/SubDir"), - Isdir: to.Ptr(false), - }, - { - Path: to.Ptr("MyDir/SubDir/File1.pdf"), - Isdir: to.Ptr(false), - }}, - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_RestoreHeatbeat.json -func ExampleCloudEndpointsClient_Restoreheartbeat() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Restoreheartbeat(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleCloudEndpoint_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_PostRestore.json -func ExampleCloudEndpointsClient_BeginPostRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPostRestore(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleCloudEndpoint_1", - armstoragesync.PostRestoreRequest{ - AzureFileShareURI: to.Ptr("https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare"), - RestoreFileSpec: []*armstoragesync.RestoreFileSpec{ - { - Path: to.Ptr("text1.txt"), - Isdir: to.Ptr(false), - }, - { - Path: to.Ptr("MyDir"), - Isdir: to.Ptr(true), - }, - { - Path: to.Ptr("MyDir/SubDir"), - Isdir: to.Ptr(false), - }, - { - Path: to.Ptr("MyDir/SubDir/File1.pdf"), - Isdir: to.Ptr(false), - }}, - SourceAzureFileShareURI: to.Ptr("https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare"), - Status: to.Ptr("Succeeded"), - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/CloudEndpoints_TriggerChangeDetection.json -func ExampleCloudEndpointsClient_BeginTriggerChangeDetection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewCloudEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTriggerChangeDetection(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleCloudEndpoint_1", - armstoragesync.TriggerChangeDetectionParameters{ - ChangeDetectionMode: to.Ptr(armstoragesync.ChangeDetectionModeRecursive), - DirectoryPath: to.Ptr("NewDirectory"), - }, - 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/storagesync/armstoragesync/ze_generated_example_microsoftstoragesync_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_microsoftstoragesync_client_test.go deleted file mode 100644 index 79220d4447e0..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_microsoftstoragesync_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 armstoragesync_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/LocationOperationStatus_Get.json -func ExampleMicrosoftStorageSyncClient_LocationOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewMicrosoftStorageSyncClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.LocationOperationStatus(ctx, - "westus", - "eyJwYXJ0aXRpb25JZCI6ImE1ZDNiMDU4LTYwN2MtNDI0Ny05Y2FmLWJlZmU4NGQ0ZDU0NyIsIndvcmtmbG93SWQiOiJjYzg1MTY2YS0xMjI2LTQ4MGYtYWM5ZC1jMmRhNTVmY2M2ODYiLCJ3b3JrZmxvd09wZXJhdGlvbklkIjoiOTdmODU5ZTAtOGY1MC00ZTg4LWJkZDEtNWZlYzgwYTVlYzM0tui=", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_operations_client_test.go deleted file mode 100644 index b5d86c074dd3..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/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 armstoragesync_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/Operations_List.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 := armstoragesync.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/storagesync/armstoragesync/ze_generated_example_operationstatus_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_operationstatus_client_test.go deleted file mode 100644 index bd589ab5bfa6..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_operationstatus_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 armstoragesync_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/OperationStatus_Get.json -func ExampleOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewOperationStatusClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SampleResourceGroup_1", - "westus", - "828219ea-083e-48b5-89ea-8fd9991b2e75", - "14b50e24-f68d-4b29-a882-38be9dfb8bd1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index b88d875e7a3c..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_privateendpointconnections_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 armstoragesync_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/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/PrivateEndpointConnections_Get.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 := armstoragesync.NewPrivateEndpointConnectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "res6977", - "sss2527", - "{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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/PrivateEndpointConnections_Create.json -func ExamplePrivateEndpointConnectionsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewPrivateEndpointConnectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "res7687", - "sss2527", - "{privateEndpointConnectionName}", - armstoragesync.PrivateEndpointConnection{ - Properties: &armstoragesync.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armstoragesync.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armstoragesync.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/PrivateEndpointConnections_Delete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewPrivateEndpointConnectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "res6977", - "sss2527", - "{privateEndpointConnectionName}", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/PrivateEndpointConnections_ListByStorageSyncService.json -func ExamplePrivateEndpointConnectionsClient_NewListByStorageSyncServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewPrivateEndpointConnectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStorageSyncServicePager("res6977", - "sss2527", - 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/storagesync/armstoragesync/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 549f957a2927..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/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 armstoragesync_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/PrivateLinkResources_List.json -func ExamplePrivateLinkResourcesClient_ListByStorageSyncService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewPrivateLinkResourcesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByStorageSyncService(ctx, - "res6977", - "sss2527", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_registeredservers_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_registeredservers_client_test.go deleted file mode 100644 index f0a9a98a1b82..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_registeredservers_client_test.go +++ /dev/null @@ -1,157 +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 armstoragesync_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/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/RegisteredServers_ListByStorageSyncService.json -func ExampleRegisteredServersClient_NewListByStorageSyncServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewRegisteredServersClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStorageSyncServicePager("SampleResourceGroup_1", - "SampleStorageSyncService_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/RegisteredServers_Get.json -func ExampleRegisteredServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewRegisteredServersClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "080d4133-bdb5-40a0-96a0-71a6057bfe9a", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/RegisteredServers_Create.json -func ExampleRegisteredServersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewRegisteredServersClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "080d4133-bdb5-40a0-96a0-71a6057bfe9a", - armstoragesync.RegisteredServerCreateParameters{ - Properties: &armstoragesync.RegisteredServerCreateParametersProperties{ - AgentVersion: to.Ptr("1.0.277.0"), - FriendlyName: to.Ptr("afscv-2304-139"), - ServerCertificate: to.Ptr("MIIDFjCCAf6gAwIBAgIQQS+DS8uhc4VNzUkTw7wbRjANBgkqhkiG9w0BAQ0FADAzMTEwLwYDVQQDEyhhbmt1c2hiLXByb2QzLnJlZG1vbmQuY29ycC5taWNyb3NvZnQuY29tMB4XDTE3MDgwMzE3MDQyNFoXDTE4MDgwNDE3MDQyNFowMzExMC8GA1UEAxMoYW5rdXNoYi1wcm9kMy5yZWRtb25kLmNvcnAubWljcm9zb2Z0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALDRvV4gmsIy6jGDPiHsXmvgVP749NNP7DopdlbHaNhjFmYINHl0uWylyaZmgJrROt2mnxN/zEyJtGnqYHlzUr4xvGq/qV5pqgdB9tag/sw9i22gfe9PRZ0FmSOZnXMbLYgLiDFqLtut5gHcOuWMj03YnkfoBEKlFBxWbagvW2yxz/Sxi9OVSJOKCaXra0RpcIHrO/KFl6ho2eE1/7Ykmfa8hZvSdoPd5gHdLiQcMB/pxq+mWp1fI6c8vFZoDu7Atn+NXTzYPKUxKzaisF12TsaKpohUsJpbB3Wocb0F5frn614D2pg14ERB5otjAMWw1m65csQWPI6dP8KIYe0+QPkCAwEAAaMmMCQwIgYDVR0lAQH/BBgwFgYIKwYBBQUHAwIGCisGAQQBgjcKAwwwDQYJKoZIhvcNAQENBQADggEBAA4RhVIBkw34M1RwakJgHvtjsOFxF1tVQA941NtLokx1l2Z8+GFQkcG4xpZSt+UN6wLerdCbnNhtkCErWUDeaT0jxk4g71Ofex7iM04crT4iHJr8mi96/XnhnkTUs+GDk12VgdeeNEczMZz+8Mxw9dJ5NCnYgTwO0SzGlclRsDvjzkLo8rh2ZG6n/jKrEyNXXo+hOqhupij0QbRP2Tvexdfw201kgN1jdZify8XzJ8Oi0bTS0KpJf2pNPOlooK2bjMUei9ANtEdXwwfVZGWvVh6tJjdv6k14wWWJ1L7zhA1IIVb1J+sQUzJji5iX0DrezjTz1Fg+gAzITaA/WsuujlM="), - ServerID: to.Ptr("080d4133-bdb5-40a0-96a0-71a6057bfe9a"), - ServerOSVersion: to.Ptr("10.0.14393.0"), - ServerRole: to.Ptr("Standalone"), - }, - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/RegisteredServers_Delete.json -func ExampleRegisteredServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewRegisteredServersClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "41166691-ab03-43e9-ab3e-0330eda162ac", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/RegisteredServers_TriggerRollover.json -func ExampleRegisteredServersClient_BeginTriggerRollover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewRegisteredServersClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTriggerRollover(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "d166ca76-dad2-49df-b409-12345642d730", - armstoragesync.TriggerRolloverRequest{ - ServerCertificate: to.Ptr("\"MIIDFjCCAf6gAwIBAgIQQS+DS8uhc4VNzUkTw7wbRjANBgkqhkiG9w0BAQ0FADAzMTEwLwYDVQQDEyhhbmt1c2hiLXByb2QzLnJlZG1vbmQuY29ycC5taWNyb3NvZnQuY29tMB4XDTE3MDgwMzE3MDQyNFoXDTE4MDgwNDE3MDQyNFowMzExMC8GA1UEAxMoYW5rdXNoYi1wcm9kMy5yZWRtb25kLmNvcnAubWljcm9zb2Z0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALDRvV4gmsIy6jGDPiHsXmvgVP749NNP7DopdlbHaNhjFmYINHl0uWylyaZmgJrROt2mnxN/zEyJtGnqYHlzUr4xvGq/qV5pqgdB9tag/sw9i22gfe9PRZ0FmSOZnXMbLYgLiDFqLtut5gHcOuWMj03YnkfoBEKlFBxWbagvW2yxz/Sxi9OVSJOKCaXra0RpcIHrO/KFl6ho2eE1/7Ykmfa8hZvSdoPd5gHdLiQcMB/pxq+mWp1fI6c8vFZoDu7Atn+NXTzYPKUxKzaisF12TsaKpohUsJpbB3Wocb0F5frn614D2pg14ERB5otjAMWw1m65csQWPI6dP8KIYe0+QPkCAwEAAaMmMCQwIgYDVR0lAQH/BBgwFgYIKwYBBQUHAwIGCisGAQQBgjcKAwwwDQYJKoZIhvcNAQENBQADggEBAA4RhVIBkw34M1RwakJgHvtjsOFxF1tVQA941NtLokx1l2Z8+GFQkcG4xpZSt+UN6wLerdCbnNhtkCErWUDeaT0jxk4g71Ofex7iM04crT4iHJr8mi96/XnhnkTUs+GDk12VgdeeNEczMZz+8Mxw9dJ5NCnYgTwO0SzGlclRsDvjzkLo8rh2ZG6n/jKrEyNXXo+hOqhupij0QbRP2Tvexdfw201kgN1jdZify8XzJ8Oi0bTS0KpJf2pNPOlooK2bjMUei9ANtEdXwwfVZGWvVh6tJjdv6k14wWWJ1L7zhA1IIVb1J+sQUzJji5iX0DrezjTz1Fg+gAzITaA/WsuujlM=\""), - }, - 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/storagesync/armstoragesync/ze_generated_example_serverendpoints_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_serverendpoints_client_test.go deleted file mode 100644 index 3052dc8d7119..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_serverendpoints_client_test.go +++ /dev/null @@ -1,204 +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 armstoragesync_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/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/ServerEndpoints_Create.json -func ExampleServerEndpointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServerEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleServerEndpoint_1", - armstoragesync.ServerEndpointCreateParameters{ - Properties: &armstoragesync.ServerEndpointCreateParametersProperties{ - CloudTiering: to.Ptr(armstoragesync.FeatureStatusOff), - InitialDownloadPolicy: to.Ptr(armstoragesync.InitialDownloadPolicyNamespaceThenModifiedFiles), - InitialUploadPolicy: to.Ptr(armstoragesync.InitialUploadPolicyServerAuthoritative), - LocalCacheMode: to.Ptr(armstoragesync.LocalCacheModeUpdateLocallyCachedFiles), - OfflineDataTransfer: to.Ptr(armstoragesync.FeatureStatusOn), - OfflineDataTransferShareName: to.Ptr("myfileshare"), - ServerLocalPath: to.Ptr("D:\\SampleServerEndpoint_1"), - ServerResourceID: to.Ptr("/subscriptions/52b8da2f-61e0-4a1f-8dde-336911f367fb/resourceGroups/SampleResourceGroup_1/providers/Microsoft.StorageSync/storageSyncServices/SampleStorageSyncService_1/registeredServers/080d4133-bdb5-40a0-96a0-71a6057bfe9a"), - TierFilesOlderThanDays: to.Ptr[int32](0), - VolumeFreeSpacePercent: to.Ptr[int32](100), - }, - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/ServerEndpoints_Update.json -func ExampleServerEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServerEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleServerEndpoint_1", - &armstoragesync.ServerEndpointsClientBeginUpdateOptions{Parameters: &armstoragesync.ServerEndpointUpdateParameters{ - Properties: &armstoragesync.ServerEndpointUpdateProperties{ - CloudTiering: to.Ptr(armstoragesync.FeatureStatusOff), - LocalCacheMode: to.Ptr(armstoragesync.LocalCacheModeUpdateLocallyCachedFiles), - OfflineDataTransfer: to.Ptr(armstoragesync.FeatureStatusOff), - TierFilesOlderThanDays: to.Ptr[int32](0), - VolumeFreeSpacePercent: to.Ptr[int32](100), - }, - }, - }) - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/ServerEndpoints_Get.json -func ExampleServerEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServerEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleServerEndpoint_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/ServerEndpoints_Delete.json -func ExampleServerEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServerEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleServerEndpoint_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/ServerEndpoints_ListBySyncGroup.json -func ExampleServerEndpointsClient_NewListBySyncGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServerEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySyncGroupPager("SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/ServerEndpoints_Recall.json -func ExampleServerEndpointsClient_BeginRecallAction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServerEndpointsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRecallAction(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - "SampleServerEndpoint_1", - armstoragesync.RecallActionParameters{ - Pattern: to.Ptr(""), - RecallPath: to.Ptr(""), - }, - 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/storagesync/armstoragesync/ze_generated_example_storagesyncservices_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_storagesyncservices_client_test.go deleted file mode 100644 index 297636aa1d71..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_storagesyncservices_client_test.go +++ /dev/null @@ -1,206 +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 armstoragesync_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/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/StorageSyncServiceCheckNameAvailability_AlreadyExists.json -func ExampleServicesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServicesClient("5c6bc8e1-1eaf-4192-94d8-58ce463ac86c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - "westus", - armstoragesync.CheckNameAvailabilityParameters{ - Name: to.Ptr("newstoragesyncservicename"), - Type: to.Ptr("Microsoft.StorageSync/storageSyncServices"), - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/StorageSyncServices_Create.json -func ExampleServicesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServicesClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - armstoragesync.ServiceCreateParameters{ - Location: to.Ptr("WestUS"), - Properties: &armstoragesync.ServiceCreateParametersProperties{ - IncomingTrafficPolicy: to.Ptr(armstoragesync.IncomingTrafficPolicyAllowAllTraffic), - }, - Tags: map[string]*string{}, - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/StorageSyncServices_Get.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServicesClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/StorageSyncServices_Update.json -func ExampleServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServicesClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - &armstoragesync.ServicesClientBeginUpdateOptions{Parameters: &armstoragesync.ServiceUpdateParameters{ - Properties: &armstoragesync.ServiceUpdateProperties{ - IncomingTrafficPolicy: to.Ptr(armstoragesync.IncomingTrafficPolicyAllowAllTraffic), - }, - Tags: map[string]*string{ - "Dept": to.Ptr("IT"), - "Environment": to.Ptr("Test"), - }, - }, - }) - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/StorageSyncServices_Delete.json -func ExampleServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServicesClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/StorageSyncServices_ListByResourceGroup.json -func ExampleServicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServicesClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("SampleResourceGroup_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/StorageSyncServices_ListBySubscription.json -func ExampleServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewServicesClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_syncgroups_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_syncgroups_client_test.go deleted file mode 100644 index 9e9189c76857..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_syncgroups_client_test.go +++ /dev/null @@ -1,113 +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 armstoragesync_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/SyncGroups_ListByStorageSyncService.json -func ExampleSyncGroupsClient_NewListByStorageSyncServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewSyncGroupsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStorageSyncServicePager("SampleResourceGroup_1", - "SampleStorageSyncService_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/SyncGroups_Create.json -func ExampleSyncGroupsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewSyncGroupsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - armstoragesync.SyncGroupCreateParameters{ - Properties: map[string]interface{}{}, - }, - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/SyncGroups_Get.json -func ExampleSyncGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewSyncGroupsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/SyncGroups_Delete.json -func ExampleSyncGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewSyncGroupsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "SampleSyncGroup_1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_workflows_client_test.go b/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_workflows_client_test.go deleted file mode 100644 index 5208b6b0ac85..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/ze_generated_example_workflows_client_test.go +++ /dev/null @@ -1,87 +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 armstoragesync_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagesync/armstoragesync" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/Workflows_ListByStorageSyncService.json -func ExampleWorkflowsClient_NewListByStorageSyncServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewWorkflowsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStorageSyncServicePager("SampleResourceGroup_1", - "SampleStorageSyncService_1", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/Workflows_Get.json -func ExampleWorkflowsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewWorkflowsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "828219ea-083e-48b5-89ea-8fd9991b2e75", - 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/storagesync/resource-manager/Microsoft.StorageSync/stable/2020-09-01/examples/Workflows_Abort.json -func ExampleWorkflowsClient_Abort() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armstoragesync.NewWorkflowsClient("52b8da2f-61e0-4a1f-8dde-336911f367fb", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Abort(ctx, - "SampleResourceGroup_1", - "SampleStorageSyncService_1", - "7ffd50b3-5574-478d-9ff2-9371bc42ce68", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_models_serde.go b/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_models_serde.go deleted file mode 100644 index 0d9b2d77ed4b..000000000000 --- a/sdk/resourcemanager/storagesync/armstoragesync/zz_generated_models_serde.go +++ /dev/null @@ -1,1094 +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 armstoragesync - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type CloudEndpointChangeEnumerationActivity. -func (c CloudEndpointChangeEnumerationActivity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "deletesProgressPercent", c.DeletesProgressPercent) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) - populate(objectMap, "minutesRemaining", c.MinutesRemaining) - populate(objectMap, "operationState", c.OperationState) - populate(objectMap, "processedDirectoriesCount", c.ProcessedDirectoriesCount) - populate(objectMap, "processedFilesCount", c.ProcessedFilesCount) - populate(objectMap, "progressPercent", c.ProgressPercent) - populateTimeRFC3339(objectMap, "startedTimestamp", c.StartedTimestamp) - populate(objectMap, "statusCode", c.StatusCode) - populate(objectMap, "totalCountsState", c.TotalCountsState) - populate(objectMap, "totalDirectoriesCount", c.TotalDirectoriesCount) - populate(objectMap, "totalFilesCount", c.TotalFilesCount) - populate(objectMap, "totalSizeBytes", c.TotalSizeBytes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointChangeEnumerationActivity. -func (c *CloudEndpointChangeEnumerationActivity) 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 "deletesProgressPercent": - err = unpopulate(val, "DeletesProgressPercent", &c.DeletesProgressPercent) - delete(rawMsg, key) - case "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) - delete(rawMsg, key) - case "minutesRemaining": - err = unpopulate(val, "MinutesRemaining", &c.MinutesRemaining) - delete(rawMsg, key) - case "operationState": - err = unpopulate(val, "OperationState", &c.OperationState) - delete(rawMsg, key) - case "processedDirectoriesCount": - err = unpopulate(val, "ProcessedDirectoriesCount", &c.ProcessedDirectoriesCount) - delete(rawMsg, key) - case "processedFilesCount": - err = unpopulate(val, "ProcessedFilesCount", &c.ProcessedFilesCount) - delete(rawMsg, key) - case "progressPercent": - err = unpopulate(val, "ProgressPercent", &c.ProgressPercent) - delete(rawMsg, key) - case "startedTimestamp": - err = unpopulateTimeRFC3339(val, "StartedTimestamp", &c.StartedTimestamp) - delete(rawMsg, key) - case "statusCode": - err = unpopulate(val, "StatusCode", &c.StatusCode) - delete(rawMsg, key) - case "totalCountsState": - err = unpopulate(val, "TotalCountsState", &c.TotalCountsState) - delete(rawMsg, key) - case "totalDirectoriesCount": - err = unpopulate(val, "TotalDirectoriesCount", &c.TotalDirectoriesCount) - delete(rawMsg, key) - case "totalFilesCount": - err = unpopulate(val, "TotalFilesCount", &c.TotalFilesCount) - delete(rawMsg, key) - case "totalSizeBytes": - err = unpopulate(val, "TotalSizeBytes", &c.TotalSizeBytes) - 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 CloudEndpointChangeEnumerationStatus. -func (c CloudEndpointChangeEnumerationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "activity", c.Activity) - populate(objectMap, "lastEnumerationStatus", c.LastEnumerationStatus) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointChangeEnumerationStatus. -func (c *CloudEndpointChangeEnumerationStatus) 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 "activity": - err = unpopulate(val, "Activity", &c.Activity) - delete(rawMsg, key) - case "lastEnumerationStatus": - err = unpopulate(val, "LastEnumerationStatus", &c.LastEnumerationStatus) - delete(rawMsg, key) - case "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) - 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 CloudEndpointLastChangeEnumerationStatus. -func (c CloudEndpointLastChangeEnumerationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "completedTimestamp", c.CompletedTimestamp) - populate(objectMap, "namespaceDirectoriesCount", c.NamespaceDirectoriesCount) - populate(objectMap, "namespaceFilesCount", c.NamespaceFilesCount) - populate(objectMap, "namespaceSizeBytes", c.NamespaceSizeBytes) - populateTimeRFC3339(objectMap, "nextRunTimestamp", c.NextRunTimestamp) - populateTimeRFC3339(objectMap, "startedTimestamp", c.StartedTimestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudEndpointLastChangeEnumerationStatus. -func (c *CloudEndpointLastChangeEnumerationStatus) 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 "completedTimestamp": - err = unpopulateTimeRFC3339(val, "CompletedTimestamp", &c.CompletedTimestamp) - delete(rawMsg, key) - case "namespaceDirectoriesCount": - err = unpopulate(val, "NamespaceDirectoriesCount", &c.NamespaceDirectoriesCount) - delete(rawMsg, key) - case "namespaceFilesCount": - err = unpopulate(val, "NamespaceFilesCount", &c.NamespaceFilesCount) - delete(rawMsg, key) - case "namespaceSizeBytes": - err = unpopulate(val, "NamespaceSizeBytes", &c.NamespaceSizeBytes) - delete(rawMsg, key) - case "nextRunTimestamp": - err = unpopulateTimeRFC3339(val, "NextRunTimestamp", &c.NextRunTimestamp) - delete(rawMsg, key) - case "startedTimestamp": - err = unpopulateTimeRFC3339(val, "StartedTimestamp", &c.StartedTimestamp) - 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 CloudTieringCachePerformance. -func (c CloudTieringCachePerformance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cacheHitBytes", c.CacheHitBytes) - populate(objectMap, "cacheHitBytesPercent", c.CacheHitBytesPercent) - populate(objectMap, "cacheMissBytes", c.CacheMissBytes) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringCachePerformance. -func (c *CloudTieringCachePerformance) 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 "cacheHitBytes": - err = unpopulate(val, "CacheHitBytes", &c.CacheHitBytes) - delete(rawMsg, key) - case "cacheHitBytesPercent": - err = unpopulate(val, "CacheHitBytesPercent", &c.CacheHitBytesPercent) - delete(rawMsg, key) - case "cacheMissBytes": - err = unpopulate(val, "CacheMissBytes", &c.CacheMissBytes) - delete(rawMsg, key) - case "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) - 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 CloudTieringDatePolicyStatus. -func (c CloudTieringDatePolicyStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) - populateTimeRFC3339(objectMap, "tieredFilesMostRecentAccessTimestamp", c.TieredFilesMostRecentAccessTimestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringDatePolicyStatus. -func (c *CloudTieringDatePolicyStatus) 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 "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) - delete(rawMsg, key) - case "tieredFilesMostRecentAccessTimestamp": - err = unpopulateTimeRFC3339(val, "TieredFilesMostRecentAccessTimestamp", &c.TieredFilesMostRecentAccessTimestamp) - 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 CloudTieringFilesNotTiering. -func (c CloudTieringFilesNotTiering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errors", c.Errors) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) - populate(objectMap, "totalFileCount", c.TotalFileCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringFilesNotTiering. -func (c *CloudTieringFilesNotTiering) 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 "errors": - err = unpopulate(val, "Errors", &c.Errors) - delete(rawMsg, key) - case "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) - delete(rawMsg, key) - case "totalFileCount": - err = unpopulate(val, "TotalFileCount", &c.TotalFileCount) - 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 CloudTieringSpaceSavings. -func (c CloudTieringSpaceSavings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cachedSizeBytes", c.CachedSizeBytes) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) - populate(objectMap, "spaceSavingsBytes", c.SpaceSavingsBytes) - populate(objectMap, "spaceSavingsPercent", c.SpaceSavingsPercent) - populate(objectMap, "totalSizeCloudBytes", c.TotalSizeCloudBytes) - populate(objectMap, "volumeSizeBytes", c.VolumeSizeBytes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringSpaceSavings. -func (c *CloudTieringSpaceSavings) 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 "cachedSizeBytes": - err = unpopulate(val, "CachedSizeBytes", &c.CachedSizeBytes) - delete(rawMsg, key) - case "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) - delete(rawMsg, key) - case "spaceSavingsBytes": - err = unpopulate(val, "SpaceSavingsBytes", &c.SpaceSavingsBytes) - delete(rawMsg, key) - case "spaceSavingsPercent": - err = unpopulate(val, "SpaceSavingsPercent", &c.SpaceSavingsPercent) - delete(rawMsg, key) - case "totalSizeCloudBytes": - err = unpopulate(val, "TotalSizeCloudBytes", &c.TotalSizeCloudBytes) - delete(rawMsg, key) - case "volumeSizeBytes": - err = unpopulate(val, "VolumeSizeBytes", &c.VolumeSizeBytes) - 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 CloudTieringVolumeFreeSpacePolicyStatus. -func (c CloudTieringVolumeFreeSpacePolicyStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "currentVolumeFreeSpacePercent", c.CurrentVolumeFreeSpacePercent) - populate(objectMap, "effectiveVolumeFreeSpacePolicy", c.EffectiveVolumeFreeSpacePolicy) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", c.LastUpdatedTimestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudTieringVolumeFreeSpacePolicyStatus. -func (c *CloudTieringVolumeFreeSpacePolicyStatus) 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 "currentVolumeFreeSpacePercent": - err = unpopulate(val, "CurrentVolumeFreeSpacePercent", &c.CurrentVolumeFreeSpacePercent) - delete(rawMsg, key) - case "effectiveVolumeFreeSpacePolicy": - err = unpopulate(val, "EffectiveVolumeFreeSpacePolicy", &c.EffectiveVolumeFreeSpacePolicy) - delete(rawMsg, key) - case "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &c.LastUpdatedTimestamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LocationOperationStatus. -func (l *LocationOperationStatus) 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 "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &l.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &l.Error) - 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 "percentComplete": - err = unpopulate(val, "PercentComplete", &l.PercentComplete) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &l.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &l.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. -func (o *OperationStatus) 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 "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &o.Error) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) - 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 PostRestoreRequest. -func (p PostRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureFileShareUri", p.AzureFileShareURI) - populate(objectMap, "failedFileList", p.FailedFileList) - populate(objectMap, "partition", p.Partition) - populate(objectMap, "replicaGroup", p.ReplicaGroup) - populate(objectMap, "requestId", p.RequestID) - populate(objectMap, "restoreFileSpec", p.RestoreFileSpec) - populate(objectMap, "sourceAzureFileShareUri", p.SourceAzureFileShareURI) - populate(objectMap, "status", p.Status) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PreRestoreRequest. -func (p PreRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureFileShareUri", p.AzureFileShareURI) - populate(objectMap, "backupMetadataPropertyBag", p.BackupMetadataPropertyBag) - populate(objectMap, "partition", p.Partition) - populate(objectMap, "pauseWaitForSyncDrainTimePeriodInSeconds", p.PauseWaitForSyncDrainTimePeriodInSeconds) - populate(objectMap, "replicaGroup", p.ReplicaGroup) - populate(objectMap, "requestId", p.RequestID) - populate(objectMap, "restoreFileSpec", p.RestoreFileSpec) - populate(objectMap, "sourceAzureFileShareUri", p.SourceAzureFileShareURI) - populate(objectMap, "status", p.Status) - return json.Marshal(objectMap) -} - -// 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 RegisteredServerProperties. -func (r RegisteredServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentVersion", r.AgentVersion) - populateTimeRFC3339(objectMap, "agentVersionExpirationDate", r.AgentVersionExpirationDate) - populate(objectMap, "agentVersionStatus", r.AgentVersionStatus) - populate(objectMap, "clusterId", r.ClusterID) - populate(objectMap, "clusterName", r.ClusterName) - populate(objectMap, "discoveryEndpointUri", r.DiscoveryEndpointURI) - populate(objectMap, "friendlyName", r.FriendlyName) - populate(objectMap, "lastHeartBeat", r.LastHeartBeat) - populate(objectMap, "lastOperationName", r.LastOperationName) - populate(objectMap, "lastWorkflowId", r.LastWorkflowID) - populate(objectMap, "managementEndpointUri", r.ManagementEndpointURI) - populate(objectMap, "monitoringConfiguration", r.MonitoringConfiguration) - populate(objectMap, "monitoringEndpointUri", r.MonitoringEndpointURI) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "resourceLocation", r.ResourceLocation) - populate(objectMap, "serverCertificate", r.ServerCertificate) - populate(objectMap, "serverId", r.ServerID) - populate(objectMap, "serverManagementErrorCode", r.ServerManagementErrorCode) - populate(objectMap, "serverName", r.ServerName) - populate(objectMap, "serverOSVersion", r.ServerOSVersion) - populate(objectMap, "serverRole", r.ServerRole) - populate(objectMap, "serviceLocation", r.ServiceLocation) - populate(objectMap, "storageSyncServiceUid", r.StorageSyncServiceUID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegisteredServerProperties. -func (r *RegisteredServerProperties) 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 "agentVersion": - err = unpopulate(val, "AgentVersion", &r.AgentVersion) - delete(rawMsg, key) - case "agentVersionExpirationDate": - err = unpopulateTimeRFC3339(val, "AgentVersionExpirationDate", &r.AgentVersionExpirationDate) - delete(rawMsg, key) - case "agentVersionStatus": - err = unpopulate(val, "AgentVersionStatus", &r.AgentVersionStatus) - delete(rawMsg, key) - case "clusterId": - err = unpopulate(val, "ClusterID", &r.ClusterID) - delete(rawMsg, key) - case "clusterName": - err = unpopulate(val, "ClusterName", &r.ClusterName) - delete(rawMsg, key) - case "discoveryEndpointUri": - err = unpopulate(val, "DiscoveryEndpointURI", &r.DiscoveryEndpointURI) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &r.FriendlyName) - delete(rawMsg, key) - case "lastHeartBeat": - err = unpopulate(val, "LastHeartBeat", &r.LastHeartBeat) - delete(rawMsg, key) - case "lastOperationName": - err = unpopulate(val, "LastOperationName", &r.LastOperationName) - delete(rawMsg, key) - case "lastWorkflowId": - err = unpopulate(val, "LastWorkflowID", &r.LastWorkflowID) - delete(rawMsg, key) - case "managementEndpointUri": - err = unpopulate(val, "ManagementEndpointURI", &r.ManagementEndpointURI) - delete(rawMsg, key) - case "monitoringConfiguration": - err = unpopulate(val, "MonitoringConfiguration", &r.MonitoringConfiguration) - delete(rawMsg, key) - case "monitoringEndpointUri": - err = unpopulate(val, "MonitoringEndpointURI", &r.MonitoringEndpointURI) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "resourceLocation": - err = unpopulate(val, "ResourceLocation", &r.ResourceLocation) - delete(rawMsg, key) - case "serverCertificate": - err = unpopulate(val, "ServerCertificate", &r.ServerCertificate) - delete(rawMsg, key) - case "serverId": - err = unpopulate(val, "ServerID", &r.ServerID) - delete(rawMsg, key) - case "serverManagementErrorCode": - err = unpopulate(val, "ServerManagementErrorCode", &r.ServerManagementErrorCode) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &r.ServerName) - delete(rawMsg, key) - case "serverOSVersion": - err = unpopulate(val, "ServerOSVersion", &r.ServerOSVersion) - delete(rawMsg, key) - case "serverRole": - err = unpopulate(val, "ServerRole", &r.ServerRole) - delete(rawMsg, key) - case "serviceLocation": - err = unpopulate(val, "ServiceLocation", &r.ServiceLocation) - delete(rawMsg, key) - case "storageSyncServiceUid": - err = unpopulate(val, "StorageSyncServiceUID", &r.StorageSyncServiceUID) - 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 ServerEndpointBackgroundDataDownloadActivity. -func (s ServerEndpointBackgroundDataDownloadActivity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "downloadedBytes", s.DownloadedBytes) - populate(objectMap, "percentProgress", s.PercentProgress) - populateTimeRFC3339(objectMap, "startedTimestamp", s.StartedTimestamp) - populateTimeRFC3339(objectMap, "timestamp", s.Timestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointBackgroundDataDownloadActivity. -func (s *ServerEndpointBackgroundDataDownloadActivity) 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 "downloadedBytes": - err = unpopulate(val, "DownloadedBytes", &s.DownloadedBytes) - delete(rawMsg, key) - case "percentProgress": - err = unpopulate(val, "PercentProgress", &s.PercentProgress) - delete(rawMsg, key) - case "startedTimestamp": - err = unpopulateTimeRFC3339(val, "StartedTimestamp", &s.StartedTimestamp) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) - 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 ServerEndpointCloudTieringStatus. -func (s ServerEndpointCloudTieringStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "cachePerformance", s.CachePerformance) - populate(objectMap, "datePolicyStatus", s.DatePolicyStatus) - populate(objectMap, "filesNotTiering", s.FilesNotTiering) - populate(objectMap, "health", s.Health) - populateTimeRFC3339(objectMap, "healthLastUpdatedTimestamp", s.HealthLastUpdatedTimestamp) - populate(objectMap, "lastCloudTieringResult", s.LastCloudTieringResult) - populateTimeRFC3339(objectMap, "lastSuccessTimestamp", s.LastSuccessTimestamp) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", s.LastUpdatedTimestamp) - populate(objectMap, "spaceSavings", s.SpaceSavings) - populate(objectMap, "volumeFreeSpacePolicyStatus", s.VolumeFreeSpacePolicyStatus) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointCloudTieringStatus. -func (s *ServerEndpointCloudTieringStatus) 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 "cachePerformance": - err = unpopulate(val, "CachePerformance", &s.CachePerformance) - delete(rawMsg, key) - case "datePolicyStatus": - err = unpopulate(val, "DatePolicyStatus", &s.DatePolicyStatus) - delete(rawMsg, key) - case "filesNotTiering": - err = unpopulate(val, "FilesNotTiering", &s.FilesNotTiering) - delete(rawMsg, key) - case "health": - err = unpopulate(val, "Health", &s.Health) - delete(rawMsg, key) - case "healthLastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "HealthLastUpdatedTimestamp", &s.HealthLastUpdatedTimestamp) - delete(rawMsg, key) - case "lastCloudTieringResult": - err = unpopulate(val, "LastCloudTieringResult", &s.LastCloudTieringResult) - delete(rawMsg, key) - case "lastSuccessTimestamp": - err = unpopulateTimeRFC3339(val, "LastSuccessTimestamp", &s.LastSuccessTimestamp) - delete(rawMsg, key) - case "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &s.LastUpdatedTimestamp) - delete(rawMsg, key) - case "spaceSavings": - err = unpopulate(val, "SpaceSavings", &s.SpaceSavings) - delete(rawMsg, key) - case "volumeFreeSpacePolicyStatus": - err = unpopulate(val, "VolumeFreeSpacePolicyStatus", &s.VolumeFreeSpacePolicyStatus) - 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 ServerEndpointRecallStatus. -func (s ServerEndpointRecallStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", s.LastUpdatedTimestamp) - populate(objectMap, "recallErrors", s.RecallErrors) - populate(objectMap, "totalRecallErrorsCount", s.TotalRecallErrorsCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointRecallStatus. -func (s *ServerEndpointRecallStatus) 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 "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &s.LastUpdatedTimestamp) - delete(rawMsg, key) - case "recallErrors": - err = unpopulate(val, "RecallErrors", &s.RecallErrors) - delete(rawMsg, key) - case "totalRecallErrorsCount": - err = unpopulate(val, "TotalRecallErrorsCount", &s.TotalRecallErrorsCount) - 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 ServerEndpointSyncActivityStatus. -func (s ServerEndpointSyncActivityStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appliedBytes", s.AppliedBytes) - populate(objectMap, "appliedItemCount", s.AppliedItemCount) - populate(objectMap, "perItemErrorCount", s.PerItemErrorCount) - populate(objectMap, "sessionMinutesRemaining", s.SessionMinutesRemaining) - populate(objectMap, "syncMode", s.SyncMode) - populateTimeRFC3339(objectMap, "timestamp", s.Timestamp) - populate(objectMap, "totalBytes", s.TotalBytes) - populate(objectMap, "totalItemCount", s.TotalItemCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointSyncActivityStatus. -func (s *ServerEndpointSyncActivityStatus) 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 "appliedBytes": - err = unpopulate(val, "AppliedBytes", &s.AppliedBytes) - delete(rawMsg, key) - case "appliedItemCount": - err = unpopulate(val, "AppliedItemCount", &s.AppliedItemCount) - delete(rawMsg, key) - case "perItemErrorCount": - err = unpopulate(val, "PerItemErrorCount", &s.PerItemErrorCount) - delete(rawMsg, key) - case "sessionMinutesRemaining": - err = unpopulate(val, "SessionMinutesRemaining", &s.SessionMinutesRemaining) - delete(rawMsg, key) - case "syncMode": - err = unpopulate(val, "SyncMode", &s.SyncMode) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) - delete(rawMsg, key) - case "totalBytes": - err = unpopulate(val, "TotalBytes", &s.TotalBytes) - delete(rawMsg, key) - case "totalItemCount": - err = unpopulate(val, "TotalItemCount", &s.TotalItemCount) - 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 ServerEndpointSyncSessionStatus. -func (s ServerEndpointSyncSessionStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filesNotSyncingErrors", s.FilesNotSyncingErrors) - populate(objectMap, "lastSyncMode", s.LastSyncMode) - populate(objectMap, "lastSyncPerItemErrorCount", s.LastSyncPerItemErrorCount) - populate(objectMap, "lastSyncResult", s.LastSyncResult) - populateTimeRFC3339(objectMap, "lastSyncSuccessTimestamp", s.LastSyncSuccessTimestamp) - populateTimeRFC3339(objectMap, "lastSyncTimestamp", s.LastSyncTimestamp) - populate(objectMap, "persistentFilesNotSyncingCount", s.PersistentFilesNotSyncingCount) - populate(objectMap, "transientFilesNotSyncingCount", s.TransientFilesNotSyncingCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointSyncSessionStatus. -func (s *ServerEndpointSyncSessionStatus) 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 "filesNotSyncingErrors": - err = unpopulate(val, "FilesNotSyncingErrors", &s.FilesNotSyncingErrors) - delete(rawMsg, key) - case "lastSyncMode": - err = unpopulate(val, "LastSyncMode", &s.LastSyncMode) - delete(rawMsg, key) - case "lastSyncPerItemErrorCount": - err = unpopulate(val, "LastSyncPerItemErrorCount", &s.LastSyncPerItemErrorCount) - delete(rawMsg, key) - case "lastSyncResult": - err = unpopulate(val, "LastSyncResult", &s.LastSyncResult) - delete(rawMsg, key) - case "lastSyncSuccessTimestamp": - err = unpopulateTimeRFC3339(val, "LastSyncSuccessTimestamp", &s.LastSyncSuccessTimestamp) - delete(rawMsg, key) - case "lastSyncTimestamp": - err = unpopulateTimeRFC3339(val, "LastSyncTimestamp", &s.LastSyncTimestamp) - delete(rawMsg, key) - case "persistentFilesNotSyncingCount": - err = unpopulate(val, "PersistentFilesNotSyncingCount", &s.PersistentFilesNotSyncingCount) - delete(rawMsg, key) - case "transientFilesNotSyncingCount": - err = unpopulate(val, "TransientFilesNotSyncingCount", &s.TransientFilesNotSyncingCount) - 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 ServerEndpointSyncStatus. -func (s ServerEndpointSyncStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backgroundDataDownloadActivity", s.BackgroundDataDownloadActivity) - populate(objectMap, "combinedHealth", s.CombinedHealth) - populate(objectMap, "downloadActivity", s.DownloadActivity) - populate(objectMap, "downloadHealth", s.DownloadHealth) - populate(objectMap, "downloadStatus", s.DownloadStatus) - populateTimeRFC3339(objectMap, "lastUpdatedTimestamp", s.LastUpdatedTimestamp) - populate(objectMap, "offlineDataTransferStatus", s.OfflineDataTransferStatus) - populate(objectMap, "syncActivity", s.SyncActivity) - populate(objectMap, "totalPersistentFilesNotSyncingCount", s.TotalPersistentFilesNotSyncingCount) - populate(objectMap, "uploadActivity", s.UploadActivity) - populate(objectMap, "uploadHealth", s.UploadHealth) - populate(objectMap, "uploadStatus", s.UploadStatus) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerEndpointSyncStatus. -func (s *ServerEndpointSyncStatus) 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 "backgroundDataDownloadActivity": - err = unpopulate(val, "BackgroundDataDownloadActivity", &s.BackgroundDataDownloadActivity) - delete(rawMsg, key) - case "combinedHealth": - err = unpopulate(val, "CombinedHealth", &s.CombinedHealth) - delete(rawMsg, key) - case "downloadActivity": - err = unpopulate(val, "DownloadActivity", &s.DownloadActivity) - delete(rawMsg, key) - case "downloadHealth": - err = unpopulate(val, "DownloadHealth", &s.DownloadHealth) - delete(rawMsg, key) - case "downloadStatus": - err = unpopulate(val, "DownloadStatus", &s.DownloadStatus) - delete(rawMsg, key) - case "lastUpdatedTimestamp": - err = unpopulateTimeRFC3339(val, "LastUpdatedTimestamp", &s.LastUpdatedTimestamp) - delete(rawMsg, key) - case "offlineDataTransferStatus": - err = unpopulate(val, "OfflineDataTransferStatus", &s.OfflineDataTransferStatus) - delete(rawMsg, key) - case "syncActivity": - err = unpopulate(val, "SyncActivity", &s.SyncActivity) - delete(rawMsg, key) - case "totalPersistentFilesNotSyncingCount": - err = unpopulate(val, "TotalPersistentFilesNotSyncingCount", &s.TotalPersistentFilesNotSyncingCount) - delete(rawMsg, key) - case "uploadActivity": - err = unpopulate(val, "UploadActivity", &s.UploadActivity) - delete(rawMsg, key) - case "uploadHealth": - err = unpopulate(val, "UploadHealth", &s.UploadHealth) - delete(rawMsg, key) - case "uploadStatus": - err = unpopulate(val, "UploadStatus", &s.UploadStatus) - 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 ServerEndpointUpdateParameters. -func (s ServerEndpointUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Service. -func (s Service) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceCreateParameters. -func (s ServiceCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "location", s.Location) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceProperties. -func (s ServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "incomingTrafficPolicy", s.IncomingTrafficPolicy) - populate(objectMap, "lastOperationName", s.LastOperationName) - populate(objectMap, "lastWorkflowId", s.LastWorkflowID) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "storageSyncServiceStatus", s.StorageSyncServiceStatus) - populate(objectMap, "storageSyncServiceUid", s.StorageSyncServiceUID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceUpdateParameters. -func (s ServiceUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// 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 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, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TriggerChangeDetectionParameters. -func (t TriggerChangeDetectionParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "changeDetectionMode", t.ChangeDetectionMode) - populate(objectMap, "directoryPath", t.DirectoryPath) - populate(objectMap, "paths", t.Paths) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkflowProperties. -func (w WorkflowProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "commandName", w.CommandName) - populateTimeRFC3339(objectMap, "createdTimestamp", w.CreatedTimestamp) - populate(objectMap, "lastOperationId", w.LastOperationID) - populateTimeRFC3339(objectMap, "lastStatusTimestamp", w.LastStatusTimestamp) - populate(objectMap, "lastStepName", w.LastStepName) - populate(objectMap, "operation", w.Operation) - populate(objectMap, "status", w.Status) - populate(objectMap, "steps", w.Steps) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowProperties. -func (w *WorkflowProperties) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "commandName": - err = unpopulate(val, "CommandName", &w.CommandName) - delete(rawMsg, key) - case "createdTimestamp": - err = unpopulateTimeRFC3339(val, "CreatedTimestamp", &w.CreatedTimestamp) - delete(rawMsg, key) - case "lastOperationId": - err = unpopulate(val, "LastOperationID", &w.LastOperationID) - delete(rawMsg, key) - case "lastStatusTimestamp": - err = unpopulateTimeRFC3339(val, "LastStatusTimestamp", &w.LastStatusTimestamp) - delete(rawMsg, key) - case "lastStepName": - err = unpopulate(val, "LastStepName", &w.LastStepName) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &w.Operation) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &w.Status) - delete(rawMsg, key) - case "steps": - err = unpopulate(val, "Steps", &w.Steps) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, 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 -}