diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md index 570542552efa..49bb7a06330c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md @@ -1,5 +1,109 @@ # Release History +## 2.0.0-beta.1 (2022-11-14) +### Breaking Changes + +- Type of `AzureBackupServerContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureSQLAGWorkloadContainerProtectionContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `DpmContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureSQLContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `GenericContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureStorageProtectableContainer.ProtectableContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `ProtectableContainer.ProtectableContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureVMAppContainerProtectionContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureIaaSClassicComputeVMContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureVMAppContainerProtectableContainer.ProtectableContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureStorageContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `ProtectionContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `MabContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureWorkloadContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureIaaSComputeVMContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `IaaSVMContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Const `ContainerTypeMicrosoftComputeVirtualMachines` has been removed +- Const `ContainerTypeMicrosoftClassicComputeVirtualMachines` has been removed +- Const `ContainerTypeAzureWorkloadContainer` has been removed +- Struct `CloudError` has been removed +- Struct `CloudErrorBody` has been removed + +### Features Added + +- New const `ProtectableContainerTypeDPMContainer` +- New const `ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines` +- New const `BackupTypeSnapshotCopyOnlyFull` +- New const `ContainerTypeHanaHSRContainer` +- New const `RestorePointQueryTypeSnapshotFull` +- New const `DataSourceTypeSAPHanaDBInstance` +- New const `TieringModeTierRecommended` +- New const `RestorePointTypeSnapshotFull` +- New const `ProtectableContainerTypeCluster` +- New const `ProtectableContainerTypeAzureSQLContainer` +- New const `ProtectableContainerTypeIaasVMServiceContainer` +- New const `ProtectableContainerTypeStorageContainer` +- New const `TieringModeDoNotTier` +- New const `ProtectableContainerTypeMicrosoftComputeVirtualMachines` +- New const `ProtectableContainerTypeWindows` +- New const `BackupTypeSnapshotFull` +- New const `ProtectableContainerTypeInvalid` +- New const `PolicyTypeSnapshotFull` +- New const `BackupItemTypeSAPHanaDBInstance` +- New const `RestorePointTypeSnapshotCopyOnlyFull` +- New const `ProtectableContainerTypeGenericContainer` +- New const `ProtectableContainerTypeAzureWorkloadContainer` +- New const `ProtectableContainerTypeUnknown` +- New const `ProtectableContainerTypeIaasVMContainer` +- New const `RestorePointQueryTypeSnapshotCopyOnlyFull` +- New const `WorkloadTypeSAPHanaDBInstance` +- New const `ProtectableContainerTypeVMAppContainer` +- New const `WorkloadItemTypeSAPHanaDBInstance` +- New const `PolicyTypeSnapshotCopyOnlyFull` +- New const `ProtectableContainerTypeSQLAGWorkLoadContainer` +- New const `TieringModeTierAfter` +- New const `ProtectableContainerTypeMABContainer` +- New const `ProtectableContainerTypeAzureBackupServerContainer` +- New const `TieringModeInvalid` +- New const `ProtectableContainerTypeVCenter` +- New type alias `ProtectableContainerType` +- New type alias `TieringMode` +- New function `*AzureVMWorkloadSAPHanaDBInstanceProtectedItem.GetAzureVMWorkloadProtectedItem() *AzureVMWorkloadProtectedItem` +- New function `*AzureVMWorkloadSAPHanaHSR.GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem` +- New function `*AzureVMWorkloadSAPHanaHSR.GetWorkloadProtectableItem() *WorkloadProtectableItem` +- New function `*AzureVMWorkloadSAPHanaDBInstance.GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem` +- New function `PossibleProtectableContainerTypeValues() []ProtectableContainerType` +- New function `*AzureVMWorkloadSAPHanaDBInstanceProtectedItem.GetProtectedItem() *ProtectedItem` +- New function `PossibleTieringModeValues() []TieringMode` +- New function `*DeletedProtectionContainersClient.NewListPager(string, string, *DeletedProtectionContainersClientListOptions) *runtime.Pager[DeletedProtectionContainersClientListResponse]` +- New function `*AzureVMWorkloadSAPHanaDBInstance.GetWorkloadProtectableItem() *WorkloadProtectableItem` +- New function `NewDeletedProtectionContainersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DeletedProtectionContainersClient, error)` +- New struct `AzureVMWorkloadSAPHanaDBInstance` +- New struct `AzureVMWorkloadSAPHanaDBInstanceProtectedItem` +- New struct `AzureVMWorkloadSAPHanaHSR` +- New struct `DeletedProtectionContainersClient` +- New struct `DeletedProtectionContainersClientListOptions` +- New struct `DeletedProtectionContainersClientListResponse` +- New struct `TieringPolicy` +- New field `SoftDeleteRetentionPeriod` in struct `AzureVMWorkloadSAPAseDatabaseProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureSQLProtectedItem` +- New field `TieringPolicy` in struct `AzureIaaSVMProtectionPolicy` +- New field `SoftDeleteRetentionPeriod` in struct `AzureIaaSClassicComputeVMProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureIaaSVMProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `ProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureVMWorkloadProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureIaaSComputeVMProtectedItem` +- New field `TieringPolicy` in struct `SubProtectionPolicy` +- New field `NewestRecoveryPointInArchive` in struct `AzureIaaSVMProtectedItemExtendedInfo` +- New field `OldestRecoveryPointInArchive` in struct `AzureIaaSVMProtectedItemExtendedInfo` +- New field `OldestRecoveryPointInVault` in struct `AzureIaaSVMProtectedItemExtendedInfo` +- New field `SoftDeleteRetentionPeriod` in struct `AzureFileshareProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureVMWorkloadSAPHanaDatabaseProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureVMWorkloadSQLDatabaseProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `DPMProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `GenericProtectedItem` +- New field `OldestRecoveryPointInVault` in struct `AzureVMWorkloadProtectedItemExtendedInfo` +- New field `NewestRecoveryPointInArchive` in struct `AzureVMWorkloadProtectedItemExtendedInfo` +- New field `OldestRecoveryPointInArchive` in struct `AzureVMWorkloadProtectedItemExtendedInfo` +- New field `SoftDeleteRetentionPeriod` in struct `MabFileFolderProtectedItem` + + ## 1.0.0 (2022-05-17) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup` 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/recoveryservices/armrecoveryservicesbackup/autorest.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md index affdb2038ba4..95e5231b2fa8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/recoveryservicesbackup/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/recoveryservicesbackup/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupengines_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupengines_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go index 825be418ee2f..bcd7214887fc 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupengines_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewBackupEnginesClient(subscriptionID string, credential azcore.TokenCreden // Get - Returns backup management server registered to Recovery Services Vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // backupEngineName - Name of the backup management server. @@ -100,7 +101,7 @@ func (client *BackupEnginesClient) getCreateRequest(ctx context.Context, vaultNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -122,8 +123,7 @@ func (client *BackupEnginesClient) getHandleResponse(resp *http.Response) (Backu } // NewListPager - Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupEnginesClientListOptions contains the optional parameters for the BackupEnginesClient.List method. @@ -175,7 +175,7 @@ func (client *BackupEnginesClient) listCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupjobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupjobs_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go index ad52f1dd33b3..8c5f6e233a76 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupjobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_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 armrecoveryservicesbackup @@ -55,8 +56,7 @@ func NewBackupJobsClient(subscriptionID string, credential azcore.TokenCredentia } // NewListPager - Provides a pageable list of jobs. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupJobsClientListOptions contains the optional parameters for the BackupJobsClient.List method. @@ -108,7 +108,7 @@ func (client *BackupJobsClient) listCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go index bf532720ee21..7b4226f3c93f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_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 armrecoveryservicesbackup @@ -59,7 +60,7 @@ func NewBackupOperationResultsClient(subscriptionID string, credential azcore.To // till it reaches completion. On successful completion, the status code will be OK. This method expects OperationID as an // argument. OperationID is part of the Location header of the operation response. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // operationID - OperationID which represents the operation. @@ -104,7 +105,7 @@ func (client *BackupOperationResultsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationstatuses_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go index e3e5bdd205ff..2f898e5663b5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_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 armrecoveryservicesbackup @@ -58,7 +59,7 @@ func NewBackupOperationStatusesClient(subscriptionID string, credential azcore.T // or failed. You can refer to the OperationStatus enum for all the possible states of an // operation. Some operations create jobs. This method returns the list of jobs when the operation is complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // operationID - OperationID which represents the operation. @@ -103,7 +104,7 @@ func (client *BackupOperationStatusesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backuppolicies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backuppolicies_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go index fa66d2309dd4..e36e58ec218a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backuppolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_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 armrecoveryservicesbackup @@ -56,8 +57,7 @@ func NewBackupPoliciesClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to // fetch scoped results. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.List method. @@ -109,7 +109,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectableitems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectableitems_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go index 0c65e5ddc444..b55621a73827 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectableitems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_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 armrecoveryservicesbackup @@ -56,8 +57,7 @@ func NewBackupProtectableItemsClient(subscriptionID string, credential azcore.To // NewListPager - Provides a pageable list of protectable objects within your subscription according to the query filter and // the pagination parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupProtectableItemsClientListOptions contains the optional parameters for the BackupProtectableItemsClient.List @@ -110,7 +110,7 @@ func (client *BackupProtectableItemsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotecteditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotecteditems_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go index 415d0499eacb..1018c29f275a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_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 armrecoveryservicesbackup @@ -55,8 +56,7 @@ func NewBackupProtectedItemsClient(subscriptionID string, credential azcore.Toke } // NewListPager - Provides a pageable list of all items that are backed up within a vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupProtectedItemsClientListOptions contains the optional parameters for the BackupProtectedItemsClient.List @@ -109,7 +109,7 @@ func (client *BackupProtectedItemsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectioncontainers_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go index a9a7079bbac7..c8e81bfb9064 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_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 armrecoveryservicesbackup @@ -55,8 +56,7 @@ func NewBackupProtectionContainersClient(subscriptionID string, credential azcor } // NewListPager - Lists the containers registered to Recovery Services Vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupProtectionContainersClientListOptions contains the optional parameters for the BackupProtectionContainersClient.List @@ -109,7 +109,7 @@ func (client *BackupProtectionContainersClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectionintent_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectionintent_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go index 582e6bafcfe4..2703b86a20a7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectionintent_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_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 armrecoveryservicesbackup @@ -55,8 +56,7 @@ func NewBackupProtectionIntentClient(subscriptionID string, credential azcore.To } // NewListPager - Provides a pageable list of all intents that are present within a vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupProtectionIntentClientListOptions contains the optional parameters for the BackupProtectionIntentClient.List @@ -109,7 +109,7 @@ func (client *BackupProtectionIntentClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourceencryptionconfigs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourceencryptionconfigs_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go index 0ae6a75073e0..9ebc2b7cb47c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourceencryptionconfigs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewBackupResourceEncryptionConfigsClient(subscriptionID string, credential // Get - Fetches Vault Encryption config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupResourceEncryptionConfigsClientGetOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Get @@ -96,7 +97,7 @@ func (client *BackupResourceEncryptionConfigsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +114,7 @@ func (client *BackupResourceEncryptionConfigsClient) getHandleResponse(resp *htt // Update - Updates Vault encryption config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - Vault encryption input config request @@ -154,7 +155,7 @@ func (client *BackupResourceEncryptionConfigsClient) updateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcestorageconfigsnoncrr_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcestorageconfigsnoncrr_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go index b6d27619e46c..b4f9287df8a3 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcestorageconfigsnoncrr_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewBackupResourceStorageConfigsNonCRRClient(subscriptionID string, credenti // Get - Fetches resource storage config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupResourceStorageConfigsNonCRRClientGetOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Get @@ -96,7 +97,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +114,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) getHandleResponse(resp * // Patch - Updates vault storage model type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - Vault storage config request @@ -154,7 +155,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) patchCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -162,7 +163,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) patchCreateRequest(ctx c // Update - Updates vault storage model type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - Vault storage config request @@ -203,7 +204,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) updateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcevaultconfigs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcevaultconfigs_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go index 4f64a75430c8..8d6c567b1fb1 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcevaultconfigs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewBackupResourceVaultConfigsClient(subscriptionID string, credential azcor // Get - Fetches resource vault config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupResourceVaultConfigsClientGetOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Get @@ -96,7 +97,7 @@ func (client *BackupResourceVaultConfigsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +114,7 @@ func (client *BackupResourceVaultConfigsClient) getHandleResponse(resp *http.Res // Put - Updates vault security config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - resource config request @@ -154,7 +155,7 @@ func (client *BackupResourceVaultConfigsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -171,7 +172,7 @@ func (client *BackupResourceVaultConfigsClient) putHandleResponse(resp *http.Res // Update - Updates vault security config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - resource config request @@ -212,7 +213,7 @@ func (client *BackupResourceVaultConfigsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backups_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backups_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go index 194221a6dfca..6577ecb95eb7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backups_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_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 armrecoveryservicesbackup @@ -57,7 +58,7 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // Trigger - Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the operation, // call GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backup item. @@ -112,7 +113,7 @@ func (client *BackupsClient) triggerCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupstatus_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupstatus_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go index d786048de08b..cd39e68f9367 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupstatus_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewBackupStatusClient(subscriptionID string, credential azcore.TokenCredent // Get - Get the container backup status // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // azureRegion - Azure region to hit Api // parameters - Container Backup Status Request // options - BackupStatusClientGetOptions contains the optional parameters for the BackupStatusClient.Get method. @@ -91,7 +92,7 @@ func (client *BackupStatusClient) getCreateRequest(ctx context.Context, azureReg return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupusagesummaries_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupusagesummaries_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go index 9f3539ae5717..ed822fe79179 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupusagesummaries_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_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 armrecoveryservicesbackup @@ -55,8 +56,7 @@ func NewBackupUsageSummariesClient(subscriptionID string, credential azcore.Toke } // NewListPager - Fetches the backup management usage summaries of the vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BackupUsageSummariesClientListOptions contains the optional parameters for the BackupUsageSummariesClient.List @@ -103,7 +103,7 @@ func (client *BackupUsageSummariesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupworkloaditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupworkloaditems_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go index a2b087c390a7..267578a10a67 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupworkloaditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_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 armrecoveryservicesbackup @@ -56,8 +57,7 @@ func NewBackupWorkloadItemsClient(subscriptionID string, credential azcore.Token // NewListPager - Provides a pageable list of workload item of a specific container according to the query filter and the // pagination parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the container. @@ -120,7 +120,7 @@ func (client *BackupWorkloadItemsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_bmspreparedatamoveoperationresult_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_bmspreparedatamoveoperationresult_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go index b1a99b477873..d3f80b07db68 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_bmspreparedatamoveoperationresult_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewBMSPrepareDataMoveOperationResultClient(subscriptionID string, credentia // Get - Fetches Operation Result for Prepare Data Move // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - BMSPrepareDataMoveOperationResultClientGetOptions contains the optional parameters for the BMSPrepareDataMoveOperationResultClient.Get @@ -100,7 +101,7 @@ func (client *BMSPrepareDataMoveOperationResultClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go similarity index 96% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go index 23c8b035e74e..bef031cd7853 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // BeginBMSPrepareDataMove - Prepares source vault for Data Move operation // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - Prepare data move request @@ -76,7 +77,7 @@ func (client *Client) BeginBMSPrepareDataMove(ctx context.Context, vaultName str // BMSPrepareDataMove - Prepares source vault for Data Move operation // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview func (client *Client) bMSPrepareDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters PrepareDataMoveRequest, options *ClientBeginBMSPrepareDataMoveOptions) (*http.Response, error) { req, err := client.bmsPrepareDataMoveCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -112,7 +113,7 @@ func (client *Client) bmsPrepareDataMoveCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +121,7 @@ func (client *Client) bmsPrepareDataMoveCreateRequest(ctx context.Context, vault // BeginBMSTriggerDataMove - Triggers Data Move Operation on target vault // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - Trigger data move request @@ -140,7 +141,7 @@ func (client *Client) BeginBMSTriggerDataMove(ctx context.Context, vaultName str // BMSTriggerDataMove - Triggers Data Move Operation on target vault // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview func (client *Client) bMSTriggerDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters TriggerDataMoveRequest, options *ClientBeginBMSTriggerDataMoveOptions) (*http.Response, error) { req, err := client.bmsTriggerDataMoveCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -176,7 +177,7 @@ func (client *Client) bmsTriggerDataMoveCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -184,7 +185,7 @@ func (client *Client) bmsTriggerDataMoveCreateRequest(ctx context.Context, vault // GetOperationStatus - Fetches operation status for data move operation on vault // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - ClientGetOperationStatusOptions contains the optional parameters for the Client.GetOperationStatus method. @@ -227,7 +228,7 @@ func (client *Client) getOperationStatusCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,7 +245,7 @@ func (client *Client) getOperationStatusHandleResponse(resp *http.Response) (Cli // BeginMoveRecoveryPoint - Move recovery point from one datastore to another store. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - Move Resource Across Tiers Request @@ -263,7 +264,7 @@ func (client *Client) BeginMoveRecoveryPoint(ctx context.Context, vaultName stri // MoveRecoveryPoint - Move recovery point from one datastore to another store. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview func (client *Client) moveRecoveryPoint(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters MoveRPAcrossTiersRequest, options *ClientBeginMoveRecoveryPointOptions) (*http.Response, error) { req, err := client.moveRecoveryPointCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) if err != nil { @@ -315,7 +316,7 @@ func (client *Client) moveRecoveryPointCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_constants.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go similarity index 85% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_constants.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go index afb26f630bfb..dde78787cb14 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_constants.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup const ( moduleName = "armrecoveryservicesbackup" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) // AcquireStorageAccountLock - Whether storage account lock is to be acquired for this container or not. @@ -77,6 +78,7 @@ const ( BackupItemTypeGenericDataSource BackupItemType = "GenericDataSource" BackupItemTypeInvalid BackupItemType = "Invalid" BackupItemTypeSAPAseDatabase BackupItemType = "SAPAseDatabase" + BackupItemTypeSAPHanaDBInstance BackupItemType = "SAPHanaDBInstance" BackupItemTypeSAPHanaDatabase BackupItemType = "SAPHanaDatabase" BackupItemTypeSQLDB BackupItemType = "SQLDB" BackupItemTypeSQLDataBase BackupItemType = "SQLDataBase" @@ -97,6 +99,7 @@ func PossibleBackupItemTypeValues() []BackupItemType { BackupItemTypeGenericDataSource, BackupItemTypeInvalid, BackupItemTypeSAPAseDatabase, + BackupItemTypeSAPHanaDBInstance, BackupItemTypeSAPHanaDatabase, BackupItemTypeSQLDB, BackupItemTypeSQLDataBase, @@ -141,12 +144,14 @@ func PossibleBackupManagementTypeValues() []BackupManagementType { type BackupType string const ( - BackupTypeCopyOnlyFull BackupType = "CopyOnlyFull" - BackupTypeDifferential BackupType = "Differential" - BackupTypeFull BackupType = "Full" - BackupTypeIncremental BackupType = "Incremental" - BackupTypeInvalid BackupType = "Invalid" - BackupTypeLog BackupType = "Log" + BackupTypeCopyOnlyFull BackupType = "CopyOnlyFull" + BackupTypeDifferential BackupType = "Differential" + BackupTypeFull BackupType = "Full" + BackupTypeIncremental BackupType = "Incremental" + BackupTypeInvalid BackupType = "Invalid" + BackupTypeLog BackupType = "Log" + BackupTypeSnapshotCopyOnlyFull BackupType = "SnapshotCopyOnlyFull" + BackupTypeSnapshotFull BackupType = "SnapshotFull" ) // PossibleBackupTypeValues returns the possible values for the BackupType const type. @@ -158,6 +163,8 @@ func PossibleBackupTypeValues() []BackupType { BackupTypeIncremental, BackupTypeInvalid, BackupTypeLog, + BackupTypeSnapshotCopyOnlyFull, + BackupTypeSnapshotFull, } } @@ -165,24 +172,22 @@ func PossibleBackupTypeValues() []BackupType { type ContainerType string const ( - ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" - ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" - ContainerTypeAzureWorkloadContainer ContainerType = "AzureWorkloadContainer" - ContainerTypeCluster ContainerType = "Cluster" - ContainerTypeDPMContainer ContainerType = "DPMContainer" - ContainerTypeGenericContainer ContainerType = "GenericContainer" - ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" - ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" - ContainerTypeInvalid ContainerType = "Invalid" - ContainerTypeMABContainer ContainerType = "MABContainer" - ContainerTypeMicrosoftClassicComputeVirtualMachines ContainerType = "Microsoft.ClassicCompute/virtualMachines" - ContainerTypeMicrosoftComputeVirtualMachines ContainerType = "Microsoft.Compute/virtualMachines" - ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" - ContainerTypeStorageContainer ContainerType = "StorageContainer" - ContainerTypeUnknown ContainerType = "Unknown" - ContainerTypeVCenter ContainerType = "VCenter" - ContainerTypeVMAppContainer ContainerType = "VMAppContainer" - ContainerTypeWindows ContainerType = "Windows" + ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" + ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" + ContainerTypeCluster ContainerType = "Cluster" + ContainerTypeDPMContainer ContainerType = "DPMContainer" + ContainerTypeGenericContainer ContainerType = "GenericContainer" + ContainerTypeHanaHSRContainer ContainerType = "HanaHSRContainer" + ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" + ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" + ContainerTypeInvalid ContainerType = "Invalid" + ContainerTypeMABContainer ContainerType = "MABContainer" + ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" + ContainerTypeStorageContainer ContainerType = "StorageContainer" + ContainerTypeUnknown ContainerType = "Unknown" + ContainerTypeVCenter ContainerType = "VCenter" + ContainerTypeVMAppContainer ContainerType = "VMAppContainer" + ContainerTypeWindows ContainerType = "Windows" ) // PossibleContainerTypeValues returns the possible values for the ContainerType const type. @@ -190,16 +195,14 @@ func PossibleContainerTypeValues() []ContainerType { return []ContainerType{ ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, - ContainerTypeAzureWorkloadContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeGenericContainer, + ContainerTypeHanaHSRContainer, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, - ContainerTypeMicrosoftClassicComputeVirtualMachines, - ContainerTypeMicrosoftComputeVirtualMachines, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeStorageContainer, ContainerTypeUnknown, @@ -279,6 +282,7 @@ const ( DataSourceTypeGenericDataSource DataSourceType = "GenericDataSource" DataSourceTypeInvalid DataSourceType = "Invalid" DataSourceTypeSAPAseDatabase DataSourceType = "SAPAseDatabase" + DataSourceTypeSAPHanaDBInstance DataSourceType = "SAPHanaDBInstance" DataSourceTypeSAPHanaDatabase DataSourceType = "SAPHanaDatabase" DataSourceTypeSQLDB DataSourceType = "SQLDB" DataSourceTypeSQLDataBase DataSourceType = "SQLDataBase" @@ -299,6 +303,7 @@ func PossibleDataSourceTypeValues() []DataSourceType { DataSourceTypeGenericDataSource, DataSourceTypeInvalid, DataSourceTypeSAPAseDatabase, + DataSourceTypeSAPHanaDBInstance, DataSourceTypeSAPHanaDatabase, DataSourceTypeSQLDB, DataSourceTypeSQLDataBase, @@ -885,12 +890,14 @@ func PossibleOverwriteOptionsValues() []OverwriteOptions { type PolicyType string const ( - PolicyTypeCopyOnlyFull PolicyType = "CopyOnlyFull" - PolicyTypeDifferential PolicyType = "Differential" - PolicyTypeFull PolicyType = "Full" - PolicyTypeIncremental PolicyType = "Incremental" - PolicyTypeInvalid PolicyType = "Invalid" - PolicyTypeLog PolicyType = "Log" + PolicyTypeCopyOnlyFull PolicyType = "CopyOnlyFull" + PolicyTypeDifferential PolicyType = "Differential" + PolicyTypeFull PolicyType = "Full" + PolicyTypeIncremental PolicyType = "Incremental" + PolicyTypeInvalid PolicyType = "Invalid" + PolicyTypeLog PolicyType = "Log" + PolicyTypeSnapshotCopyOnlyFull PolicyType = "SnapshotCopyOnlyFull" + PolicyTypeSnapshotFull PolicyType = "SnapshotFull" ) // PossiblePolicyTypeValues returns the possible values for the PolicyType const type. @@ -902,6 +909,8 @@ func PossiblePolicyTypeValues() []PolicyType { PolicyTypeIncremental, PolicyTypeInvalid, PolicyTypeLog, + PolicyTypeSnapshotCopyOnlyFull, + PolicyTypeSnapshotFull, } } @@ -925,6 +934,56 @@ func PossiblePrivateEndpointConnectionStatusValues() []PrivateEndpointConnection } } +// ProtectableContainerType - Type of the container. The value of this property for +// 1. Compute Azure VM is Microsoft.Compute/virtualMachines +// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines +type ProtectableContainerType string + +const ( + ProtectableContainerTypeInvalid ProtectableContainerType = "Invalid" + ProtectableContainerTypeUnknown ProtectableContainerType = "Unknown" + ProtectableContainerTypeIaasVMContainer ProtectableContainerType = "IaasVMContainer" + ProtectableContainerTypeIaasVMServiceContainer ProtectableContainerType = "IaasVMServiceContainer" + ProtectableContainerTypeDPMContainer ProtectableContainerType = "DPMContainer" + ProtectableContainerTypeAzureBackupServerContainer ProtectableContainerType = "AzureBackupServerContainer" + ProtectableContainerTypeMABContainer ProtectableContainerType = "MABContainer" + ProtectableContainerTypeCluster ProtectableContainerType = "Cluster" + ProtectableContainerTypeAzureSQLContainer ProtectableContainerType = "AzureSqlContainer" + ProtectableContainerTypeWindows ProtectableContainerType = "Windows" + ProtectableContainerTypeVCenter ProtectableContainerType = "VCenter" + ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer" + ProtectableContainerTypeSQLAGWorkLoadContainer ProtectableContainerType = "SQLAGWorkLoadContainer" + ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer" + ProtectableContainerTypeGenericContainer ProtectableContainerType = "GenericContainer" + ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines ProtectableContainerType = "Microsoft.ClassicCompute/virtualMachines" + ProtectableContainerTypeMicrosoftComputeVirtualMachines ProtectableContainerType = "Microsoft.Compute/virtualMachines" + ProtectableContainerTypeAzureWorkloadContainer ProtectableContainerType = "AzureWorkloadContainer" +) + +// PossibleProtectableContainerTypeValues returns the possible values for the ProtectableContainerType const type. +func PossibleProtectableContainerTypeValues() []ProtectableContainerType { + return []ProtectableContainerType{ + ProtectableContainerTypeInvalid, + ProtectableContainerTypeUnknown, + ProtectableContainerTypeIaasVMContainer, + ProtectableContainerTypeIaasVMServiceContainer, + ProtectableContainerTypeDPMContainer, + ProtectableContainerTypeAzureBackupServerContainer, + ProtectableContainerTypeMABContainer, + ProtectableContainerTypeCluster, + ProtectableContainerTypeAzureSQLContainer, + ProtectableContainerTypeWindows, + ProtectableContainerTypeVCenter, + ProtectableContainerTypeVMAppContainer, + ProtectableContainerTypeSQLAGWorkLoadContainer, + ProtectableContainerTypeStorageContainer, + ProtectableContainerTypeGenericContainer, + ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines, + ProtectableContainerTypeMicrosoftComputeVirtualMachines, + ProtectableContainerTypeAzureWorkloadContainer, + } +} + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received type ProtectedItemHealthStatus string @@ -1187,13 +1246,15 @@ func PossibleResourceHealthStatusValues() []ResourceHealthStatus { type RestorePointQueryType string const ( - RestorePointQueryTypeAll RestorePointQueryType = "All" - RestorePointQueryTypeDifferential RestorePointQueryType = "Differential" - RestorePointQueryTypeFull RestorePointQueryType = "Full" - RestorePointQueryTypeFullAndDifferential RestorePointQueryType = "FullAndDifferential" - RestorePointQueryTypeIncremental RestorePointQueryType = "Incremental" - RestorePointQueryTypeInvalid RestorePointQueryType = "Invalid" - RestorePointQueryTypeLog RestorePointQueryType = "Log" + RestorePointQueryTypeAll RestorePointQueryType = "All" + RestorePointQueryTypeDifferential RestorePointQueryType = "Differential" + RestorePointQueryTypeFull RestorePointQueryType = "Full" + RestorePointQueryTypeFullAndDifferential RestorePointQueryType = "FullAndDifferential" + RestorePointQueryTypeIncremental RestorePointQueryType = "Incremental" + RestorePointQueryTypeInvalid RestorePointQueryType = "Invalid" + RestorePointQueryTypeLog RestorePointQueryType = "Log" + RestorePointQueryTypeSnapshotCopyOnlyFull RestorePointQueryType = "SnapshotCopyOnlyFull" + RestorePointQueryTypeSnapshotFull RestorePointQueryType = "SnapshotFull" ) // PossibleRestorePointQueryTypeValues returns the possible values for the RestorePointQueryType const type. @@ -1206,6 +1267,8 @@ func PossibleRestorePointQueryTypeValues() []RestorePointQueryType { RestorePointQueryTypeIncremental, RestorePointQueryTypeInvalid, RestorePointQueryTypeLog, + RestorePointQueryTypeSnapshotCopyOnlyFull, + RestorePointQueryTypeSnapshotFull, } } @@ -1213,11 +1276,13 @@ func PossibleRestorePointQueryTypeValues() []RestorePointQueryType { type RestorePointType string const ( - RestorePointTypeDifferential RestorePointType = "Differential" - RestorePointTypeFull RestorePointType = "Full" - RestorePointTypeIncremental RestorePointType = "Incremental" - RestorePointTypeInvalid RestorePointType = "Invalid" - RestorePointTypeLog RestorePointType = "Log" + RestorePointTypeDifferential RestorePointType = "Differential" + RestorePointTypeFull RestorePointType = "Full" + RestorePointTypeIncremental RestorePointType = "Incremental" + RestorePointTypeInvalid RestorePointType = "Invalid" + RestorePointTypeLog RestorePointType = "Log" + RestorePointTypeSnapshotCopyOnlyFull RestorePointType = "SnapshotCopyOnlyFull" + RestorePointTypeSnapshotFull RestorePointType = "SnapshotFull" ) // PossibleRestorePointTypeValues returns the possible values for the RestorePointType const type. @@ -1228,6 +1293,8 @@ func PossibleRestorePointTypeValues() []RestorePointType { RestorePointTypeIncremental, RestorePointTypeInvalid, RestorePointTypeLog, + RestorePointTypeSnapshotCopyOnlyFull, + RestorePointTypeSnapshotFull, } } @@ -1408,6 +1475,29 @@ func PossibleSupportStatusValues() []SupportStatus { } } +// TieringMode - Tiering Mode to control automatic tiering of recovery points. Supported values are: +// 1. TierRecommended: Tier all recovery points recommended to be tiered +// 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. +// 3. DoNotTier: Do not tier any recovery points +type TieringMode string + +const ( + TieringModeDoNotTier TieringMode = "DoNotTier" + TieringModeInvalid TieringMode = "Invalid" + TieringModeTierAfter TieringMode = "TierAfter" + TieringModeTierRecommended TieringMode = "TierRecommended" +) + +// PossibleTieringModeValues returns the possible values for the TieringMode const type. +func PossibleTieringModeValues() []TieringMode { + return []TieringMode{ + TieringModeDoNotTier, + TieringModeInvalid, + TieringModeTierAfter, + TieringModeTierRecommended, + } +} + // Type - Backup management type for this container. type Type string @@ -1495,13 +1585,14 @@ func PossibleWeekOfMonthValues() []WeekOfMonth { type WorkloadItemType string const ( - WorkloadItemTypeInvalid WorkloadItemType = "Invalid" - WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" - WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" - WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" - WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" - WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" - WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" + WorkloadItemTypeInvalid WorkloadItemType = "Invalid" + WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" + WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" + WorkloadItemTypeSAPHanaDBInstance WorkloadItemType = "SAPHanaDBInstance" + WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" + WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" + WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" + WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" ) // PossibleWorkloadItemTypeValues returns the possible values for the WorkloadItemType const type. @@ -1510,6 +1601,7 @@ func PossibleWorkloadItemTypeValues() []WorkloadItemType { WorkloadItemTypeInvalid, WorkloadItemTypeSAPAseDatabase, WorkloadItemTypeSAPAseSystem, + WorkloadItemTypeSAPHanaDBInstance, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, @@ -1529,6 +1621,7 @@ const ( WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" WorkloadTypeInvalid WorkloadType = "Invalid" WorkloadTypeSAPAseDatabase WorkloadType = "SAPAseDatabase" + WorkloadTypeSAPHanaDBInstance WorkloadType = "SAPHanaDBInstance" WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" WorkloadTypeSQLDB WorkloadType = "SQLDB" WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase" @@ -1549,6 +1642,7 @@ func PossibleWorkloadTypeValues() []WorkloadType { WorkloadTypeGenericDataSource, WorkloadTypeInvalid, WorkloadTypeSAPAseDatabase, + WorkloadTypeSAPHanaDBInstance, WorkloadTypeSAPHanaDatabase, WorkloadTypeSQLDB, WorkloadTypeSQLDataBase, diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go new file mode 100644 index 000000000000..520337263399 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go @@ -0,0 +1,128 @@ +//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 armrecoveryservicesbackup + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DeletedProtectionContainersClient contains the methods for the DeletedProtectionContainers group. +// Don't use this type directly, use NewDeletedProtectionContainersClient() instead. +type DeletedProtectionContainersClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDeletedProtectionContainersClient creates a new instance of DeletedProtectionContainersClient with the specified values. +// subscriptionID - The subscription Id. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewDeletedProtectionContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedProtectionContainersClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DeletedProtectionContainersClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Lists the soft deleted containers registered to Recovery Services Vault. +// Generated from API version 2022-09-01-preview +// resourceGroupName - The name of the resource group where the recovery services vault is present. +// vaultName - The name of the recovery services vault. +// options - DeletedProtectionContainersClientListOptions contains the optional parameters for the DeletedProtectionContainersClient.List +// method. +func (client *DeletedProtectionContainersClient) NewListPager(resourceGroupName string, vaultName string, options *DeletedProtectionContainersClientListOptions) *runtime.Pager[DeletedProtectionContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DeletedProtectionContainersClientListResponse]{ + More: func(page DeletedProtectionContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DeletedProtectionContainersClientListResponse) (DeletedProtectionContainersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, vaultName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DeletedProtectionContainersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DeletedProtectionContainersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DeletedProtectionContainersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DeletedProtectionContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, options *DeletedProtectionContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupDeletedProtectionContainers" + 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 vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + 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-09-01-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DeletedProtectionContainersClient) listHandleResponse(resp *http.Response) (DeletedProtectionContainersClientListResponse, error) { + result := DeletedProtectionContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProtectionContainerResourceList); err != nil { + return DeletedProtectionContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_exportjobsoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_exportjobsoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go index dad3d239f841..b42f54f405af 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_exportjobsoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_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 armrecoveryservicesbackup @@ -58,7 +59,7 @@ func NewExportJobsOperationResultsClient(subscriptionID string, credential azcor // contains URL of a Blob and a SAS key to access the same. The blob contains exported // jobs in JSON serialized format. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // operationID - OperationID which represents the export job. @@ -103,7 +104,7 @@ func (client *ExportJobsOperationResultsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_featuresupport_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_featuresupport_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go index e7b202131590..1591259a3b59 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_featuresupport_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewFeatureSupportClient(subscriptionID string, credential azcore.TokenCrede // Validate - It will validate if given feature with resource properties is supported in service // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // azureRegion - Azure region to hit Api // parameters - Feature support request object // options - FeatureSupportClientValidateOptions contains the optional parameters for the FeatureSupportClient.Validate method. @@ -91,7 +92,7 @@ func (client *FeatureSupportClient) validateCreateRequest(ctx context.Context, a return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod index d64f1aff68f5..43d958996344 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +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/recoveryservices/armrecoveryservicesbackup/go.sum b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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/recoveryservices/armrecoveryservicesbackup/zz_generated_itemlevelrecoveryconnections_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_itemlevelrecoveryconnections_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go index 5690970608c0..34462ae4c621 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_itemlevelrecoveryconnections_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_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 armrecoveryservicesbackup @@ -58,7 +59,7 @@ func NewItemLevelRecoveryConnectionsClient(subscriptionID string, credential azc // explorer displaying all the recoverable files and folders. This is an asynchronous // operation. To know the status of provisioning, call GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backed up items. @@ -120,7 +121,7 @@ func (client *ItemLevelRecoveryConnectionsClient) provisionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -129,7 +130,7 @@ func (client *ItemLevelRecoveryConnectionsClient) provisionCreateRequest(ctx con // Revoke - Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer // displaying all recoverable files and folders. This is an asynchronous operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backed up items. @@ -190,7 +191,7 @@ func (client *ItemLevelRecoveryConnectionsClient) revokeCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobcancellations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobcancellations_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go index e36715be4f82..bad1eb891ae1 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobcancellations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_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 armrecoveryservicesbackup @@ -57,7 +58,7 @@ func NewJobCancellationsClient(subscriptionID string, credential azcore.TokenCre // Trigger - Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call GetCancelOperationResult // API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // jobName - Name of the job to cancel. @@ -102,7 +103,7 @@ func (client *JobCancellationsClient) triggerCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobdetails_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobdetails_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go index fca7ee5f3cf2..5683da79cbbe 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobdetails_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewJobDetailsClient(subscriptionID string, credential azcore.TokenCredentia // Get - Gets extended information associated with the job. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // jobName - Name of the job whose details are to be fetched. @@ -100,7 +101,7 @@ func (client *JobDetailsClient) getCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_joboperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_joboperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go index f800d79f5322..4c3f31b3b636 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_joboperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewJobOperationResultsClient(subscriptionID string, credential azcore.Token // Get - Fetches the result of any operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // jobName - Job name whose operation result has to be fetched. @@ -105,7 +106,7 @@ func (client *JobOperationResultsClient) getCreateRequest(ctx context.Context, v return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobs_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go index 308a1fd58261..fcf6cfcc8270 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // Export - Triggers export of jobs specified by filters and returns an OperationID to track. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - JobsClientExportOptions contains the optional parameters for the JobsClient.Export method. @@ -95,7 +96,7 @@ func (client *JobsClient) exportCreateRequest(ctx context.Context, vaultName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go similarity index 93% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go index da7362144e9f..883e0c090be8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup @@ -29,7 +30,7 @@ type AzureBackupServerContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -331,9 +332,6 @@ type AzureFileshareProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -394,11 +392,17 @@ type AzureFileshareProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type AzureFileshareProtectedItem. @@ -421,6 +425,7 @@ func (a *AzureFileshareProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -449,7 +454,7 @@ type AzureIaaSClassicComputeVMContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -560,9 +565,6 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -584,15 +586,9 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // Extended Properties for Azure IaasVM Backup. ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Health details on this backup item. HealthDetails []*AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // Health status of protected item. - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -611,9 +607,6 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // Last backup operation status. LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // Timestamp of the last backup operation on this backup item. - LastBackupTime *time.Time `json:"lastBackupTime,omitempty"` - // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time `json:"lastRecoveryPoint,omitempty"` @@ -623,9 +616,6 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // Name of the policy used for protection PolicyName *string `json:"policyName,omitempty"` - // Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` @@ -635,14 +625,32 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Health status of protected item. + HealthStatus *HealthStatus `json:"healthStatus,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp of the last backup operation on this backup item. + LastBackupTime *time.Time `json:"lastBackupTime,omitempty" azure:"ro"` + + // READ-ONLY; Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty" azure:"ro"` + + // READ-ONLY; Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureIaaSVMProtectedItem implements the AzureIaaSVMProtectedItemClassification interface for type AzureIaaSClassicComputeVMProtectedItem. @@ -677,6 +685,7 @@ func (a *AzureIaaSClassicComputeVMProtectedItem) GetAzureIaaSVMProtectedItem() * ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -700,6 +709,7 @@ func (a *AzureIaaSClassicComputeVMProtectedItem) GetProtectedItem() *ProtectedIt ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -709,7 +719,7 @@ type AzureIaaSComputeVMContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -820,9 +830,6 @@ type AzureIaaSComputeVMProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -844,15 +851,9 @@ type AzureIaaSComputeVMProtectedItem struct { // Extended Properties for Azure IaasVM Backup. ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Health details on this backup item. HealthDetails []*AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // Health status of protected item. - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -871,9 +872,6 @@ type AzureIaaSComputeVMProtectedItem struct { // Last backup operation status. LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // Timestamp of the last backup operation on this backup item. - LastBackupTime *time.Time `json:"lastBackupTime,omitempty"` - // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time `json:"lastRecoveryPoint,omitempty"` @@ -883,9 +881,6 @@ type AzureIaaSComputeVMProtectedItem struct { // Name of the policy used for protection PolicyName *string `json:"policyName,omitempty"` - // Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` @@ -895,14 +890,32 @@ type AzureIaaSComputeVMProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Health status of protected item. + HealthStatus *HealthStatus `json:"healthStatus,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp of the last backup operation on this backup item. + LastBackupTime *time.Time `json:"lastBackupTime,omitempty" azure:"ro"` + + // READ-ONLY; Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty" azure:"ro"` + + // READ-ONLY; Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureIaaSVMProtectedItem implements the AzureIaaSVMProtectedItemClassification interface for type AzureIaaSComputeVMProtectedItem. @@ -937,6 +950,7 @@ func (a *AzureIaaSComputeVMProtectedItem) GetAzureIaaSVMProtectedItem() *AzureIa ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -960,6 +974,7 @@ func (a *AzureIaaSComputeVMProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -1177,9 +1192,6 @@ type AzureIaaSVMProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -1201,15 +1213,9 @@ type AzureIaaSVMProtectedItem struct { // Extended Properties for Azure IaasVM Backup. ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Health details on this backup item. HealthDetails []*AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // Health status of protected item. - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -1228,9 +1234,6 @@ type AzureIaaSVMProtectedItem struct { // Last backup operation status. LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // Timestamp of the last backup operation on this backup item. - LastBackupTime *time.Time `json:"lastBackupTime,omitempty"` - // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time `json:"lastRecoveryPoint,omitempty"` @@ -1240,9 +1243,6 @@ type AzureIaaSVMProtectedItem struct { // Name of the policy used for protection PolicyName *string `json:"policyName,omitempty"` - // Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` @@ -1252,14 +1252,32 @@ type AzureIaaSVMProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Health status of protected item. + HealthStatus *HealthStatus `json:"healthStatus,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp of the last backup operation on this backup item. + LastBackupTime *time.Time `json:"lastBackupTime,omitempty" azure:"ro"` + + // READ-ONLY; Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty" azure:"ro"` + + // READ-ONLY; Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureIaaSVMProtectedItem implements the AzureIaaSVMProtectedItemClassification interface for type AzureIaaSVMProtectedItem. @@ -1285,14 +1303,24 @@ func (a *AzureIaaSVMProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } // AzureIaaSVMProtectedItemExtendedInfo - Additional information on Azure IaaS VM specific backup item. type AzureIaaSVMProtectedItemExtendedInfo struct { - // The oldest backup copy available for this backup item. + // The latest backup copy available for this backup item in archive tier + NewestRecoveryPointInArchive *time.Time `json:"newestRecoveryPointInArchive,omitempty"` + + // The oldest backup copy available for this backup item across all tiers. OldestRecoveryPoint *time.Time `json:"oldestRecoveryPoint,omitempty"` + // The oldest backup copy available for this backup item in archive tier + OldestRecoveryPointInArchive *time.Time `json:"oldestRecoveryPointInArchive,omitempty"` + + // The oldest backup copy available for this backup item in vault tier + OldestRecoveryPointInVault *time.Time `json:"oldestRecoveryPointInVault,omitempty"` + // Specifies if backup policy associated with the backup item is inconsistent. PolicyInconsistent *bool `json:"policyInconsistent,omitempty"` @@ -1322,6 +1350,10 @@ type AzureIaaSVMProtectionPolicy struct { // Backup schedule specified as part of backup policy. SchedulePolicy SchedulePolicyClassification `json:"schedulePolicy,omitempty"` + // Tiering policy to automatically move RPs to another tier Key is Target Tier, defined in RecoveryPointTierType enum. Tiering + // policy specifies the criteria to move RP to the target tier. + TieringPolicy map[string]*TieringPolicy `json:"tieringPolicy,omitempty"` + // TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". TimeZone *string `json:"timeZone,omitempty"` } @@ -1426,7 +1458,7 @@ type AzureSQLAGWorkloadContainerProtectionContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -1494,7 +1526,7 @@ type AzureSQLContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -1529,9 +1561,6 @@ type AzureSQLProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -1580,11 +1609,17 @@ type AzureSQLProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type AzureSQLProtectedItem. @@ -1607,6 +1642,7 @@ func (a *AzureSQLProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -1652,7 +1688,7 @@ type AzureStorageContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Whether storage account lock is to be acquired for this container or not. AcquireStorageAccountLock *AcquireStorageAccountLock `json:"acquireStorageAccountLock,omitempty"` @@ -1797,7 +1833,7 @@ type AzureStorageProtectableContainer struct { // REQUIRED; Type of the container. The value of this property for // 1. Compute Azure VM is Microsoft.Compute/virtualMachines // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines - ProtectableContainerType *ContainerType `json:"protectableContainerType,omitempty"` + ProtectableContainerType *ProtectableContainerType `json:"protectableContainerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -1828,7 +1864,7 @@ type AzureVMAppContainerProtectableContainer struct { // REQUIRED; Type of the container. The value of this property for // 1. Compute Azure VM is Microsoft.Compute/virtualMachines // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines - ProtectableContainerType *ContainerType `json:"protectableContainerType,omitempty"` + ProtectableContainerType *ProtectableContainerType `json:"protectableContainerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -1860,7 +1896,7 @@ type AzureVMAppContainerProtectionContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -2008,9 +2044,9 @@ func (a *AzureVMWorkloadItem) GetWorkloadItem() *WorkloadItem { // AzureVMWorkloadProtectableItemClassification provides polymorphic access to related types. // Call the interface's GetAzureVMWorkloadProtectableItem() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AzureVMWorkloadProtectableItem, *AzureVMWorkloadSAPAseSystemProtectableItem, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, -// - *AzureVMWorkloadSAPHanaSystemProtectableItem, *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, *AzureVMWorkloadSQLDatabaseProtectableItem, -// - *AzureVMWorkloadSQLInstanceProtectableItem +// - *AzureVMWorkloadProtectableItem, *AzureVMWorkloadSAPAseSystemProtectableItem, *AzureVMWorkloadSAPHanaDBInstance, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, +// - *AzureVMWorkloadSAPHanaHSR, *AzureVMWorkloadSAPHanaSystemProtectableItem, *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, +// - *AzureVMWorkloadSQLDatabaseProtectableItem, *AzureVMWorkloadSQLInstanceProtectableItem type AzureVMWorkloadProtectableItemClassification interface { WorkloadProtectableItemClassification // GetAzureVMWorkloadProtectableItem returns the AzureVMWorkloadProtectableItem content of the underlying type. @@ -2079,8 +2115,8 @@ func (a *AzureVMWorkloadProtectableItem) GetWorkloadProtectableItem() *WorkloadP // AzureVMWorkloadProtectedItemClassification provides polymorphic access to related types. // Call the interface's GetAzureVMWorkloadProtectedItem() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AzureVMWorkloadProtectedItem, *AzureVMWorkloadSAPAseDatabaseProtectedItem, *AzureVMWorkloadSAPHanaDatabaseProtectedItem, -// - *AzureVMWorkloadSQLDatabaseProtectedItem +// - *AzureVMWorkloadProtectedItem, *AzureVMWorkloadSAPAseDatabaseProtectedItem, *AzureVMWorkloadSAPHanaDBInstanceProtectedItem, +// - *AzureVMWorkloadSAPHanaDatabaseProtectedItem, *AzureVMWorkloadSQLDatabaseProtectedItem type AzureVMWorkloadProtectedItemClassification interface { ProtectedItemClassification // GetAzureVMWorkloadProtectedItem returns the AzureVMWorkloadProtectedItem content of the underlying type. @@ -2092,9 +2128,6 @@ type AzureVMWorkloadProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -2113,9 +2146,6 @@ type AzureVMWorkloadProtectedItem struct { // Additional information for this backup item. ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -2164,20 +2194,29 @@ type AzureVMWorkloadProtectedItem struct { // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` - // Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` // Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadProtectedItem. @@ -2205,14 +2244,24 @@ func (a *AzureVMWorkloadProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } // AzureVMWorkloadProtectedItemExtendedInfo - Additional information on Azure Workload for SQL specific backup item. type AzureVMWorkloadProtectedItemExtendedInfo struct { - // The oldest backup copy available for this backup item. + // The latest backup copy available for this backup item in archive tier + NewestRecoveryPointInArchive *time.Time `json:"newestRecoveryPointInArchive,omitempty"` + + // The oldest backup copy available for this backup item across all tiers. OldestRecoveryPoint *time.Time `json:"oldestRecoveryPoint,omitempty"` + // The oldest backup copy available for this backup item in archive tier + OldestRecoveryPointInArchive *time.Time `json:"oldestRecoveryPointInArchive,omitempty"` + + // The oldest backup copy available for this backup item in vault tier + OldestRecoveryPointInVault *time.Time `json:"oldestRecoveryPointInVault,omitempty"` + // Indicates consistency of policy object and policy applied to this backup item. PolicyState *string `json:"policyState,omitempty"` @@ -2261,9 +2310,6 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -2282,9 +2328,6 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { // Additional information for this backup item. ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -2333,20 +2376,29 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` - // Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` // Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSAPAseDatabaseProtectedItem. @@ -2382,6 +2434,7 @@ func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) GetAzureVMWorkloadProtected ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -2405,6 +2458,7 @@ func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) GetProtectedItem() *Protect ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -2601,6 +2655,236 @@ func (a *AzureVMWorkloadSAPAseSystemWorkloadItem) GetWorkloadItem() *WorkloadIte } } +// AzureVMWorkloadSAPHanaDBInstance - Azure VM workload-specific protectable item representing SAP HANA Dbinstance. +type AzureVMWorkloadSAPHanaDBInstance struct { + // REQUIRED; Type of the backup item. + ProtectableItemType *string `json:"protectableItemType,omitempty"` + + // Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + + // Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + + // Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + + // Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` + + // Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + + // Parent Unique Name is added to provide the service formatted URI Name of the Parent Only Applicable for data bases where + // the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + + // Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + + // State of the back up item. + ProtectionState *ProtectionStatus `json:"protectionState,omitempty"` + + // Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + + // For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + + // For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + + // Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` +} + +// GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaDBInstance. +func (a *AzureVMWorkloadSAPHanaDBInstance) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { + return &AzureVMWorkloadProtectableItem{ + ParentName: a.ParentName, + ParentUniqueName: a.ParentUniqueName, + ServerName: a.ServerName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + Subinquireditemcount: a.Subinquireditemcount, + Subprotectableitemcount: a.Subprotectableitemcount, + Prebackupvalidation: a.Prebackupvalidation, + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ProtectableItemType: a.ProtectableItemType, + FriendlyName: a.FriendlyName, + ProtectionState: a.ProtectionState, + } +} + +// GetWorkloadProtectableItem implements the WorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaDBInstance. +func (a *AzureVMWorkloadSAPHanaDBInstance) GetWorkloadProtectableItem() *WorkloadProtectableItem { + return &WorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ProtectableItemType: a.ProtectableItemType, + FriendlyName: a.FriendlyName, + ProtectionState: a.ProtectionState, + } +} + +// AzureVMWorkloadSAPHanaDBInstanceProtectedItem - Azure VM workload-specific protected item representing SAP HANA DBInstance. +type AzureVMWorkloadSAPHanaDBInstanceProtectedItem struct { + // REQUIRED; backup item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + + // Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + + // Unique name of container + ContainerName *string `json:"containerName,omitempty"` + + // Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + CreateMode *CreateMode `json:"createMode,omitempty"` + + // Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *time.Time `json:"deferredDeleteTimeInUTC,omitempty"` + + // Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + + // Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + + // Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + + // Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + + // Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + + // Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + + // Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths,omitempty"` + + // Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + + // Last backup operation status. Possible values: Healthy, Unhealthy. + LastBackupStatus *LastBackupStatus `json:"lastBackupStatus,omitempty"` + + // Timestamp of the last backup operation on this backup item. + LastBackupTime *time.Time `json:"lastBackupTime,omitempty"` + + // Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *time.Time `json:"lastRecoveryPoint,omitempty"` + + // Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + + // Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + + // ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + + // Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + + // Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + + // Health status of the backup item, evaluated based on last heartbeat received + ProtectedItemHealthStatus *ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + + // Backup state of this backup item. + ProtectionState *ProtectionState `json:"protectionState,omitempty"` + + // ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + + // Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + + // ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` +} + +// GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSAPHanaDBInstanceProtectedItem. +func (a *AzureVMWorkloadSAPHanaDBInstanceProtectedItem) GetAzureVMWorkloadProtectedItem() *AzureVMWorkloadProtectedItem { + return &AzureVMWorkloadProtectedItem{ + FriendlyName: a.FriendlyName, + ServerName: a.ServerName, + ParentName: a.ParentName, + ParentType: a.ParentType, + ProtectionStatus: a.ProtectionStatus, + ProtectionState: a.ProtectionState, + LastBackupStatus: a.LastBackupStatus, + LastBackupTime: a.LastBackupTime, + LastBackupErrorDetail: a.LastBackupErrorDetail, + ProtectedItemDataSourceID: a.ProtectedItemDataSourceID, + ProtectedItemHealthStatus: a.ProtectedItemHealthStatus, + ExtendedInfo: a.ExtendedInfo, + KpisHealths: a.KpisHealths, + ProtectedItemType: a.ProtectedItemType, + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ContainerName: a.ContainerName, + SourceResourceID: a.SourceResourceID, + PolicyID: a.PolicyID, + LastRecoveryPoint: a.LastRecoveryPoint, + BackupSetName: a.BackupSetName, + CreateMode: a.CreateMode, + DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, + IsRehydrate: a.IsRehydrate, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + IsArchiveEnabled: a.IsArchiveEnabled, + PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + } +} + +// GetProtectedItem implements the ProtectedItemClassification interface for type AzureVMWorkloadSAPHanaDBInstanceProtectedItem. +func (a *AzureVMWorkloadSAPHanaDBInstanceProtectedItem) GetProtectedItem() *ProtectedItem { + return &ProtectedItem{ + ProtectedItemType: a.ProtectedItemType, + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ContainerName: a.ContainerName, + SourceResourceID: a.SourceResourceID, + PolicyID: a.PolicyID, + LastRecoveryPoint: a.LastRecoveryPoint, + BackupSetName: a.BackupSetName, + CreateMode: a.CreateMode, + DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, + IsRehydrate: a.IsRehydrate, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + IsArchiveEnabled: a.IsArchiveEnabled, + PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + } +} + // AzureVMWorkloadSAPHanaDatabaseProtectableItem - Azure VM workload-specific protectable item representing SAP HANA Database. type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { // REQUIRED; Type of the backup item. @@ -2679,9 +2963,6 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -2700,9 +2981,6 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { // Additional information for this backup item. ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -2751,20 +3029,29 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` - // Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` // Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. @@ -2800,6 +3087,7 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) GetAzureVMWorkloadProtecte ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -2823,6 +3111,7 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) GetProtectedItem() *Protec ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -2886,6 +3175,79 @@ func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) GetWorkloadItem() *Workload } } +// AzureVMWorkloadSAPHanaHSR - Azure VM workload-specific protectable item representing SAP HANA Dbinstance. +type AzureVMWorkloadSAPHanaHSR struct { + // REQUIRED; Type of the backup item. + ProtectableItemType *string `json:"protectableItemType,omitempty"` + + // Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + + // Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + + // Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + + // Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` + + // Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + + // Parent Unique Name is added to provide the service formatted URI Name of the Parent Only Applicable for data bases where + // the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + + // Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + + // State of the back up item. + ProtectionState *ProtectionStatus `json:"protectionState,omitempty"` + + // Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + + // For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + + // For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + + // Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` +} + +// GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaHSR. +func (a *AzureVMWorkloadSAPHanaHSR) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { + return &AzureVMWorkloadProtectableItem{ + ParentName: a.ParentName, + ParentUniqueName: a.ParentUniqueName, + ServerName: a.ServerName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + Subinquireditemcount: a.Subinquireditemcount, + Subprotectableitemcount: a.Subprotectableitemcount, + Prebackupvalidation: a.Prebackupvalidation, + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ProtectableItemType: a.ProtectableItemType, + FriendlyName: a.FriendlyName, + ProtectionState: a.ProtectionState, + } +} + +// GetWorkloadProtectableItem implements the WorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaHSR. +func (a *AzureVMWorkloadSAPHanaHSR) GetWorkloadProtectableItem() *WorkloadProtectableItem { + return &WorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ProtectableItemType: a.ProtectableItemType, + FriendlyName: a.FriendlyName, + ProtectionState: a.ProtectionState, + } +} + // AzureVMWorkloadSAPHanaSystemProtectableItem - Azure VM workload-specific protectable item representing SAP HANA System. type AzureVMWorkloadSAPHanaSystemProtectableItem struct { // REQUIRED; Type of the backup item. @@ -3171,9 +3533,6 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -3192,9 +3551,6 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { // Additional information for this backup item. ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -3243,20 +3599,29 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` - // Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` // Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSQLDatabaseProtectedItem. @@ -3292,6 +3657,7 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) GetAzureVMWorkloadProtectedIte ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -3315,6 +3681,7 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) GetProtectedItem() *ProtectedI ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -3614,7 +3981,7 @@ type AzureWorkloadContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -5646,30 +6013,6 @@ type ClientScriptForConnect struct { URL *string `json:"url,omitempty"` } -// CloudError - An error response from the Container Instance service. -type CloudError struct { - // The error object. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody - An error response from the Container Instance service. -type CloudErrorBody struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` - - // READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; A list of additional details about the error. - Details []*CloudErrorBody `json:"details,omitempty" azure:"ro"` - - // READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty" azure:"ro"` - - // READ-ONLY; The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty" azure:"ro"` -} - // ContainerIdentityInfo - Container identity information type ContainerIdentityInfo struct { // Protection container identity - AAD Tenant @@ -5699,9 +6042,6 @@ type DPMProtectedItem struct { // Backup Management server protecting this backup item BackupEngineName *string `json:"backupEngineName,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -5750,11 +6090,17 @@ type DPMProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type DPMProtectedItem. @@ -5777,6 +6123,7 @@ func (d *DPMProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: d.ResourceGuardOperationRequests, IsArchiveEnabled: d.IsArchiveEnabled, PolicyName: d.PolicyName, + SoftDeleteRetentionPeriod: d.SoftDeleteRetentionPeriod, } } @@ -5854,6 +6201,13 @@ type Day struct { IsLast *bool `json:"isLast,omitempty"` } +// DeletedProtectionContainersClientListOptions contains the optional parameters for the DeletedProtectionContainersClient.List +// method. +type DeletedProtectionContainersClientListOptions struct { + // OData filter options. + Filter *string +} + type DiskExclusionProperties struct { // List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. DiskLunList []*int32 `json:"diskLunList,omitempty"` @@ -5957,7 +6311,7 @@ type DpmContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -6226,7 +6580,7 @@ type GenericContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -6279,9 +6633,6 @@ type GenericProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -6336,14 +6687,20 @@ type GenericProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // Loosely coupled (type, value) associations (example - parent of a protected item) SourceAssociations map[string]*string `json:"sourceAssociations,omitempty"` // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type GenericProtectedItem. @@ -6366,6 +6723,7 @@ func (g *GenericProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: g.ResourceGuardOperationRequests, IsArchiveEnabled: g.IsArchiveEnabled, PolicyName: g.PolicyName, + SoftDeleteRetentionPeriod: g.SoftDeleteRetentionPeriod, } } @@ -6499,7 +6857,7 @@ type IaaSVMContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -7192,7 +7550,7 @@ type MabContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Agent version of this container. AgentVersion *string `json:"agentVersion,omitempty"` @@ -7275,9 +7633,6 @@ type MabFileFolderProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -7338,11 +7693,17 @@ type MabFileFolderProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type MabFileFolderProtectedItem. @@ -7365,6 +7726,7 @@ func (m *MabFileFolderProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: m.ResourceGuardOperationRequests, IsArchiveEnabled: m.IsArchiveEnabled, PolicyName: m.PolicyName, + SoftDeleteRetentionPeriod: m.SoftDeleteRetentionPeriod, } } @@ -7941,7 +8303,7 @@ type ProtectableContainer struct { // REQUIRED; Type of the container. The value of this property for // 1. Compute Azure VM is Microsoft.Compute/virtualMachines // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines - ProtectableContainerType *ContainerType `json:"protectableContainerType,omitempty"` + ProtectableContainerType *ProtectableContainerType `json:"protectableContainerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -8002,8 +8364,9 @@ type ProtectableContainersClientListOptions struct { // Call the interface's GetProtectedItem() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: // - *AzureFileshareProtectedItem, *AzureIaaSClassicComputeVMProtectedItem, *AzureIaaSComputeVMProtectedItem, *AzureIaaSVMProtectedItem, -// - *AzureSQLProtectedItem, *AzureVMWorkloadProtectedItem, *AzureVMWorkloadSAPAseDatabaseProtectedItem, *AzureVMWorkloadSAPHanaDatabaseProtectedItem, -// - *AzureVMWorkloadSQLDatabaseProtectedItem, *DPMProtectedItem, *GenericProtectedItem, *MabFileFolderProtectedItem, *ProtectedItem +// - *AzureSQLProtectedItem, *AzureVMWorkloadProtectedItem, *AzureVMWorkloadSAPAseDatabaseProtectedItem, *AzureVMWorkloadSAPHanaDBInstanceProtectedItem, +// - *AzureVMWorkloadSAPHanaDatabaseProtectedItem, *AzureVMWorkloadSQLDatabaseProtectedItem, *DPMProtectedItem, *GenericProtectedItem, +// - *MabFileFolderProtectedItem, *ProtectedItem type ProtectedItemClassification interface { // GetProtectedItem returns the ProtectedItem content of the underlying type. GetProtectedItem() *ProtectedItem @@ -8014,9 +8377,6 @@ type ProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -8056,11 +8416,17 @@ type ProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type ProtectedItem. @@ -8176,7 +8542,7 @@ type ProtectionContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -8950,6 +9316,10 @@ type SubProtectionPolicy struct { // Backup schedule specified as part of backup policy. SchedulePolicy SchedulePolicyClassification `json:"schedulePolicy,omitempty"` + + // Tiering policy to automatically move RPs to another tier. Key is Target Tier, defined in RecoveryPointTierType enum. Tiering + // policy specifies the criteria to move RP to the target tier. + TieringPolicy map[string]*TieringPolicy `json:"tieringPolicy,omitempty"` } // TargetAFSRestoreInfo - Target Azure File Share Info. @@ -8976,6 +9346,23 @@ type TargetRestoreInfo struct { TargetDirectoryForFileRestore *string `json:"targetDirectoryForFileRestore,omitempty"` } +// TieringPolicy - Tiering Policy for a target tier. If the policy is not specified for a given target tier, service retains +// the existing configured tiering policy for that tier +type TieringPolicy struct { + // Number of days/weeks/months/years to retain backups in current tier before tiering. Used only if TieringMode is set to + // TierAfter + Duration *int32 `json:"duration,omitempty"` + + // Retention duration type: days/weeks/months/years Used only if TieringMode is set to TierAfter + DurationType *RetentionDurationType `json:"durationType,omitempty"` + + // Tiering Mode to control automatic tiering of recovery points. Supported values are: + // 1. TierRecommended: Tier all recovery points recommended to be tiered + // 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. + // 3. DoNotTier: Do not tier any recovery points + TieringMode *TieringMode `json:"tieringMode,omitempty"` +} + // TokenInformation - The token information details. type TokenInformation struct { // Expiry time of token. @@ -9324,9 +9711,9 @@ type WorkloadItemResourceList struct { // Call the interface's GetWorkloadProtectableItem() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: // - *AzureFileShareProtectableItem, *AzureIaaSClassicComputeVMProtectableItem, *AzureIaaSComputeVMProtectableItem, *AzureVMWorkloadProtectableItem, -// - *AzureVMWorkloadSAPAseSystemProtectableItem, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, *AzureVMWorkloadSAPHanaSystemProtectableItem, -// - *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, *AzureVMWorkloadSQLDatabaseProtectableItem, *AzureVMWorkloadSQLInstanceProtectableItem, -// - *IaaSVMProtectableItem, *WorkloadProtectableItem +// - *AzureVMWorkloadSAPAseSystemProtectableItem, *AzureVMWorkloadSAPHanaDBInstance, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, +// - *AzureVMWorkloadSAPHanaHSR, *AzureVMWorkloadSAPHanaSystemProtectableItem, *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, +// - *AzureVMWorkloadSQLDatabaseProtectableItem, *AzureVMWorkloadSQLInstanceProtectableItem, *IaaSVMProtectableItem, *WorkloadProtectableItem type WorkloadProtectableItemClassification interface { // GetWorkloadProtectableItem returns the WorkloadProtectableItem content of the underlying type. GetWorkloadProtectableItem() *WorkloadProtectableItem diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models_serde.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go similarity index 66% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models_serde.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go index 316f968984d1..52686ac2b63c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models_serde.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.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 armrecoveryservicesbackup @@ -49,7 +50,7 @@ func (a AzureBackupServerContainer) MarshalJSON() ([]byte, error) { populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "canReRegister", a.CanReRegister) populate(objectMap, "containerId", a.ContainerID) - objectMap["containerType"] = ContainerTypeAzureBackupServerContainer + objectMap["containerType"] = ProtectableContainerTypeAzureBackupServerContainer populate(objectMap, "dpmAgentVersion", a.DpmAgentVersion) populate(objectMap, "dpmServers", a.DpmServers) populate(objectMap, "extendedInfo", a.ExtendedInfo) @@ -488,6 +489,7 @@ func (a AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -568,6 +570,9 @@ func (a *AzureFileshareProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -629,7 +634,7 @@ func (a *AzureFileshareProtectedItemExtendedInfo) UnmarshalJSON(data []byte) err func (a AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeMicrosoftClassicComputeVirtualMachines + objectMap["containerType"] = ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) populate(objectMap, "protectableObjectType", a.ProtectableObjectType) @@ -768,6 +773,7 @@ func (a AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "virtualMachineId", a.VirtualMachineID) populate(objectMap, "workloadType", a.WorkloadType) @@ -861,6 +867,9 @@ func (a *AzureIaaSClassicComputeVMProtectedItem) UnmarshalJSON(data []byte) erro case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -882,7 +891,7 @@ func (a *AzureIaaSClassicComputeVMProtectedItem) UnmarshalJSON(data []byte) erro func (a AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeMicrosoftComputeVirtualMachines + objectMap["containerType"] = ProtectableContainerTypeMicrosoftComputeVirtualMachines populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) populate(objectMap, "protectableObjectType", a.ProtectableObjectType) @@ -1021,6 +1030,7 @@ func (a AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "virtualMachineId", a.VirtualMachineID) populate(objectMap, "workloadType", a.WorkloadType) @@ -1114,6 +1124,9 @@ func (a *AzureIaaSComputeVMProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -1141,6 +1154,35 @@ func (a AzureIaaSVMErrorInfo) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureIaaSVMErrorInfo. +func (a *AzureIaaSVMErrorInfo) UnmarshalJSON(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 "errorCode": + err = unpopulate(val, "ErrorCode", &a.ErrorCode) + delete(rawMsg, key) + case "errorString": + err = unpopulate(val, "ErrorString", &a.ErrorString) + delete(rawMsg, key) + case "errorTitle": + err = unpopulate(val, "ErrorTitle", &a.ErrorTitle) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &a.Recommendations) + 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 AzureIaaSVMHealthDetails. func (a AzureIaaSVMHealthDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1151,6 +1193,35 @@ func (a AzureIaaSVMHealthDetails) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureIaaSVMHealthDetails. +func (a *AzureIaaSVMHealthDetails) UnmarshalJSON(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 "message": + err = unpopulate(val, "Message", &a.Message) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &a.Recommendations) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &a.Title) + 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 AzureIaaSVMJob. func (a AzureIaaSVMJob) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1246,6 +1317,41 @@ func (a AzureIaaSVMJobExtendedInfo) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureIaaSVMJobExtendedInfo. +func (a *AzureIaaSVMJobExtendedInfo) UnmarshalJSON(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 "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &a.DynamicErrorMessage) + delete(rawMsg, key) + case "estimatedRemainingDuration": + err = unpopulate(val, "EstimatedRemainingDuration", &a.EstimatedRemainingDuration) + delete(rawMsg, key) + case "internalPropertyBag": + err = unpopulate(val, "InternalPropertyBag", &a.InternalPropertyBag) + delete(rawMsg, key) + case "progressPercentage": + err = unpopulate(val, "ProgressPercentage", &a.ProgressPercentage) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) + delete(rawMsg, key) + case "tasksList": + err = unpopulate(val, "TasksList", &a.TasksList) + 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 AzureIaaSVMJobTaskDetails. func (a AzureIaaSVMJobTaskDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1409,6 +1515,7 @@ func (a AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "virtualMachineId", a.VirtualMachineID) populate(objectMap, "workloadType", a.WorkloadType) @@ -1502,6 +1609,9 @@ func (a *AzureIaaSVMProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -1522,7 +1632,10 @@ func (a *AzureIaaSVMProtectedItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureIaaSVMProtectedItemExtendedInfo. func (a AzureIaaSVMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "newestRecoveryPointInArchive", a.NewestRecoveryPointInArchive) populateTimeRFC3339(objectMap, "oldestRecoveryPoint", a.OldestRecoveryPoint) + populateTimeRFC3339(objectMap, "oldestRecoveryPointInArchive", a.OldestRecoveryPointInArchive) + populateTimeRFC3339(objectMap, "oldestRecoveryPointInVault", a.OldestRecoveryPointInVault) populate(objectMap, "policyInconsistent", a.PolicyInconsistent) populate(objectMap, "recoveryPointCount", a.RecoveryPointCount) return json.Marshal(objectMap) @@ -1537,9 +1650,18 @@ func (a *AzureIaaSVMProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { + case "newestRecoveryPointInArchive": + err = unpopulateTimeRFC3339(val, "NewestRecoveryPointInArchive", &a.NewestRecoveryPointInArchive) + delete(rawMsg, key) case "oldestRecoveryPoint": err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &a.OldestRecoveryPoint) delete(rawMsg, key) + case "oldestRecoveryPointInArchive": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPointInArchive", &a.OldestRecoveryPointInArchive) + delete(rawMsg, key) + case "oldestRecoveryPointInVault": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPointInVault", &a.OldestRecoveryPointInVault) + delete(rawMsg, key) case "policyInconsistent": err = unpopulate(val, "PolicyInconsistent", &a.PolicyInconsistent) delete(rawMsg, key) @@ -1565,6 +1687,7 @@ func (a AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "retentionPolicy", a.RetentionPolicy) populate(objectMap, "schedulePolicy", a.SchedulePolicy) + populate(objectMap, "tieringPolicy", a.TieringPolicy) populate(objectMap, "timeZone", a.TimeZone) return json.Marshal(objectMap) } @@ -1602,6 +1725,9 @@ func (a *AzureIaaSVMProtectionPolicy) UnmarshalJSON(data []byte) error { case "schedulePolicy": a.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) delete(rawMsg, key) + case "tieringPolicy": + err = unpopulate(val, "TieringPolicy", &a.TieringPolicy) + delete(rawMsg, key) case "timeZone": err = unpopulate(val, "TimeZone", &a.TimeZone) delete(rawMsg, key) @@ -1715,7 +1841,7 @@ func (a *AzureResourceProtectionIntent) UnmarshalJSON(data []byte) error { func (a AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeSQLAGWorkLoadContainer + objectMap["containerType"] = ProtectableContainerTypeSQLAGWorkLoadContainer populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) @@ -1782,7 +1908,7 @@ func (a *AzureSQLAGWorkloadContainerProtectionContainer) UnmarshalJSON(data []by func (a AzureSQLContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeAzureSQLContainer + objectMap["containerType"] = ProtectableContainerTypeAzureSQLContainer populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) populate(objectMap, "protectableObjectType", a.ProtectableObjectType) @@ -1846,6 +1972,7 @@ func (a AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { objectMap["protectedItemType"] = "Microsoft.Sql/servers/databases" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -1914,6 +2041,9 @@ func (a *AzureSQLProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -2007,7 +2137,7 @@ func (a AzureStorageContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "acquireStorageAccountLock", a.AcquireStorageAccountLock) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeStorageContainer + objectMap["containerType"] = ProtectableContainerTypeStorageContainer populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) populate(objectMap, "protectableObjectType", a.ProtectableObjectType) @@ -2078,6 +2208,32 @@ func (a AzureStorageErrorInfo) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageErrorInfo. +func (a *AzureStorageErrorInfo) UnmarshalJSON(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 "errorCode": + err = unpopulate(val, "ErrorCode", &a.ErrorCode) + delete(rawMsg, key) + case "errorString": + err = unpopulate(val, "ErrorString", &a.ErrorString) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &a.Recommendations) + 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 AzureStorageJob. func (a AzureStorageJob) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2170,6 +2326,63 @@ func (a AzureStorageJobExtendedInfo) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageJobExtendedInfo. +func (a *AzureStorageJobExtendedInfo) UnmarshalJSON(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 "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &a.DynamicErrorMessage) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) + delete(rawMsg, key) + case "tasksList": + err = unpopulate(val, "TasksList", &a.TasksList) + 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 AzureStorageJobTaskDetails. +func (a AzureStorageJobTaskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "status", a.Status) + populate(objectMap, "taskId", a.TaskID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageJobTaskDetails. +func (a *AzureStorageJobTaskDetails) UnmarshalJSON(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 "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &a.TaskID) + 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 AzureStorageProtectableContainer. func (a AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2177,7 +2390,7 @@ func (a AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { populate(objectMap, "containerId", a.ContainerID) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) - objectMap["protectableContainerType"] = ContainerTypeStorageContainer + objectMap["protectableContainerType"] = ProtectableContainerTypeStorageContainer return json.Marshal(objectMap) } @@ -2220,7 +2433,7 @@ func (a AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { populate(objectMap, "containerId", a.ContainerID) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) - objectMap["protectableContainerType"] = ContainerTypeVMAppContainer + objectMap["protectableContainerType"] = ProtectableContainerTypeVMAppContainer return json.Marshal(objectMap) } @@ -2260,7 +2473,7 @@ func (a *AzureVMAppContainerProtectableContainer) UnmarshalJSON(data []byte) err func (a AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeVMAppContainer + objectMap["containerType"] = ProtectableContainerTypeVMAppContainer populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) @@ -2358,6 +2571,33 @@ func (a *AzureVMResourceFeatureSupportRequest) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type AzureVMResourceFeatureSupportResponse. +func (a AzureVMResourceFeatureSupportResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "supportStatus", a.SupportStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMResourceFeatureSupportResponse. +func (a *AzureVMResourceFeatureSupportResponse) UnmarshalJSON(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 "supportStatus": + err = unpopulate(val, "SupportStatus", &a.SupportStatus) + 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 AzureVMWorkloadItem. func (a AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2527,6 +2767,7 @@ func (a AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -2625,6 +2866,9 @@ func (a *AzureVMWorkloadProtectedItem) UnmarshalJSON(data []byte) error { case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -2642,7 +2886,10 @@ func (a *AzureVMWorkloadProtectedItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadProtectedItemExtendedInfo. func (a AzureVMWorkloadProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "newestRecoveryPointInArchive", a.NewestRecoveryPointInArchive) populateTimeRFC3339(objectMap, "oldestRecoveryPoint", a.OldestRecoveryPoint) + populateTimeRFC3339(objectMap, "oldestRecoveryPointInArchive", a.OldestRecoveryPointInArchive) + populateTimeRFC3339(objectMap, "oldestRecoveryPointInVault", a.OldestRecoveryPointInVault) populate(objectMap, "policyState", a.PolicyState) populate(objectMap, "recoveryModel", a.RecoveryModel) populate(objectMap, "recoveryPointCount", a.RecoveryPointCount) @@ -2658,9 +2905,18 @@ func (a *AzureVMWorkloadProtectedItemExtendedInfo) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { + case "newestRecoveryPointInArchive": + err = unpopulateTimeRFC3339(val, "NewestRecoveryPointInArchive", &a.NewestRecoveryPointInArchive) + delete(rawMsg, key) case "oldestRecoveryPoint": err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &a.OldestRecoveryPoint) delete(rawMsg, key) + case "oldestRecoveryPointInArchive": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPointInArchive", &a.OldestRecoveryPointInArchive) + delete(rawMsg, key) + case "oldestRecoveryPointInVault": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPointInVault", &a.OldestRecoveryPointInVault) + delete(rawMsg, key) case "policyState": err = unpopulate(val, "PolicyState", &a.PolicyState) delete(rawMsg, key) @@ -2760,6 +3016,7 @@ func (a AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -2858,6 +3115,9 @@ func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) UnmarshalJSON(data []byte) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -3073,8 +3333,8 @@ func (a *AzureVMWorkloadSAPAseSystemWorkloadItem) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (a AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDBInstance. +func (a AzureVMWorkloadSAPHanaDBInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) @@ -3083,7 +3343,7 @@ func (a AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, er populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SAPHanaDatabase" + objectMap["protectableItemType"] = "SAPHanaDBInstance" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) @@ -3092,8 +3352,8 @@ func (a AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, er return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDBInstance. +func (a *AzureVMWorkloadSAPHanaDBInstance) UnmarshalJSON(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) @@ -3148,8 +3408,8 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (a AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDBInstanceProtectedItem. +func (a AzureVMWorkloadSAPHanaDBInstanceProtectedItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "backupSetName", a.BackupSetName) @@ -3174,18 +3434,19 @@ func (a AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, erro populate(objectMap, "policyName", a.PolicyName) populate(objectMap, "protectedItemDataSourceId", a.ProtectedItemDataSourceID) populate(objectMap, "protectedItemHealthStatus", a.ProtectedItemHealthStatus) - objectMap["protectedItemType"] = "AzureVmWorkloadSAPHanaDatabase" + objectMap["protectedItemType"] = "AzureVmWorkloadSAPHanaDBInstance" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDBInstanceProtectedItem. +func (a *AzureVMWorkloadSAPHanaDBInstanceProtectedItem) UnmarshalJSON(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) @@ -3277,6 +3538,9 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) UnmarshalJSON(data []byte) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -3291,24 +3555,27 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (a AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (a AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "isAutoProtected", a.IsAutoProtected) populate(objectMap, "parentName", a.ParentName) + populate(objectMap, "parentUniqueName", a.ParentUniqueName) + populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) + objectMap["protectableItemType"] = "SAPHanaDatabase" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - objectMap["workloadItemType"] = "SAPHanaDatabase" + populate(objectMap, "subprotectableitemcount", a.Subprotectableitemcount) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) UnmarshalJSON(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) @@ -3325,23 +3592,32 @@ func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) UnmarshalJSON(data []byte) case "isAutoProtectable": err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) + case "isAutoProtected": + err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) + case "parentUniqueName": + err = unpopulate(val, "ParentUniqueName", &a.ParentUniqueName) + delete(rawMsg, key) + case "prebackupvalidation": + err = unpopulate(val, "Prebackupvalidation", &a.Prebackupvalidation) + delete(rawMsg, key) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &a.ProtectableItemType) + delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "subWorkloadItemCount": - err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) - delete(rawMsg, key) case "subinquireditemcount": err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) delete(rawMsg, key) - case "workloadItemType": - err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) + case "subprotectableitemcount": + err = unpopulate(val, "Subprotectableitemcount", &a.Subprotectableitemcount) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3354,27 +3630,45 @@ func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaSystemProtectableItem. -func (a AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (a AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) + populate(objectMap, "backupSetName", a.BackupSetName) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "createMode", a.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", a.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", a.DeferredDeleteTimeRemaining) + populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) - populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isArchiveEnabled", a.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", a.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", a.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", a.IsScheduledForDeferredDelete) + populate(objectMap, "kpisHealths", a.KpisHealths) + populate(objectMap, "lastBackupErrorDetail", a.LastBackupErrorDetail) + populate(objectMap, "lastBackupStatus", a.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) populate(objectMap, "parentName", a.ParentName) - populate(objectMap, "parentUniqueName", a.ParentUniqueName) - populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SAPHanaSystem" + populate(objectMap, "parentType", a.ParentType) + populate(objectMap, "policyId", a.PolicyID) + populate(objectMap, "policyName", a.PolicyName) + populate(objectMap, "protectedItemDataSourceId", a.ProtectedItemDataSourceID) + populate(objectMap, "protectedItemHealthStatus", a.ProtectedItemHealthStatus) + objectMap["protectedItemType"] = "AzureVmWorkloadSAPHanaDatabase" populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "protectionStatus", a.ProtectionStatus) + populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - populate(objectMap, "subprotectableitemcount", a.Subprotectableitemcount) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaSystemProtectableItem. -func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) UnmarshalJSON(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) @@ -3385,38 +3679,92 @@ func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) UnmarshalJSON(data []byte) case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &a.FriendlyName) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &a.BackupSetName) delete(rawMsg, key) - case "isAutoProtectable": - err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) + case "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) delete(rawMsg, key) - case "isAutoProtected": - err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) + case "createMode": + err = unpopulate(val, "CreateMode", &a.CreateMode) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &a.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &a.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + delete(rawMsg, key) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &a.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &a.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &a.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &a.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "kpisHealths": + err = unpopulate(val, "KpisHealths", &a.KpisHealths) + delete(rawMsg, key) + case "lastBackupErrorDetail": + err = unpopulate(val, "LastBackupErrorDetail", &a.LastBackupErrorDetail) + delete(rawMsg, key) + case "lastBackupStatus": + err = unpopulate(val, "LastBackupStatus", &a.LastBackupStatus) + delete(rawMsg, key) + case "lastBackupTime": + err = unpopulateTimeRFC3339(val, "LastBackupTime", &a.LastBackupTime) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) - case "parentUniqueName": - err = unpopulate(val, "ParentUniqueName", &a.ParentUniqueName) + case "parentType": + err = unpopulate(val, "ParentType", &a.ParentType) delete(rawMsg, key) - case "prebackupvalidation": - err = unpopulate(val, "Prebackupvalidation", &a.Prebackupvalidation) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) delete(rawMsg, key) - case "protectableItemType": - err = unpopulate(val, "ProtectableItemType", &a.ProtectableItemType) + case "policyName": + err = unpopulate(val, "PolicyName", &a.PolicyName) + delete(rawMsg, key) + case "protectedItemDataSourceId": + err = unpopulate(val, "ProtectedItemDataSourceID", &a.ProtectedItemDataSourceID) + delete(rawMsg, key) + case "protectedItemHealthStatus": + err = unpopulate(val, "ProtectedItemHealthStatus", &a.ProtectedItemHealthStatus) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &a.ProtectedItemType) delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &a.ProtectionStatus) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) + delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "subinquireditemcount": - err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) delete(rawMsg, key) - case "subprotectableitemcount": - err = unpopulate(val, "Subprotectableitemcount", &a.Subprotectableitemcount) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3429,8 +3777,8 @@ func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (a AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (a AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) @@ -3440,13 +3788,13 @@ func (a AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - objectMap["workloadItemType"] = "SAPHanaSystem" + objectMap["workloadItemType"] = "SAPHanaDatabase" populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (a *AzureVMWorkloadSAPHanaSystemWorkloadItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) UnmarshalJSON(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) @@ -3492,8 +3840,8 @@ func (a *AzureVMWorkloadSAPHanaSystemWorkloadItem) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (a AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaHSR. +func (a AzureVMWorkloadSAPHanaHSR) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) @@ -3502,7 +3850,7 @@ func (a AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byt populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SQLAvailabilityGroupContainer" + objectMap["protectableItemType"] = "SAPHanaHSR" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) @@ -3511,8 +3859,8 @@ func (a AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byt return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaHSR. +func (a *AzureVMWorkloadSAPHanaHSR) UnmarshalJSON(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) @@ -3567,8 +3915,8 @@ func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseProtectableItem. -func (a AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaSystemProtectableItem. +func (a AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) @@ -3577,7 +3925,7 @@ func (a AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SQLDataBase" + objectMap["protectableItemType"] = "SAPHanaSystem" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) @@ -3586,8 +3934,8 @@ func (a AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseProtectableItem. -func (a *AzureVMWorkloadSQLDatabaseProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaSystemProtectableItem. +func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) UnmarshalJSON(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) @@ -3642,44 +3990,24 @@ func (a *AzureVMWorkloadSQLDatabaseProtectableItem) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseProtectedItem. -func (a AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (a AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "backupSetName", a.BackupSetName) - populate(objectMap, "containerName", a.ContainerName) - populate(objectMap, "createMode", a.CreateMode) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", a.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", a.DeferredDeleteTimeRemaining) - populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "isArchiveEnabled", a.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", a.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", a.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", a.IsScheduledForDeferredDelete) - populate(objectMap, "kpisHealths", a.KpisHealths) - populate(objectMap, "lastBackupErrorDetail", a.LastBackupErrorDetail) - populate(objectMap, "lastBackupStatus", a.LastBackupStatus) - populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) + populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "parentName", a.ParentName) - populate(objectMap, "parentType", a.ParentType) - populate(objectMap, "policyId", a.PolicyID) - populate(objectMap, "policyName", a.PolicyName) - populate(objectMap, "protectedItemDataSourceId", a.ProtectedItemDataSourceID) - populate(objectMap, "protectedItemHealthStatus", a.ProtectedItemHealthStatus) - objectMap["protectedItemType"] = "AzureVmWorkloadSQLDatabase" populate(objectMap, "protectionState", a.ProtectionState) - populate(objectMap, "protectionStatus", a.ProtectionStatus) - populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) + populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) + objectMap["workloadItemType"] = "SAPHanaSystem" populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseProtectedItem. -func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (a *AzureVMWorkloadSAPHanaSystemWorkloadItem) UnmarshalJSON(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) @@ -3690,89 +4018,29 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(data []byte) err case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &a.BackupSetName) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &a.ContainerName) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &a.CreateMode) - delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &a.DeferredDeleteTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &a.DeferredDeleteTimeRemaining) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) - delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &a.IsArchiveEnabled) - delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &a.IsDeferredDeleteScheduleUpcoming) - delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &a.IsRehydrate) - delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &a.IsScheduledForDeferredDelete) - delete(rawMsg, key) - case "kpisHealths": - err = unpopulate(val, "KpisHealths", &a.KpisHealths) - delete(rawMsg, key) - case "lastBackupErrorDetail": - err = unpopulate(val, "LastBackupErrorDetail", &a.LastBackupErrorDetail) - delete(rawMsg, key) - case "lastBackupStatus": - err = unpopulate(val, "LastBackupStatus", &a.LastBackupStatus) - delete(rawMsg, key) - case "lastBackupTime": - err = unpopulateTimeRFC3339(val, "LastBackupTime", &a.LastBackupTime) - delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) + case "isAutoProtectable": + err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) - case "parentType": - err = unpopulate(val, "ParentType", &a.ParentType) - delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &a.PolicyID) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &a.PolicyName) - delete(rawMsg, key) - case "protectedItemDataSourceId": - err = unpopulate(val, "ProtectedItemDataSourceID", &a.ProtectedItemDataSourceID) - delete(rawMsg, key) - case "protectedItemHealthStatus": - err = unpopulate(val, "ProtectedItemHealthStatus", &a.ProtectedItemHealthStatus) - delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &a.ProtectedItemType) - delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) - case "protectionStatus": - err = unpopulate(val, "ProtectionStatus", &a.ProtectionStatus) - delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) - delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "subWorkloadItemCount": + err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) + delete(rawMsg, key) + case "subinquireditemcount": + err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + delete(rawMsg, key) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3785,24 +4053,27 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseWorkloadItem. -func (a AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (a AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "isAutoProtected", a.IsAutoProtected) populate(objectMap, "parentName", a.ParentName) + populate(objectMap, "parentUniqueName", a.ParentUniqueName) + populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) + objectMap["protectableItemType"] = "SQLAvailabilityGroupContainer" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - objectMap["workloadItemType"] = "SQLDataBase" + populate(objectMap, "subprotectableitemcount", a.Subprotectableitemcount) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseWorkloadItem. -func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) UnmarshalJSON(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) @@ -3819,23 +4090,32 @@ func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) UnmarshalJSON(data []byte) erro case "isAutoProtectable": err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) + case "isAutoProtected": + err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) + case "parentUniqueName": + err = unpopulate(val, "ParentUniqueName", &a.ParentUniqueName) + delete(rawMsg, key) + case "prebackupvalidation": + err = unpopulate(val, "Prebackupvalidation", &a.Prebackupvalidation) + delete(rawMsg, key) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &a.ProtectableItemType) + delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "subWorkloadItemCount": - err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) - delete(rawMsg, key) case "subinquireditemcount": err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) delete(rawMsg, key) - case "workloadItemType": - err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) + case "subprotectableitemcount": + err = unpopulate(val, "Subprotectableitemcount", &a.Subprotectableitemcount) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3848,8 +4128,8 @@ func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLInstanceProtectableItem. -func (a AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseProtectableItem. +func (a AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) @@ -3858,7 +4138,7 @@ func (a AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SQLInstance" + objectMap["protectableItemType"] = "SQLDataBase" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) @@ -3867,8 +4147,8 @@ func (a AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLInstanceProtectableItem. -func (a *AzureVMWorkloadSQLInstanceProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseProtectableItem. +func (a *AzureVMWorkloadSQLDatabaseProtectableItem) UnmarshalJSON(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) @@ -3923,25 +4203,45 @@ func (a *AzureVMWorkloadSQLInstanceProtectableItem) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLInstanceWorkloadItem. -func (a AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseProtectedItem. +func (a AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "dataDirectoryPaths", a.DataDirectoryPaths) + populate(objectMap, "backupSetName", a.BackupSetName) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "createMode", a.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", a.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", a.DeferredDeleteTimeRemaining) + populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "isArchiveEnabled", a.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", a.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", a.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", a.IsScheduledForDeferredDelete) + populate(objectMap, "kpisHealths", a.KpisHealths) + populate(objectMap, "lastBackupErrorDetail", a.LastBackupErrorDetail) + populate(objectMap, "lastBackupStatus", a.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) populate(objectMap, "parentName", a.ParentName) + populate(objectMap, "parentType", a.ParentType) + populate(objectMap, "policyId", a.PolicyID) + populate(objectMap, "policyName", a.PolicyName) + populate(objectMap, "protectedItemDataSourceId", a.ProtectedItemDataSourceID) + populate(objectMap, "protectedItemHealthStatus", a.ProtectedItemHealthStatus) + objectMap["protectedItemType"] = "AzureVmWorkloadSQLDatabase" populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "protectionStatus", a.ProtectionStatus) + populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) - populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - objectMap["workloadItemType"] = "SQLInstance" + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLInstanceWorkloadItem. -func (a *AzureVMWorkloadSQLInstanceWorkloadItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseProtectedItem. +func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(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) @@ -3952,32 +4252,92 @@ func (a *AzureVMWorkloadSQLInstanceWorkloadItem) UnmarshalJSON(data []byte) erro case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "dataDirectoryPaths": - err = unpopulate(val, "DataDirectoryPaths", &a.DataDirectoryPaths) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &a.BackupSetName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &a.CreateMode) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &a.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &a.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "isAutoProtectable": - err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &a.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &a.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &a.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &a.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "kpisHealths": + err = unpopulate(val, "KpisHealths", &a.KpisHealths) + delete(rawMsg, key) + case "lastBackupErrorDetail": + err = unpopulate(val, "LastBackupErrorDetail", &a.LastBackupErrorDetail) + delete(rawMsg, key) + case "lastBackupStatus": + err = unpopulate(val, "LastBackupStatus", &a.LastBackupStatus) + delete(rawMsg, key) + case "lastBackupTime": + err = unpopulateTimeRFC3339(val, "LastBackupTime", &a.LastBackupTime) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) + case "parentType": + err = unpopulate(val, "ParentType", &a.ParentType) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &a.PolicyName) + delete(rawMsg, key) + case "protectedItemDataSourceId": + err = unpopulate(val, "ProtectedItemDataSourceID", &a.ProtectedItemDataSourceID) + delete(rawMsg, key) + case "protectedItemHealthStatus": + err = unpopulate(val, "ProtectedItemHealthStatus", &a.ProtectedItemHealthStatus) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &a.ProtectedItemType) + delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &a.ProtectionStatus) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) + delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "subWorkloadItemCount": - err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) - delete(rawMsg, key) - case "subinquireditemcount": - err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) delete(rawMsg, key) - case "workloadItemType": - err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3990,20 +4350,24 @@ func (a *AzureVMWorkloadSQLInstanceWorkloadItem) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadAutoProtectionIntent. -func (a AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseWorkloadItem. +func (a AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "itemId", a.ItemID) - populate(objectMap, "policyId", a.PolicyID) - objectMap["protectionIntentItemType"] = "ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent" + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "parentName", a.ParentName) populate(objectMap, "protectionState", a.ProtectionState) - populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) + populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) + objectMap["workloadItemType"] = "SQLDataBase" + populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadAutoProtectionIntent. -func (a *AzureWorkloadAutoProtectionIntent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseWorkloadItem. +func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) UnmarshalJSON(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) @@ -4014,59 +4378,32 @@ func (a *AzureWorkloadAutoProtectionIntent) UnmarshalJSON(data []byte) error { case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "itemId": - err = unpopulate(val, "ItemID", &a.ItemID) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &a.PolicyID) + case "isAutoProtectable": + err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) - case "protectionIntentItemType": - err = unpopulate(val, "ProtectionIntentItemType", &a.ProtectionIntentItemType) + case "parentName": + err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "serverName": + err = unpopulate(val, "ServerName", &a.ServerName) 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 AzureWorkloadBackupRequest. -func (a AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupType", a.BackupType) - populate(objectMap, "enableCompression", a.EnableCompression) - objectMap["objectType"] = "AzureWorkloadBackupRequest" - populateTimeRFC3339(objectMap, "recoveryPointExpiryTimeInUTC", a.RecoveryPointExpiryTimeInUTC) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadBackupRequest. -func (a *AzureWorkloadBackupRequest) UnmarshalJSON(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 "backupType": - err = unpopulate(val, "BackupType", &a.BackupType) + case "subWorkloadItemCount": + err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) delete(rawMsg, key) - case "enableCompression": - err = unpopulate(val, "EnableCompression", &a.EnableCompression) + case "subinquireditemcount": + err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) delete(rawMsg, key) - case "recoveryPointExpiryTimeInUTC": - err = unpopulateTimeRFC3339(val, "RecoveryPointExpiryTimeInUTC", &a.RecoveryPointExpiryTimeInUTC) + case "workloadType": + err = unpopulate(val, "WorkloadType", &a.WorkloadType) delete(rawMsg, key) } if err != nil { @@ -4076,25 +4413,27 @@ func (a *AzureWorkloadBackupRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainer. -func (a AzureWorkloadContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLInstanceProtectableItem. +func (a AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeAzureWorkloadContainer - populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "healthStatus", a.HealthStatus) - populateTimeRFC3339(objectMap, "lastUpdatedTime", a.LastUpdatedTime) - populate(objectMap, "operationType", a.OperationType) - populate(objectMap, "protectableObjectType", a.ProtectableObjectType) - populate(objectMap, "registrationStatus", a.RegistrationStatus) - populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "parentName", a.ParentName) + populate(objectMap, "parentUniqueName", a.ParentUniqueName) + populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) + objectMap["protectableItemType"] = "SQLInstance" + populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) + populate(objectMap, "subprotectableitemcount", a.Subprotectableitemcount) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainer. -func (a *AzureWorkloadContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLInstanceProtectableItem. +func (a *AzureVMWorkloadSQLInstanceProtectableItem) UnmarshalJSON(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) @@ -4105,35 +4444,41 @@ func (a *AzureWorkloadContainer) UnmarshalJSON(data []byte) error { case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &a.ContainerType) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) - delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &a.HealthStatus) + case "isAutoProtectable": + err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) - case "lastUpdatedTime": - err = unpopulateTimeRFC3339(val, "LastUpdatedTime", &a.LastUpdatedTime) + case "isAutoProtected": + err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) - case "operationType": - err = unpopulate(val, "OperationType", &a.OperationType) + case "parentName": + err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &a.ProtectableObjectType) + case "parentUniqueName": + err = unpopulate(val, "ParentUniqueName", &a.ParentUniqueName) delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &a.RegistrationStatus) + case "prebackupvalidation": + err = unpopulate(val, "Prebackupvalidation", &a.Prebackupvalidation) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &a.ProtectableItemType) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &a.WorkloadType) + case "protectionState": + err = unpopulate(val, "ProtectionState", &a.ProtectionState) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &a.ServerName) + delete(rawMsg, key) + case "subinquireditemcount": + err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + delete(rawMsg, key) + case "subprotectableitemcount": + err = unpopulate(val, "Subprotectableitemcount", &a.Subprotectableitemcount) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &a.WorkloadType) delete(rawMsg, key) } if err != nil { @@ -4143,20 +4488,25 @@ func (a *AzureWorkloadContainer) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainerAutoProtectionIntent. -func (a AzureWorkloadContainerAutoProtectionIntent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLInstanceWorkloadItem. +func (a AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "itemId", a.ItemID) - populate(objectMap, "policyId", a.PolicyID) - objectMap["protectionIntentItemType"] = ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent + populate(objectMap, "dataDirectoryPaths", a.DataDirectoryPaths) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "parentName", a.ParentName) populate(objectMap, "protectionState", a.ProtectionState) - populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) + populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) + objectMap["workloadItemType"] = "SQLInstance" + populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainerAutoProtectionIntent. -func (a *AzureWorkloadContainerAutoProtectionIntent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLInstanceWorkloadItem. +func (a *AzureVMWorkloadSQLInstanceWorkloadItem) UnmarshalJSON(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) @@ -4167,20 +4517,35 @@ func (a *AzureWorkloadContainerAutoProtectionIntent) UnmarshalJSON(data []byte) case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "itemId": - err = unpopulate(val, "ItemID", &a.ItemID) + case "dataDirectoryPaths": + err = unpopulate(val, "DataDirectoryPaths", &a.DataDirectoryPaths) delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &a.PolicyID) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "protectionIntentItemType": - err = unpopulate(val, "ProtectionIntentItemType", &a.ProtectionIntentItemType) + case "isAutoProtectable": + err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) + delete(rawMsg, key) + case "parentName": + err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "serverName": + err = unpopulate(val, "ServerName", &a.ServerName) + delete(rawMsg, key) + case "subWorkloadItemCount": + err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) + delete(rawMsg, key) + case "subinquireditemcount": + err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + delete(rawMsg, key) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &a.WorkloadType) delete(rawMsg, key) } if err != nil { @@ -4190,47 +4555,20 @@ func (a *AzureWorkloadContainerAutoProtectionIntent) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainerExtendedInfo. -func (a AzureWorkloadContainerExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hostServerName", a.HostServerName) - populate(objectMap, "inquiryInfo", a.InquiryInfo) - populate(objectMap, "nodesList", a.NodesList) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadErrorInfo. -func (a AzureWorkloadErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalDetails", a.AdditionalDetails) - populate(objectMap, "errorCode", a.ErrorCode) - populate(objectMap, "errorString", a.ErrorString) - populate(objectMap, "errorTitle", a.ErrorTitle) - populate(objectMap, "recommendations", a.Recommendations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadJob. -func (a AzureWorkloadJob) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadAutoProtectionIntent. +func (a AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "actionsInfo", a.ActionsInfo) - populate(objectMap, "activityId", a.ActivityID) populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "duration", a.Duration) - populateTimeRFC3339(objectMap, "endTime", a.EndTime) - populate(objectMap, "entityFriendlyName", a.EntityFriendlyName) - populate(objectMap, "errorDetails", a.ErrorDetails) - populate(objectMap, "extendedInfo", a.ExtendedInfo) - objectMap["jobType"] = "AzureWorkloadJob" - populate(objectMap, "operation", a.Operation) - populateTimeRFC3339(objectMap, "startTime", a.StartTime) - populate(objectMap, "status", a.Status) - populate(objectMap, "workloadType", a.WorkloadType) + populate(objectMap, "itemId", a.ItemID) + populate(objectMap, "policyId", a.PolicyID) + objectMap["protectionIntentItemType"] = "ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent" + populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "sourceResourceId", a.SourceResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadJob. -func (a *AzureWorkloadJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadAutoProtectionIntent. +func (a *AzureWorkloadAutoProtectionIntent) UnmarshalJSON(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) @@ -4238,44 +4576,23 @@ func (a *AzureWorkloadJob) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "actionsInfo": - err = unpopulate(val, "ActionsInfo", &a.ActionsInfo) - delete(rawMsg, key) - case "activityId": - err = unpopulate(val, "ActivityID", &a.ActivityID) - delete(rawMsg, key) case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "duration": - err = unpopulate(val, "Duration", &a.Duration) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) - delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &a.EntityFriendlyName) - delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &a.ErrorDetails) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &a.JobType) + case "itemId": + err = unpopulate(val, "ItemID", &a.ItemID) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &a.Operation) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) + case "protectionIntentItemType": + err = unpopulate(val, "ProtectionIntentItemType", &a.ProtectionIntentItemType) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) + case "protectionState": + err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &a.WorkloadType) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) } if err != nil { @@ -4285,29 +4602,18 @@ func (a *AzureWorkloadJob) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadJobExtendedInfo. -func (a AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dynamicErrorMessage", a.DynamicErrorMessage) - populate(objectMap, "propertyBag", a.PropertyBag) - populate(objectMap, "tasksList", a.TasksList) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadPointInTimeRecoveryPoint. -func (a AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadBackupRequest. +func (a AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadPointInTimeRecoveryPoint" - populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) - populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) - populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) - populate(objectMap, "timeRanges", a.TimeRanges) - populate(objectMap, "type", a.Type) + populate(objectMap, "backupType", a.BackupType) + populate(objectMap, "enableCompression", a.EnableCompression) + objectMap["objectType"] = "AzureWorkloadBackupRequest" + populateTimeRFC3339(objectMap, "recoveryPointExpiryTimeInUTC", a.RecoveryPointExpiryTimeInUTC) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadPointInTimeRecoveryPoint. -func (a *AzureWorkloadPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadBackupRequest. +func (a *AzureWorkloadBackupRequest) UnmarshalJSON(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) @@ -4315,23 +4621,17 @@ func (a *AzureWorkloadPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) - delete(rawMsg, key) - case "recoveryPointMoveReadinessInfo": - err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) - delete(rawMsg, key) - case "recoveryPointTierDetails": - err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) + case "backupType": + err = unpopulate(val, "BackupType", &a.BackupType) delete(rawMsg, key) - case "recoveryPointTimeInUTC": - err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) + case "enableCompression": + err = unpopulate(val, "EnableCompression", &a.EnableCompression) delete(rawMsg, key) - case "timeRanges": - err = unpopulate(val, "TimeRanges", &a.TimeRanges) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "recoveryPointExpiryTimeInUTC": + err = unpopulateTimeRFC3339(val, "RecoveryPointExpiryTimeInUTC", &a.RecoveryPointExpiryTimeInUTC) delete(rawMsg, key) } if err != nil { @@ -4341,22 +4641,25 @@ func (a *AzureWorkloadPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadPointInTimeRestoreRequest. -func (a AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainer. +func (a AzureWorkloadContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadPointInTimeRestoreRequest" - populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) - populate(objectMap, "propertyBag", a.PropertyBag) - populate(objectMap, "recoveryMode", a.RecoveryMode) - populate(objectMap, "recoveryType", a.RecoveryType) + populate(objectMap, "backupManagementType", a.BackupManagementType) + objectMap["containerType"] = ProtectableContainerTypeAzureWorkloadContainer + populate(objectMap, "extendedInfo", a.ExtendedInfo) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "healthStatus", a.HealthStatus) + populateTimeRFC3339(objectMap, "lastUpdatedTime", a.LastUpdatedTime) + populate(objectMap, "operationType", a.OperationType) + populate(objectMap, "protectableObjectType", a.ProtectableObjectType) + populate(objectMap, "registrationStatus", a.RegistrationStatus) populate(objectMap, "sourceResourceId", a.SourceResourceID) - populate(objectMap, "targetInfo", a.TargetInfo) - populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) + populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadPointInTimeRestoreRequest. -func (a *AzureWorkloadPointInTimeRestoreRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainer. +func (a *AzureWorkloadContainer) UnmarshalJSON(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) @@ -4364,29 +4667,38 @@ func (a *AzureWorkloadPointInTimeRestoreRequest) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) - delete(rawMsg, key) - case "pointInTime": - err = unpopulateTimeRFC3339(val, "PointInTime", &a.PointInTime) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "propertyBag": - err = unpopulate(val, "PropertyBag", &a.PropertyBag) + case "containerType": + err = unpopulate(val, "ContainerType", &a.ContainerType) delete(rawMsg, key) - case "recoveryMode": - err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) delete(rawMsg, key) - case "recoveryType": - err = unpopulate(val, "RecoveryType", &a.RecoveryType) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &a.HealthStatus) delete(rawMsg, key) - case "targetInfo": - err = unpopulate(val, "TargetInfo", &a.TargetInfo) + case "lastUpdatedTime": + err = unpopulateTimeRFC3339(val, "LastUpdatedTime", &a.LastUpdatedTime) delete(rawMsg, key) - case "targetVirtualMachineId": - err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) + case "operationType": + err = unpopulate(val, "OperationType", &a.OperationType) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &a.ProtectableObjectType) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &a.RegistrationStatus) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &a.WorkloadType) delete(rawMsg, key) } if err != nil { @@ -4396,19 +4708,20 @@ func (a *AzureWorkloadPointInTimeRestoreRequest) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadRecoveryPoint. -func (a AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainerAutoProtectionIntent. +func (a AzureWorkloadContainerAutoProtectionIntent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadRecoveryPoint" - populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) - populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) - populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) - populate(objectMap, "type", a.Type) + populate(objectMap, "backupManagementType", a.BackupManagementType) + populate(objectMap, "itemId", a.ItemID) + populate(objectMap, "policyId", a.PolicyID) + objectMap["protectionIntentItemType"] = ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent + populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "sourceResourceId", a.SourceResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadRecoveryPoint. -func (a *AzureWorkloadRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainerAutoProtectionIntent. +func (a *AzureWorkloadContainerAutoProtectionIntent) UnmarshalJSON(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) @@ -4416,20 +4729,23 @@ func (a *AzureWorkloadRecoveryPoint) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "recoveryPointMoveReadinessInfo": - err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) + case "itemId": + err = unpopulate(val, "ItemID", &a.ItemID) delete(rawMsg, key) - case "recoveryPointTierDetails": - err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) delete(rawMsg, key) - case "recoveryPointTimeInUTC": - err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) + case "protectionIntentItemType": + err = unpopulate(val, "ProtectionIntentItemType", &a.ProtectionIntentItemType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "protectionState": + err = unpopulate(val, "ProtectionState", &a.ProtectionState) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) } if err != nil { @@ -4439,21 +4755,17 @@ func (a *AzureWorkloadRecoveryPoint) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadRestoreRequest. -func (a AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainerExtendedInfo. +func (a AzureWorkloadContainerExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadRestoreRequest" - populate(objectMap, "propertyBag", a.PropertyBag) - populate(objectMap, "recoveryMode", a.RecoveryMode) - populate(objectMap, "recoveryType", a.RecoveryType) - populate(objectMap, "sourceResourceId", a.SourceResourceID) - populate(objectMap, "targetInfo", a.TargetInfo) - populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) + populate(objectMap, "hostServerName", a.HostServerName) + populate(objectMap, "inquiryInfo", a.InquiryInfo) + populate(objectMap, "nodesList", a.NodesList) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadRestoreRequest. -func (a *AzureWorkloadRestoreRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainerExtendedInfo. +func (a *AzureWorkloadContainerExtendedInfo) UnmarshalJSON(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) @@ -4461,26 +4773,14 @@ func (a *AzureWorkloadRestoreRequest) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) - delete(rawMsg, key) - case "propertyBag": - err = unpopulate(val, "PropertyBag", &a.PropertyBag) - delete(rawMsg, key) - case "recoveryMode": - err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) - delete(rawMsg, key) - case "recoveryType": - err = unpopulate(val, "RecoveryType", &a.RecoveryType) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "hostServerName": + err = unpopulate(val, "HostServerName", &a.HostServerName) delete(rawMsg, key) - case "targetInfo": - err = unpopulate(val, "TargetInfo", &a.TargetInfo) + case "inquiryInfo": + err = unpopulate(val, "InquiryInfo", &a.InquiryInfo) delete(rawMsg, key) - case "targetVirtualMachineId": - err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) + case "nodesList": + err = unpopulate(val, "NodesList", &a.NodesList) delete(rawMsg, key) } if err != nil { @@ -4490,20 +4790,19 @@ func (a *AzureWorkloadRestoreRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (a AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadErrorInfo. +func (a AzureWorkloadErrorInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" - populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) - populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) - populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) - populate(objectMap, "timeRanges", a.TimeRanges) - populate(objectMap, "type", a.Type) + populate(objectMap, "additionalDetails", a.AdditionalDetails) + populate(objectMap, "errorCode", a.ErrorCode) + populate(objectMap, "errorString", a.ErrorString) + populate(objectMap, "errorTitle", a.ErrorTitle) + populate(objectMap, "recommendations", a.Recommendations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaPointInTimeRecoveryPoint. -func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadErrorInfo. +func (a *AzureWorkloadErrorInfo) UnmarshalJSON(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) @@ -4511,23 +4810,20 @@ func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) UnmarshalJSON(data []byte for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) - delete(rawMsg, key) - case "recoveryPointMoveReadinessInfo": - err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) + case "additionalDetails": + err = unpopulate(val, "AdditionalDetails", &a.AdditionalDetails) delete(rawMsg, key) - case "recoveryPointTierDetails": - err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) + case "errorCode": + err = unpopulate(val, "ErrorCode", &a.ErrorCode) delete(rawMsg, key) - case "recoveryPointTimeInUTC": - err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) + case "errorString": + err = unpopulate(val, "ErrorString", &a.ErrorString) delete(rawMsg, key) - case "timeRanges": - err = unpopulate(val, "TimeRanges", &a.TimeRanges) + case "errorTitle": + err = unpopulate(val, "ErrorTitle", &a.ErrorTitle) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "recommendations": + err = unpopulate(val, "Recommendations", &a.Recommendations) delete(rawMsg, key) } if err != nil { @@ -4537,22 +4833,27 @@ func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (a AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadJob. +func (a AzureWorkloadJob) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" - populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) - populate(objectMap, "propertyBag", a.PropertyBag) - populate(objectMap, "recoveryMode", a.RecoveryMode) - populate(objectMap, "recoveryType", a.RecoveryType) - populate(objectMap, "sourceResourceId", a.SourceResourceID) - populate(objectMap, "targetInfo", a.TargetInfo) - populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) + populate(objectMap, "actionsInfo", a.ActionsInfo) + populate(objectMap, "activityId", a.ActivityID) + populate(objectMap, "backupManagementType", a.BackupManagementType) + populate(objectMap, "duration", a.Duration) + populateTimeRFC3339(objectMap, "endTime", a.EndTime) + populate(objectMap, "entityFriendlyName", a.EntityFriendlyName) + populate(objectMap, "errorDetails", a.ErrorDetails) + populate(objectMap, "extendedInfo", a.ExtendedInfo) + objectMap["jobType"] = "AzureWorkloadJob" + populate(objectMap, "operation", a.Operation) + populateTimeRFC3339(objectMap, "startTime", a.StartTime) + populate(objectMap, "status", a.Status) + populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreRequest. -func (a *AzureWorkloadSAPHanaPointInTimeRestoreRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadJob. +func (a *AzureWorkloadJob) UnmarshalJSON(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) @@ -4560,29 +4861,44 @@ func (a *AzureWorkloadSAPHanaPointInTimeRestoreRequest) UnmarshalJSON(data []byt for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) + case "actionsInfo": + err = unpopulate(val, "ActionsInfo", &a.ActionsInfo) delete(rawMsg, key) - case "pointInTime": - err = unpopulateTimeRFC3339(val, "PointInTime", &a.PointInTime) + case "activityId": + err = unpopulate(val, "ActivityID", &a.ActivityID) delete(rawMsg, key) - case "propertyBag": - err = unpopulate(val, "PropertyBag", &a.PropertyBag) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "recoveryMode": - err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) + case "duration": + err = unpopulate(val, "Duration", &a.Duration) delete(rawMsg, key) - case "recoveryType": - err = unpopulate(val, "RecoveryType", &a.RecoveryType) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &a.EntityFriendlyName) delete(rawMsg, key) - case "targetInfo": - err = unpopulate(val, "TargetInfo", &a.TargetInfo) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &a.ErrorDetails) delete(rawMsg, key) - case "targetVirtualMachineId": - err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &a.JobType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &a.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &a.WorkloadType) delete(rawMsg, key) } if err != nil { @@ -4592,23 +4908,17 @@ func (a *AzureWorkloadSAPHanaPointInTimeRestoreRequest) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. -func (a AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadJobExtendedInfo. +func (a AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest" - populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) + populate(objectMap, "dynamicErrorMessage", a.DynamicErrorMessage) populate(objectMap, "propertyBag", a.PropertyBag) - populate(objectMap, "recoveryMode", a.RecoveryMode) - populate(objectMap, "recoveryPointRehydrationInfo", a.RecoveryPointRehydrationInfo) - populate(objectMap, "recoveryType", a.RecoveryType) - populate(objectMap, "sourceResourceId", a.SourceResourceID) - populate(objectMap, "targetInfo", a.TargetInfo) - populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) + populate(objectMap, "tasksList", a.TasksList) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. -func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadJobExtendedInfo. +func (a *AzureWorkloadJobExtendedInfo) UnmarshalJSON(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) @@ -4616,32 +4926,14 @@ func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) UnmarshalJS for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) - delete(rawMsg, key) - case "pointInTime": - err = unpopulateTimeRFC3339(val, "PointInTime", &a.PointInTime) + case "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &a.DynamicErrorMessage) delete(rawMsg, key) case "propertyBag": err = unpopulate(val, "PropertyBag", &a.PropertyBag) delete(rawMsg, key) - case "recoveryMode": - err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) - delete(rawMsg, key) - case "recoveryPointRehydrationInfo": - err = unpopulate(val, "RecoveryPointRehydrationInfo", &a.RecoveryPointRehydrationInfo) - delete(rawMsg, key) - case "recoveryType": - err = unpopulate(val, "RecoveryType", &a.RecoveryType) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) - delete(rawMsg, key) - case "targetInfo": - err = unpopulate(val, "TargetInfo", &a.TargetInfo) - delete(rawMsg, key) - case "targetVirtualMachineId": - err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) + case "tasksList": + err = unpopulate(val, "TasksList", &a.TasksList) delete(rawMsg, key) } if err != nil { @@ -4651,19 +4943,16 @@ func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) UnmarshalJS return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaRecoveryPoint. -func (a AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadJobTaskDetails. +func (a AzureWorkloadJobTaskDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadSAPHanaRecoveryPoint" - populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) - populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) - populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) - populate(objectMap, "type", a.Type) + populate(objectMap, "status", a.Status) + populate(objectMap, "taskId", a.TaskID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaRecoveryPoint. -func (a *AzureWorkloadSAPHanaRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadJobTaskDetails. +func (a *AzureWorkloadJobTaskDetails) UnmarshalJSON(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) @@ -4671,17 +4960,55 @@ func (a *AzureWorkloadSAPHanaRecoveryPoint) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) - delete(rawMsg, key) - case "recoveryPointMoveReadinessInfo": - err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) + case "status": + err = unpopulate(val, "Status", &a.Status) delete(rawMsg, key) - case "recoveryPointTierDetails": - err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) + case "taskId": + err = unpopulate(val, "TaskID", &a.TaskID) delete(rawMsg, key) - case "recoveryPointTimeInUTC": - err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadPointInTimeRecoveryPoint. +func (a AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = "AzureWorkloadPointInTimeRecoveryPoint" + populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) + populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) + populate(objectMap, "timeRanges", a.TimeRanges) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadPointInTimeRecoveryPoint. +func (a *AzureWorkloadPointInTimeRecoveryPoint) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) + delete(rawMsg, key) + case "recoveryPointMoveReadinessInfo": + err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) + delete(rawMsg, key) + case "recoveryPointTierDetails": + err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) + delete(rawMsg, key) + case "recoveryPointTimeInUTC": + err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) + delete(rawMsg, key) + case "timeRanges": + err = unpopulate(val, "TimeRanges", &a.TimeRanges) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) @@ -4694,10 +5021,11 @@ func (a *AzureWorkloadSAPHanaRecoveryPoint) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaRestoreRequest. -func (a AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadPointInTimeRestoreRequest. +func (a AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadSAPHanaRestoreRequest" + objectMap["objectType"] = "AzureWorkloadPointInTimeRestoreRequest" + populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) populate(objectMap, "propertyBag", a.PropertyBag) populate(objectMap, "recoveryMode", a.RecoveryMode) populate(objectMap, "recoveryType", a.RecoveryType) @@ -4707,8 +5035,8 @@ func (a AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaRestoreRequest. -func (a *AzureWorkloadSAPHanaRestoreRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadPointInTimeRestoreRequest. +func (a *AzureWorkloadPointInTimeRestoreRequest) UnmarshalJSON(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) @@ -4719,6 +5047,9 @@ func (a *AzureWorkloadSAPHanaRestoreRequest) UnmarshalJSON(data []byte) error { case "objectType": err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) + case "pointInTime": + err = unpopulateTimeRFC3339(val, "PointInTime", &a.PointInTime) + delete(rawMsg, key) case "propertyBag": err = unpopulate(val, "PropertyBag", &a.PropertyBag) delete(rawMsg, key) @@ -4745,22 +5076,19 @@ func (a *AzureWorkloadSAPHanaRestoreRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaRestoreWithRehydrateRequest. -func (a AzureWorkloadSAPHanaRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadRecoveryPoint. +func (a AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadSAPHanaRestoreWithRehydrateRequest" - populate(objectMap, "propertyBag", a.PropertyBag) - populate(objectMap, "recoveryMode", a.RecoveryMode) - populate(objectMap, "recoveryPointRehydrationInfo", a.RecoveryPointRehydrationInfo) - populate(objectMap, "recoveryType", a.RecoveryType) - populate(objectMap, "sourceResourceId", a.SourceResourceID) - populate(objectMap, "targetInfo", a.TargetInfo) - populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) + objectMap["objectType"] = "AzureWorkloadRecoveryPoint" + populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) + populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaRestoreWithRehydrateRequest. -func (a *AzureWorkloadSAPHanaRestoreWithRehydrateRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadRecoveryPoint. +func (a *AzureWorkloadRecoveryPoint) UnmarshalJSON(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) @@ -4771,26 +5099,17 @@ func (a *AzureWorkloadSAPHanaRestoreWithRehydrateRequest) UnmarshalJSON(data []b case "objectType": err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "propertyBag": - err = unpopulate(val, "PropertyBag", &a.PropertyBag) - delete(rawMsg, key) - case "recoveryMode": - err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) - delete(rawMsg, key) - case "recoveryPointRehydrationInfo": - err = unpopulate(val, "RecoveryPointRehydrationInfo", &a.RecoveryPointRehydrationInfo) - delete(rawMsg, key) - case "recoveryType": - err = unpopulate(val, "RecoveryType", &a.RecoveryType) + case "recoveryPointMoveReadinessInfo": + err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "recoveryPointTierDetails": + err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) delete(rawMsg, key) - case "targetInfo": - err = unpopulate(val, "TargetInfo", &a.TargetInfo) + case "recoveryPointTimeInUTC": + err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) delete(rawMsg, key) - case "targetVirtualMachineId": - err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -4800,21 +5119,21 @@ func (a *AzureWorkloadSAPHanaRestoreWithRehydrateRequest) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLAutoProtectionIntent. -func (a AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadRestoreRequest. +func (a AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "itemId", a.ItemID) - populate(objectMap, "policyId", a.PolicyID) - objectMap["protectionIntentItemType"] = "ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent" - populate(objectMap, "protectionState", a.ProtectionState) + objectMap["objectType"] = "AzureWorkloadRestoreRequest" + populate(objectMap, "propertyBag", a.PropertyBag) + populate(objectMap, "recoveryMode", a.RecoveryMode) + populate(objectMap, "recoveryType", a.RecoveryType) populate(objectMap, "sourceResourceId", a.SourceResourceID) - populate(objectMap, "workloadItemType", a.WorkloadItemType) + populate(objectMap, "targetInfo", a.TargetInfo) + populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLAutoProtectionIntent. -func (a *AzureWorkloadSQLAutoProtectionIntent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadRestoreRequest. +func (a *AzureWorkloadRestoreRequest) UnmarshalJSON(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) @@ -4822,26 +5141,26 @@ func (a *AzureWorkloadSQLAutoProtectionIntent) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) - delete(rawMsg, key) - case "itemId": - err = unpopulate(val, "ItemID", &a.ItemID) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &a.PolicyID) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) delete(rawMsg, key) - case "protectionIntentItemType": - err = unpopulate(val, "ProtectionIntentItemType", &a.ProtectionIntentItemType) + case "recoveryMode": + err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) delete(rawMsg, key) - case "protectionState": - err = unpopulate(val, "ProtectionState", &a.ProtectionState) + case "recoveryType": + err = unpopulate(val, "RecoveryType", &a.RecoveryType) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) - case "workloadItemType": - err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) + case "targetInfo": + err = unpopulate(val, "TargetInfo", &a.TargetInfo) + delete(rawMsg, key) + case "targetVirtualMachineId": + err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) delete(rawMsg, key) } if err != nil { @@ -4851,11 +5170,10 @@ func (a *AzureWorkloadSQLAutoProtectionIntent) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLPointInTimeRecoveryPoint. -func (a AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (a AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "extendedInfo", a.ExtendedInfo) - objectMap["objectType"] = "AzureWorkloadSQLPointInTimeRecoveryPoint" + objectMap["objectType"] = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) @@ -4864,8 +5182,8 @@ func (a AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLPointInTimeRecoveryPoint. -func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaPointInTimeRecoveryPoint. +func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) UnmarshalJSON(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) @@ -4873,9 +5191,6 @@ func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) - delete(rawMsg, key) case "objectType": err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) @@ -4902,25 +5217,22 @@ func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLPointInTimeRestoreRequest. -func (a AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (a AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) - populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) - objectMap["objectType"] = "AzureWorkloadSQLPointInTimeRestoreRequest" + objectMap["objectType"] = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) populate(objectMap, "propertyBag", a.PropertyBag) populate(objectMap, "recoveryMode", a.RecoveryMode) populate(objectMap, "recoveryType", a.RecoveryType) - populate(objectMap, "shouldUseAlternateTargetLocation", a.ShouldUseAlternateTargetLocation) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "targetInfo", a.TargetInfo) populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLPointInTimeRestoreRequest. -func (a *AzureWorkloadSQLPointInTimeRestoreRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreRequest. +func (a *AzureWorkloadSAPHanaPointInTimeRestoreRequest) UnmarshalJSON(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) @@ -4928,12 +5240,6 @@ func (a *AzureWorkloadSQLPointInTimeRestoreRequest) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "alternateDirectoryPaths": - err = unpopulate(val, "AlternateDirectoryPaths", &a.AlternateDirectoryPaths) - delete(rawMsg, key) - case "isNonRecoverable": - err = unpopulate(val, "IsNonRecoverable", &a.IsNonRecoverable) - delete(rawMsg, key) case "objectType": err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) @@ -4949,9 +5255,6 @@ func (a *AzureWorkloadSQLPointInTimeRestoreRequest) UnmarshalJSON(data []byte) e case "recoveryType": err = unpopulate(val, "RecoveryType", &a.RecoveryType) delete(rawMsg, key) - case "shouldUseAlternateTargetLocation": - err = unpopulate(val, "ShouldUseAlternateTargetLocation", &a.ShouldUseAlternateTargetLocation) - delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -4969,26 +5272,23 @@ func (a *AzureWorkloadSQLPointInTimeRestoreRequest) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. -func (a AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (a AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) - populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) - objectMap["objectType"] = "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest" + objectMap["objectType"] = "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest" populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) populate(objectMap, "propertyBag", a.PropertyBag) populate(objectMap, "recoveryMode", a.RecoveryMode) populate(objectMap, "recoveryPointRehydrationInfo", a.RecoveryPointRehydrationInfo) populate(objectMap, "recoveryType", a.RecoveryType) - populate(objectMap, "shouldUseAlternateTargetLocation", a.ShouldUseAlternateTargetLocation) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "targetInfo", a.TargetInfo) populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. -func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. +func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) UnmarshalJSON(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) @@ -4996,12 +5296,6 @@ func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) UnmarshalJSON(d for key, val := range rawMsg { var err error switch key { - case "alternateDirectoryPaths": - err = unpopulate(val, "AlternateDirectoryPaths", &a.AlternateDirectoryPaths) - delete(rawMsg, key) - case "isNonRecoverable": - err = unpopulate(val, "IsNonRecoverable", &a.IsNonRecoverable) - delete(rawMsg, key) case "objectType": err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) @@ -5020,9 +5314,6 @@ func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) UnmarshalJSON(d case "recoveryType": err = unpopulate(val, "RecoveryType", &a.RecoveryType) delete(rawMsg, key) - case "shouldUseAlternateTargetLocation": - err = unpopulate(val, "ShouldUseAlternateTargetLocation", &a.ShouldUseAlternateTargetLocation) - delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -5040,11 +5331,10 @@ func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) UnmarshalJSON(d return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRecoveryPoint. -func (a AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaRecoveryPoint. +func (a AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "extendedInfo", a.ExtendedInfo) - objectMap["objectType"] = "AzureWorkloadSQLRecoveryPoint" + objectMap["objectType"] = "AzureWorkloadSAPHanaRecoveryPoint" populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) @@ -5052,8 +5342,8 @@ func (a AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLRecoveryPoint. -func (a *AzureWorkloadSQLRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaRecoveryPoint. +func (a *AzureWorkloadSAPHanaRecoveryPoint) UnmarshalJSON(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) @@ -5061,9 +5351,6 @@ func (a *AzureWorkloadSQLRecoveryPoint) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) - delete(rawMsg, key) case "objectType": err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) @@ -5087,16 +5374,21 @@ func (a *AzureWorkloadSQLRecoveryPoint) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRecoveryPointExtendedInfo. -func (a AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaRestoreRequest. +func (a AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "dataDirectoryPaths", a.DataDirectoryPaths) - populateTimeRFC3339(objectMap, "dataDirectoryTimeInUTC", a.DataDirectoryTimeInUTC) + objectMap["objectType"] = "AzureWorkloadSAPHanaRestoreRequest" + populate(objectMap, "propertyBag", a.PropertyBag) + populate(objectMap, "recoveryMode", a.RecoveryMode) + populate(objectMap, "recoveryType", a.RecoveryType) + populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "targetInfo", a.TargetInfo) + populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLRecoveryPointExtendedInfo. -func (a *AzureWorkloadSQLRecoveryPointExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaRestoreRequest. +func (a *AzureWorkloadSAPHanaRestoreRequest) UnmarshalJSON(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) @@ -5104,56 +5396,11 @@ func (a *AzureWorkloadSQLRecoveryPointExtendedInfo) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "dataDirectoryPaths": - err = unpopulate(val, "DataDirectoryPaths", &a.DataDirectoryPaths) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "dataDirectoryTimeInUTC": - err = unpopulateTimeRFC3339(val, "DataDirectoryTimeInUTC", &a.DataDirectoryTimeInUTC) - 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 AzureWorkloadSQLRestoreRequest. -func (a AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) - populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) - objectMap["objectType"] = "AzureWorkloadSQLRestoreRequest" - populate(objectMap, "propertyBag", a.PropertyBag) - populate(objectMap, "recoveryMode", a.RecoveryMode) - populate(objectMap, "recoveryType", a.RecoveryType) - populate(objectMap, "shouldUseAlternateTargetLocation", a.ShouldUseAlternateTargetLocation) - populate(objectMap, "sourceResourceId", a.SourceResourceID) - populate(objectMap, "targetInfo", a.TargetInfo) - populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLRestoreRequest. -func (a *AzureWorkloadSQLRestoreRequest) UnmarshalJSON(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 "alternateDirectoryPaths": - err = unpopulate(val, "AlternateDirectoryPaths", &a.AlternateDirectoryPaths) - delete(rawMsg, key) - case "isNonRecoverable": - err = unpopulate(val, "IsNonRecoverable", &a.IsNonRecoverable) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) - delete(rawMsg, key) - case "propertyBag": - err = unpopulate(val, "PropertyBag", &a.PropertyBag) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) delete(rawMsg, key) case "recoveryMode": err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) @@ -5161,9 +5408,6 @@ func (a *AzureWorkloadSQLRestoreRequest) UnmarshalJSON(data []byte) error { case "recoveryType": err = unpopulate(val, "RecoveryType", &a.RecoveryType) delete(rawMsg, key) - case "shouldUseAlternateTargetLocation": - err = unpopulate(val, "ShouldUseAlternateTargetLocation", &a.ShouldUseAlternateTargetLocation) - delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -5181,25 +5425,22 @@ func (a *AzureWorkloadSQLRestoreRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRestoreWithRehydrateRequest. -func (a AzureWorkloadSQLRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (a AzureWorkloadSAPHanaRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) - populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) - objectMap["objectType"] = "AzureWorkloadSQLRestoreWithRehydrateRequest" + objectMap["objectType"] = "AzureWorkloadSAPHanaRestoreWithRehydrateRequest" populate(objectMap, "propertyBag", a.PropertyBag) populate(objectMap, "recoveryMode", a.RecoveryMode) populate(objectMap, "recoveryPointRehydrationInfo", a.RecoveryPointRehydrationInfo) populate(objectMap, "recoveryType", a.RecoveryType) - populate(objectMap, "shouldUseAlternateTargetLocation", a.ShouldUseAlternateTargetLocation) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "targetInfo", a.TargetInfo) populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLRestoreWithRehydrateRequest. -func (a *AzureWorkloadSQLRestoreWithRehydrateRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSAPHanaRestoreWithRehydrateRequest. +func (a *AzureWorkloadSAPHanaRestoreWithRehydrateRequest) UnmarshalJSON(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) @@ -5207,12 +5448,6 @@ func (a *AzureWorkloadSQLRestoreWithRehydrateRequest) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "alternateDirectoryPaths": - err = unpopulate(val, "AlternateDirectoryPaths", &a.AlternateDirectoryPaths) - delete(rawMsg, key) - case "isNonRecoverable": - err = unpopulate(val, "IsNonRecoverable", &a.IsNonRecoverable) - delete(rawMsg, key) case "objectType": err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) @@ -5228,9 +5463,6 @@ func (a *AzureWorkloadSQLRestoreWithRehydrateRequest) UnmarshalJSON(data []byte) case "recoveryType": err = unpopulate(val, "RecoveryType", &a.RecoveryType) delete(rawMsg, key) - case "shouldUseAlternateTargetLocation": - err = unpopulate(val, "ShouldUseAlternateTargetLocation", &a.ShouldUseAlternateTargetLocation) - delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -5248,3650 +5480,8557 @@ func (a *AzureWorkloadSQLRestoreWithRehydrateRequest) UnmarshalJSON(data []byte) return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type BMSRPQueryObject. -func (b *BMSRPQueryObject) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLAutoProtectionIntent. +func (a AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", a.BackupManagementType) + populate(objectMap, "itemId", a.ItemID) + populate(objectMap, "policyId", a.PolicyID) + objectMap["protectionIntentItemType"] = "ProtectionIntentItemTypeAzureWorkloadSQLAutoProtectionIntent" + populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "workloadItemType", a.WorkloadItemType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLAutoProtectionIntent. +func (a *AzureWorkloadSQLAutoProtectionIntent) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "endDate": - err = unpopulateTimeRFC3339(val, "EndDate", &b.EndDate) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &b.ExtendedInfo) + case "itemId": + err = unpopulate(val, "ItemID", &a.ItemID) delete(rawMsg, key) - case "moveReadyRPOnly": - err = unpopulate(val, "MoveReadyRPOnly", &b.MoveReadyRPOnly) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) delete(rawMsg, key) - case "restorePointQueryType": - err = unpopulate(val, "RestorePointQueryType", &b.RestorePointQueryType) + case "protectionIntentItemType": + err = unpopulate(val, "ProtectionIntentItemType", &a.ProtectionIntentItemType) delete(rawMsg, key) - case "startDate": - err = unpopulateTimeRFC3339(val, "StartDate", &b.StartDate) + case "protectionState": + err = unpopulate(val, "ProtectionState", &a.ProtectionState) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + delete(rawMsg, key) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupEngineBaseResource. -func (b BackupEngineBaseResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLPointInTimeRecoveryPoint. +func (a AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) + populate(objectMap, "extendedInfo", a.ExtendedInfo) + objectMap["objectType"] = "AzureWorkloadSQLPointInTimeRecoveryPoint" + populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) + populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) + populate(objectMap, "timeRanges", a.TimeRanges) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineBaseResource. -func (b *BackupEngineBaseResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLPointInTimeRecoveryPoint. +func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &b.ETag) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &b.ID) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &b.Location) + case "recoveryPointMoveReadinessInfo": + err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) + case "recoveryPointTierDetails": + err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) delete(rawMsg, key) - case "properties": - b.Properties, err = unmarshalBackupEngineBaseClassification(val) + case "recoveryPointTimeInUTC": + err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &b.Tags) + case "timeRanges": + err = unpopulate(val, "TimeRanges", &a.TimeRanges) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &b.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupEngineExtendedInfo. -func (b BackupEngineExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLPointInTimeRestoreRequest. +func (a AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "availableDiskSpace", b.AvailableDiskSpace) - populate(objectMap, "azureProtectedInstances", b.AzureProtectedInstances) - populate(objectMap, "databaseName", b.DatabaseName) - populate(objectMap, "diskCount", b.DiskCount) - populate(objectMap, "protectedItemsCount", b.ProtectedItemsCount) - populate(objectMap, "protectedServersCount", b.ProtectedServersCount) - populateTimeRFC3339(objectMap, "refreshedAt", b.RefreshedAt) - populate(objectMap, "usedDiskSpace", b.UsedDiskSpace) + populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) + populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) + objectMap["objectType"] = "AzureWorkloadSQLPointInTimeRestoreRequest" + populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) + populate(objectMap, "propertyBag", a.PropertyBag) + populate(objectMap, "recoveryMode", a.RecoveryMode) + populate(objectMap, "recoveryType", a.RecoveryType) + populate(objectMap, "shouldUseAlternateTargetLocation", a.ShouldUseAlternateTargetLocation) + populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "targetInfo", a.TargetInfo) + populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineExtendedInfo. -func (b *BackupEngineExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLPointInTimeRestoreRequest. +func (a *AzureWorkloadSQLPointInTimeRestoreRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "availableDiskSpace": - err = unpopulate(val, "AvailableDiskSpace", &b.AvailableDiskSpace) + case "alternateDirectoryPaths": + err = unpopulate(val, "AlternateDirectoryPaths", &a.AlternateDirectoryPaths) delete(rawMsg, key) - case "azureProtectedInstances": - err = unpopulate(val, "AzureProtectedInstances", &b.AzureProtectedInstances) + case "isNonRecoverable": + err = unpopulate(val, "IsNonRecoverable", &a.IsNonRecoverable) delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &b.DatabaseName) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "diskCount": - err = unpopulate(val, "DiskCount", &b.DiskCount) + case "pointInTime": + err = unpopulateTimeRFC3339(val, "PointInTime", &a.PointInTime) delete(rawMsg, key) - case "protectedItemsCount": - err = unpopulate(val, "ProtectedItemsCount", &b.ProtectedItemsCount) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) delete(rawMsg, key) - case "protectedServersCount": - err = unpopulate(val, "ProtectedServersCount", &b.ProtectedServersCount) + case "recoveryMode": + err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) delete(rawMsg, key) - case "refreshedAt": - err = unpopulateTimeRFC3339(val, "RefreshedAt", &b.RefreshedAt) + case "recoveryType": + err = unpopulate(val, "RecoveryType", &a.RecoveryType) delete(rawMsg, key) - case "usedDiskSpace": - err = unpopulate(val, "UsedDiskSpace", &b.UsedDiskSpace) + case "shouldUseAlternateTargetLocation": + err = unpopulate(val, "ShouldUseAlternateTargetLocation", &a.ShouldUseAlternateTargetLocation) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + delete(rawMsg, key) + case "targetInfo": + err = unpopulate(val, "TargetInfo", &a.TargetInfo) + delete(rawMsg, key) + case "targetVirtualMachineId": + err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupManagementUsage. -func (b *BackupManagementUsage) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (a AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) + populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) + objectMap["objectType"] = "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest" + populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) + populate(objectMap, "propertyBag", a.PropertyBag) + populate(objectMap, "recoveryMode", a.RecoveryMode) + populate(objectMap, "recoveryPointRehydrationInfo", a.RecoveryPointRehydrationInfo) + populate(objectMap, "recoveryType", a.RecoveryType) + populate(objectMap, "shouldUseAlternateTargetLocation", a.ShouldUseAlternateTargetLocation) + populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "targetInfo", a.TargetInfo) + populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. +func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &b.CurrentValue) + case "alternateDirectoryPaths": + err = unpopulate(val, "AlternateDirectoryPaths", &a.AlternateDirectoryPaths) delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &b.Limit) + case "isNonRecoverable": + err = unpopulate(val, "IsNonRecoverable", &a.IsNonRecoverable) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "nextResetTime": - err = unpopulateTimeRFC3339(val, "NextResetTime", &b.NextResetTime) + case "pointInTime": + err = unpopulateTimeRFC3339(val, "PointInTime", &a.PointInTime) delete(rawMsg, key) - case "quotaPeriod": - err = unpopulate(val, "QuotaPeriod", &b.QuotaPeriod) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &b.Unit) + case "recoveryMode": + err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) + delete(rawMsg, key) + case "recoveryPointRehydrationInfo": + err = unpopulate(val, "RecoveryPointRehydrationInfo", &a.RecoveryPointRehydrationInfo) + delete(rawMsg, key) + case "recoveryType": + err = unpopulate(val, "RecoveryType", &a.RecoveryType) + delete(rawMsg, key) + case "shouldUseAlternateTargetLocation": + err = unpopulate(val, "ShouldUseAlternateTargetLocation", &a.ShouldUseAlternateTargetLocation) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + delete(rawMsg, key) + case "targetInfo": + err = unpopulate(val, "TargetInfo", &a.TargetInfo) + delete(rawMsg, key) + case "targetVirtualMachineId": + err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupRequestResource. -func (b BackupRequestResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRecoveryPoint. +func (a AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) + populate(objectMap, "extendedInfo", a.ExtendedInfo) + objectMap["objectType"] = "AzureWorkloadSQLRecoveryPoint" + populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) + populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupRequestResource. -func (b *BackupRequestResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLRecoveryPoint. +func (a *AzureWorkloadSQLRecoveryPoint) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &b.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &b.ID) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &b.Location) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) + case "recoveryPointMoveReadinessInfo": + err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) delete(rawMsg, key) - case "properties": - b.Properties, err = unmarshalBackupRequestClassification(val) + case "recoveryPointTierDetails": + err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &b.Tags) + case "recoveryPointTimeInUTC": + err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &b.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupResourceConfigResource. -func (b BackupResourceConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigExtendedResource. -func (b BackupResourceEncryptionConfigExtendedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigResource. -func (b BackupResourceEncryptionConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupResourceVaultConfig. -func (b BackupResourceVaultConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enhancedSecurityState", b.EnhancedSecurityState) - populate(objectMap, "isSoftDeleteFeatureStateEditable", b.IsSoftDeleteFeatureStateEditable) - populate(objectMap, "resourceGuardOperationRequests", b.ResourceGuardOperationRequests) - populate(objectMap, "softDeleteFeatureState", b.SoftDeleteFeatureState) - populate(objectMap, "storageModelType", b.StorageModelType) - populate(objectMap, "storageType", b.StorageType) - populate(objectMap, "storageTypeState", b.StorageTypeState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupResourceVaultConfigResource. -func (b BackupResourceVaultConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DPMContainerExtendedInfo. -func (d DPMContainerExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRecoveryPointExtendedInfo. +func (a AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastRefreshedAt", d.LastRefreshedAt) + populate(objectMap, "dataDirectoryPaths", a.DataDirectoryPaths) + populateTimeRFC3339(objectMap, "dataDirectoryTimeInUTC", a.DataDirectoryTimeInUTC) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DPMContainerExtendedInfo. -func (d *DPMContainerExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLRecoveryPointExtendedInfo. +func (a *AzureWorkloadSQLRecoveryPointExtendedInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "lastRefreshedAt": - err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &d.LastRefreshedAt) + case "dataDirectoryPaths": + err = unpopulate(val, "DataDirectoryPaths", &a.DataDirectoryPaths) + delete(rawMsg, key) + case "dataDirectoryTimeInUTC": + err = unpopulateTimeRFC3339(val, "DataDirectoryTimeInUTC", &a.DataDirectoryTimeInUTC) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DPMProtectedItem. -func (d DPMProtectedItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRestoreRequest. +func (a AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupEngineName", d.BackupEngineName) - populate(objectMap, "backupManagementType", d.BackupManagementType) - populate(objectMap, "backupSetName", d.BackupSetName) - populate(objectMap, "containerName", d.ContainerName) - populate(objectMap, "createMode", d.CreateMode) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", d.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", d.DeferredDeleteTimeRemaining) - populate(objectMap, "extendedInfo", d.ExtendedInfo) - populate(objectMap, "friendlyName", d.FriendlyName) - populate(objectMap, "isArchiveEnabled", d.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", d.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", d.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", d.IsScheduledForDeferredDelete) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", d.LastRecoveryPoint) - populate(objectMap, "policyId", d.PolicyID) - populate(objectMap, "policyName", d.PolicyName) - objectMap["protectedItemType"] = "DPMProtectedItem" - populate(objectMap, "protectionState", d.ProtectionState) - populate(objectMap, "resourceGuardOperationRequests", d.ResourceGuardOperationRequests) - populate(objectMap, "sourceResourceId", d.SourceResourceID) - populate(objectMap, "workloadType", d.WorkloadType) + populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) + populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) + objectMap["objectType"] = "AzureWorkloadSQLRestoreRequest" + populate(objectMap, "propertyBag", a.PropertyBag) + populate(objectMap, "recoveryMode", a.RecoveryMode) + populate(objectMap, "recoveryType", a.RecoveryType) + populate(objectMap, "shouldUseAlternateTargetLocation", a.ShouldUseAlternateTargetLocation) + populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "targetInfo", a.TargetInfo) + populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DPMProtectedItem. -func (d *DPMProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLRestoreRequest. +func (a *AzureWorkloadSQLRestoreRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "backupEngineName": - err = unpopulate(val, "BackupEngineName", &d.BackupEngineName) - delete(rawMsg, key) - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + case "alternateDirectoryPaths": + err = unpopulate(val, "AlternateDirectoryPaths", &a.AlternateDirectoryPaths) delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &d.BackupSetName) + case "isNonRecoverable": + err = unpopulate(val, "IsNonRecoverable", &a.IsNonRecoverable) delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &d.ContainerName) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &d.CreateMode) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &d.DeferredDeleteTimeInUTC) + case "recoveryMode": + err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &d.DeferredDeleteTimeRemaining) + case "recoveryType": + err = unpopulate(val, "RecoveryType", &a.RecoveryType) delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + case "shouldUseAlternateTargetLocation": + err = unpopulate(val, "ShouldUseAlternateTargetLocation", &a.ShouldUseAlternateTargetLocation) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &d.IsArchiveEnabled) - delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &d.IsDeferredDeleteScheduleUpcoming) - delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &d.IsRehydrate) - delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &d.IsScheduledForDeferredDelete) - delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &d.LastRecoveryPoint) - delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &d.PolicyID) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &d.PolicyName) - delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &d.ProtectedItemType) - delete(rawMsg, key) - case "protectionState": - err = unpopulate(val, "ProtectionState", &d.ProtectionState) - delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &d.ResourceGuardOperationRequests) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) + case "targetInfo": + err = unpopulate(val, "TargetInfo", &a.TargetInfo) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &d.WorkloadType) + case "targetVirtualMachineId": + err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DPMProtectedItemExtendedInfo. -func (d DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRestoreWithRehydrateRequest. +func (a AzureWorkloadSQLRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "diskStorageUsedInBytes", d.DiskStorageUsedInBytes) - populate(objectMap, "isCollocated", d.IsCollocated) - populate(objectMap, "isPresentOnCloud", d.IsPresentOnCloud) - populate(objectMap, "lastBackupStatus", d.LastBackupStatus) - populateTimeRFC3339(objectMap, "lastRefreshedAt", d.LastRefreshedAt) - populateTimeRFC3339(objectMap, "oldestRecoveryPoint", d.OldestRecoveryPoint) - populateTimeRFC3339(objectMap, "onPremiseLatestRecoveryPoint", d.OnPremiseLatestRecoveryPoint) - populateTimeRFC3339(objectMap, "onPremiseOldestRecoveryPoint", d.OnPremiseOldestRecoveryPoint) - populate(objectMap, "onPremiseRecoveryPointCount", d.OnPremiseRecoveryPointCount) - populate(objectMap, "protectableObjectLoadPath", d.ProtectableObjectLoadPath) - populate(objectMap, "protected", d.Protected) - populate(objectMap, "protectionGroupName", d.ProtectionGroupName) - populate(objectMap, "recoveryPointCount", d.RecoveryPointCount) - populate(objectMap, "totalDiskStorageSizeInBytes", d.TotalDiskStorageSizeInBytes) + populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) + populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) + objectMap["objectType"] = "AzureWorkloadSQLRestoreWithRehydrateRequest" + populate(objectMap, "propertyBag", a.PropertyBag) + populate(objectMap, "recoveryMode", a.RecoveryMode) + populate(objectMap, "recoveryPointRehydrationInfo", a.RecoveryPointRehydrationInfo) + populate(objectMap, "recoveryType", a.RecoveryType) + populate(objectMap, "shouldUseAlternateTargetLocation", a.ShouldUseAlternateTargetLocation) + populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "targetInfo", a.TargetInfo) + populate(objectMap, "targetVirtualMachineId", a.TargetVirtualMachineID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DPMProtectedItemExtendedInfo. -func (d *DPMProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadSQLRestoreWithRehydrateRequest. +func (a *AzureWorkloadSQLRestoreWithRehydrateRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "diskStorageUsedInBytes": - err = unpopulate(val, "DiskStorageUsedInBytes", &d.DiskStorageUsedInBytes) - delete(rawMsg, key) - case "isCollocated": - err = unpopulate(val, "IsCollocated", &d.IsCollocated) - delete(rawMsg, key) - case "isPresentOnCloud": - err = unpopulate(val, "IsPresentOnCloud", &d.IsPresentOnCloud) - delete(rawMsg, key) - case "lastBackupStatus": - err = unpopulate(val, "LastBackupStatus", &d.LastBackupStatus) + case "alternateDirectoryPaths": + err = unpopulate(val, "AlternateDirectoryPaths", &a.AlternateDirectoryPaths) delete(rawMsg, key) - case "lastRefreshedAt": - err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &d.LastRefreshedAt) + case "isNonRecoverable": + err = unpopulate(val, "IsNonRecoverable", &a.IsNonRecoverable) delete(rawMsg, key) - case "oldestRecoveryPoint": - err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &d.OldestRecoveryPoint) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) - case "onPremiseLatestRecoveryPoint": - err = unpopulateTimeRFC3339(val, "OnPremiseLatestRecoveryPoint", &d.OnPremiseLatestRecoveryPoint) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) delete(rawMsg, key) - case "onPremiseOldestRecoveryPoint": - err = unpopulateTimeRFC3339(val, "OnPremiseOldestRecoveryPoint", &d.OnPremiseOldestRecoveryPoint) + case "recoveryMode": + err = unpopulate(val, "RecoveryMode", &a.RecoveryMode) delete(rawMsg, key) - case "onPremiseRecoveryPointCount": - err = unpopulate(val, "OnPremiseRecoveryPointCount", &d.OnPremiseRecoveryPointCount) + case "recoveryPointRehydrationInfo": + err = unpopulate(val, "RecoveryPointRehydrationInfo", &a.RecoveryPointRehydrationInfo) delete(rawMsg, key) - case "protectableObjectLoadPath": - err = unpopulate(val, "ProtectableObjectLoadPath", &d.ProtectableObjectLoadPath) + case "recoveryType": + err = unpopulate(val, "RecoveryType", &a.RecoveryType) delete(rawMsg, key) - case "protected": - err = unpopulate(val, "Protected", &d.Protected) + case "shouldUseAlternateTargetLocation": + err = unpopulate(val, "ShouldUseAlternateTargetLocation", &a.ShouldUseAlternateTargetLocation) delete(rawMsg, key) - case "protectionGroupName": - err = unpopulate(val, "ProtectionGroupName", &d.ProtectionGroupName) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) - case "recoveryPointCount": - err = unpopulate(val, "RecoveryPointCount", &d.RecoveryPointCount) + case "targetInfo": + err = unpopulate(val, "TargetInfo", &a.TargetInfo) delete(rawMsg, key) - case "totalDiskStorageSizeInBytes": - err = unpopulate(val, "TotalDiskStorageSizeInBytes", &d.TotalDiskStorageSizeInBytes) + case "targetVirtualMachineId": + err = unpopulate(val, "TargetVirtualMachineID", &a.TargetVirtualMachineID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DailyRetentionFormat. -func (d DailyRetentionFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BEKDetails. +func (b BEKDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "daysOfTheMonth", d.DaysOfTheMonth) + populate(objectMap, "secretData", b.SecretData) + populate(objectMap, "secretUrl", b.SecretURL) + populate(objectMap, "secretVaultId", b.SecretVaultID) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type DailyRetentionSchedule. -func (d DailyRetentionSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "retentionDuration", d.RetentionDuration) - aux := make([]*timeRFC3339, len(d.RetentionTimes), len(d.RetentionTimes)) - for i := 0; i < len(d.RetentionTimes); i++ { - aux[i] = (*timeRFC3339)(d.RetentionTimes[i]) +// UnmarshalJSON implements the json.Unmarshaller interface for type BEKDetails. +func (b *BEKDetails) UnmarshalJSON(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) } - populate(objectMap, "retentionTimes", aux) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DailySchedule. -func (d DailySchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - aux := make([]*timeRFC3339, len(d.ScheduleRunTimes), len(d.ScheduleRunTimes)) - for i := 0; i < len(d.ScheduleRunTimes); i++ { - aux[i] = (*timeRFC3339)(d.ScheduleRunTimes[i]) + for key, val := range rawMsg { + var err error + switch key { + case "secretData": + err = unpopulate(val, "SecretData", &b.SecretData) + delete(rawMsg, key) + case "secretUrl": + err = unpopulate(val, "SecretURL", &b.SecretURL) + delete(rawMsg, key) + case "secretVaultId": + err = unpopulate(val, "SecretVaultID", &b.SecretVaultID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } } - populate(objectMap, "scheduleRunTimes", aux) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DiskExclusionProperties. -func (d DiskExclusionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "diskLunList", d.DiskLunList) - populate(objectMap, "isInclusionList", d.IsInclusionList) - return json.Marshal(objectMap) + return nil } -// MarshalJSON implements the json.Marshaller interface for type DpmBackupEngine. -func (d DpmBackupEngine) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BMSBackupEngineQueryObject. +func (b BMSBackupEngineQueryObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "azureBackupAgentVersion", d.AzureBackupAgentVersion) - populate(objectMap, "backupEngineId", d.BackupEngineID) - populate(objectMap, "backupEngineState", d.BackupEngineState) - objectMap["backupEngineType"] = BackupEngineTypeDpmBackupEngine - populate(objectMap, "backupManagementType", d.BackupManagementType) - populate(objectMap, "canReRegister", d.CanReRegister) - populate(objectMap, "dpmVersion", d.DpmVersion) - populate(objectMap, "extendedInfo", d.ExtendedInfo) - populate(objectMap, "friendlyName", d.FriendlyName) - populate(objectMap, "healthStatus", d.HealthStatus) - populate(objectMap, "isAzureBackupAgentUpgradeAvailable", d.IsAzureBackupAgentUpgradeAvailable) - populate(objectMap, "isDpmUpgradeAvailable", d.IsDpmUpgradeAvailable) - populate(objectMap, "registrationStatus", d.RegistrationStatus) + populate(objectMap, "expand", b.Expand) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DpmBackupEngine. -func (d *DpmBackupEngine) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSBackupEngineQueryObject. +func (b *BMSBackupEngineQueryObject) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "azureBackupAgentVersion": - err = unpopulate(val, "AzureBackupAgentVersion", &d.AzureBackupAgentVersion) - delete(rawMsg, key) - case "backupEngineId": - err = unpopulate(val, "BackupEngineID", &d.BackupEngineID) - delete(rawMsg, key) - case "backupEngineState": - err = unpopulate(val, "BackupEngineState", &d.BackupEngineState) - delete(rawMsg, key) - case "backupEngineType": - err = unpopulate(val, "BackupEngineType", &d.BackupEngineType) - delete(rawMsg, key) - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) - delete(rawMsg, key) - case "canReRegister": - err = unpopulate(val, "CanReRegister", &d.CanReRegister) - delete(rawMsg, key) - case "dpmVersion": - err = unpopulate(val, "DpmVersion", &d.DpmVersion) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) - delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &d.HealthStatus) - delete(rawMsg, key) - case "isAzureBackupAgentUpgradeAvailable": - err = unpopulate(val, "IsAzureBackupAgentUpgradeAvailable", &d.IsAzureBackupAgentUpgradeAvailable) - delete(rawMsg, key) - case "isDpmUpgradeAvailable": - err = unpopulate(val, "IsDpmUpgradeAvailable", &d.IsDpmUpgradeAvailable) - delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) + case "expand": + err = unpopulate(val, "Expand", &b.Expand) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DpmContainer. -func (d DpmContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BMSBackupEnginesQueryObject. +func (b BMSBackupEnginesQueryObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", d.BackupManagementType) - populate(objectMap, "canReRegister", d.CanReRegister) - populate(objectMap, "containerId", d.ContainerID) - objectMap["containerType"] = ContainerTypeDPMContainer - populate(objectMap, "dpmAgentVersion", d.DpmAgentVersion) - populate(objectMap, "dpmServers", d.DpmServers) - populate(objectMap, "extendedInfo", d.ExtendedInfo) - populate(objectMap, "friendlyName", d.FriendlyName) - populate(objectMap, "healthStatus", d.HealthStatus) - populate(objectMap, "protectableObjectType", d.ProtectableObjectType) - populate(objectMap, "protectedItemCount", d.ProtectedItemCount) - populate(objectMap, "protectionStatus", d.ProtectionStatus) - populate(objectMap, "registrationStatus", d.RegistrationStatus) - populate(objectMap, "upgradeAvailable", d.UpgradeAvailable) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "expand", b.Expand) + populate(objectMap, "friendlyName", b.FriendlyName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DpmContainer. -func (d *DpmContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSBackupEnginesQueryObject. +func (b *BMSBackupEnginesQueryObject) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) - case "canReRegister": - err = unpopulate(val, "CanReRegister", &d.CanReRegister) - delete(rawMsg, key) - case "containerId": - err = unpopulate(val, "ContainerID", &d.ContainerID) - delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &d.ContainerType) - delete(rawMsg, key) - case "dpmAgentVersion": - err = unpopulate(val, "DpmAgentVersion", &d.DpmAgentVersion) - delete(rawMsg, key) - case "dpmServers": - err = unpopulate(val, "DpmServers", &d.DpmServers) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + case "expand": + err = unpopulate(val, "Expand", &b.Expand) delete(rawMsg, key) case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) - delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &d.HealthStatus) - delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &d.ProtectableObjectType) - delete(rawMsg, key) - case "protectedItemCount": - err = unpopulate(val, "ProtectedItemCount", &d.ProtectedItemCount) - delete(rawMsg, key) - case "protectionStatus": - err = unpopulate(val, "ProtectionStatus", &d.ProtectionStatus) - delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) - delete(rawMsg, key) - case "upgradeAvailable": - err = unpopulate(val, "UpgradeAvailable", &d.UpgradeAvailable) + err = unpopulate(val, "FriendlyName", &b.FriendlyName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DpmErrorInfo. -func (d DpmErrorInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BMSBackupSummariesQueryObject. +func (b BMSBackupSummariesQueryObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "errorString", d.ErrorString) - populate(objectMap, "recommendations", d.Recommendations) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type DpmJob. -func (d DpmJob) MarshalJSON() ([]byte, error) { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSBackupSummariesQueryObject. +func (b *BMSBackupSummariesQueryObject) UnmarshalJSON(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 "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BMSContainerQueryObject. +func (b BMSContainerQueryObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "actionsInfo", d.ActionsInfo) - populate(objectMap, "activityId", d.ActivityID) - populate(objectMap, "backupManagementType", d.BackupManagementType) - populate(objectMap, "containerName", d.ContainerName) - populate(objectMap, "containerType", d.ContainerType) - populate(objectMap, "dpmServerName", d.DpmServerName) - populate(objectMap, "duration", d.Duration) - populateTimeRFC3339(objectMap, "endTime", d.EndTime) - populate(objectMap, "entityFriendlyName", d.EntityFriendlyName) - populate(objectMap, "errorDetails", d.ErrorDetails) - populate(objectMap, "extendedInfo", d.ExtendedInfo) - objectMap["jobType"] = "DpmJob" - populate(objectMap, "operation", d.Operation) - populateTimeRFC3339(objectMap, "startTime", d.StartTime) - populate(objectMap, "status", d.Status) - populate(objectMap, "workloadType", d.WorkloadType) + populate(objectMap, "backupEngineName", b.BackupEngineName) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "containerType", b.ContainerType) + populate(objectMap, "fabricName", b.FabricName) + populate(objectMap, "friendlyName", b.FriendlyName) + populate(objectMap, "status", b.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJob. -func (d *DpmJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSContainerQueryObject. +func (b *BMSContainerQueryObject) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "actionsInfo": - err = unpopulate(val, "ActionsInfo", &d.ActionsInfo) - delete(rawMsg, key) - case "activityId": - err = unpopulate(val, "ActivityID", &d.ActivityID) + case "backupEngineName": + err = unpopulate(val, "BackupEngineName", &b.BackupEngineName) delete(rawMsg, key) case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &d.ContainerName) + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) case "containerType": - err = unpopulate(val, "ContainerType", &d.ContainerType) - delete(rawMsg, key) - case "dpmServerName": - err = unpopulate(val, "DpmServerName", &d.DpmServerName) - delete(rawMsg, key) - case "duration": - err = unpopulate(val, "Duration", &d.Duration) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &d.EndTime) - delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &d.EntityFriendlyName) - delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &d.ErrorDetails) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &d.JobType) + err = unpopulate(val, "ContainerType", &b.ContainerType) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &d.Operation) + case "fabricName": + err = unpopulate(val, "FabricName", &b.FabricName) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &b.FriendlyName) delete(rawMsg, key) case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &d.WorkloadType) + err = unpopulate(val, "Status", &b.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DpmJobExtendedInfo. -func (d DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BMSContainersInquiryQueryObject. +func (b BMSContainersInquiryQueryObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "dynamicErrorMessage", d.DynamicErrorMessage) - populate(objectMap, "propertyBag", d.PropertyBag) - populate(objectMap, "tasksList", d.TasksList) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "workloadType", b.WorkloadType) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type DpmJobTaskDetails. -func (d DpmJobTaskDetails) MarshalJSON() ([]byte, error) { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSContainersInquiryQueryObject. +func (b *BMSContainersInquiryQueryObject) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &b.WorkloadType) + 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 BMSPOQueryObject. +func (b BMSPOQueryObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "duration", d.Duration) - populateTimeRFC3339(objectMap, "endTime", d.EndTime) - populateTimeRFC3339(objectMap, "startTime", d.StartTime) - populate(objectMap, "status", d.Status) - populate(objectMap, "taskId", d.TaskID) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "containerName", b.ContainerName) + populate(objectMap, "friendlyName", b.FriendlyName) + populate(objectMap, "status", b.Status) + populate(objectMap, "workloadType", b.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJobTaskDetails. -func (d *DpmJobTaskDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSPOQueryObject. +func (b *BMSPOQueryObject) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "duration": - err = unpopulate(val, "Duration", &d.Duration) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &d.EndTime) + case "containerName": + err = unpopulate(val, "ContainerName", &b.ContainerName) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &b.FriendlyName) delete(rawMsg, key) case "status": - err = unpopulate(val, "Status", &d.Status) + err = unpopulate(val, "Status", &b.Status) delete(rawMsg, key) - case "taskId": - err = unpopulate(val, "TaskID", &d.TaskID) + case "workloadType": + err = unpopulate(val, "WorkloadType", &b.WorkloadType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BMSRPQueryObject. +func (b BMSRPQueryObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "code", e.Code) - populate(objectMap, "message", e.Message) - populate(objectMap, "recommendations", e.Recommendations) + populateTimeRFC3339(objectMap, "endDate", b.EndDate) + populate(objectMap, "extendedInfo", b.ExtendedInfo) + populate(objectMap, "moveReadyRPOnly", b.MoveReadyRPOnly) + populate(objectMap, "restorePointQueryType", b.RestorePointQueryType) + populateTimeRFC3339(objectMap, "startDate", b.StartDate) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExportJobsOperationResultInfo. -func (e *ExportJobsOperationResultInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSRPQueryObject. +func (b *BMSRPQueryObject) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "blobSasKey": - err = unpopulate(val, "BlobSasKey", &e.BlobSasKey) + case "endDate": + err = unpopulateTimeRFC3339(val, "EndDate", &b.EndDate) delete(rawMsg, key) - case "blobUrl": - err = unpopulate(val, "BlobURL", &e.BlobURL) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &b.ExtendedInfo) delete(rawMsg, key) - case "excelFileBlobSasKey": - err = unpopulate(val, "ExcelFileBlobSasKey", &e.ExcelFileBlobSasKey) + case "moveReadyRPOnly": + err = unpopulate(val, "MoveReadyRPOnly", &b.MoveReadyRPOnly) delete(rawMsg, key) - case "excelFileBlobUrl": - err = unpopulate(val, "ExcelFileBlobURL", &e.ExcelFileBlobURL) + case "restorePointQueryType": + err = unpopulate(val, "RestorePointQueryType", &b.RestorePointQueryType) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &e.ObjectType) + case "startDate": + err = unpopulateTimeRFC3339(val, "StartDate", &b.StartDate) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenericContainer. -func (g GenericContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BMSRefreshContainersQueryObject. +func (b BMSRefreshContainersQueryObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", g.BackupManagementType) - objectMap["containerType"] = ContainerTypeGenericContainer - populate(objectMap, "extendedInformation", g.ExtendedInformation) - populate(objectMap, "fabricName", g.FabricName) - populate(objectMap, "friendlyName", g.FriendlyName) - populate(objectMap, "healthStatus", g.HealthStatus) - populate(objectMap, "protectableObjectType", g.ProtectableObjectType) - populate(objectMap, "registrationStatus", g.RegistrationStatus) + populate(objectMap, "backupManagementType", b.BackupManagementType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenericContainer. -func (g *GenericContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSRefreshContainersQueryObject. +func (b *BMSRefreshContainersQueryObject) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) - delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &g.ContainerType) - delete(rawMsg, key) - case "extendedInformation": - err = unpopulate(val, "ExtendedInformation", &g.ExtendedInformation) - delete(rawMsg, key) - case "fabricName": - err = unpopulate(val, "FabricName", &g.FabricName) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &g.FriendlyName) - delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &g.HealthStatus) - delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &g.ProtectableObjectType) - delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &g.RegistrationStatus) + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenericContainerExtendedInfo. -func (g GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BMSWorkloadItemQueryObject. +func (b BMSWorkloadItemQueryObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "containerIdentityInfo", g.ContainerIdentityInfo) - populate(objectMap, "rawCertData", g.RawCertData) - populate(objectMap, "serviceEndpoints", g.ServiceEndpoints) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "protectionStatus", b.ProtectionStatus) + populate(objectMap, "workloadItemType", b.WorkloadItemType) + populate(objectMap, "workloadType", b.WorkloadType) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type GenericProtectedItem. -func (g GenericProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", g.BackupManagementType) - populate(objectMap, "backupSetName", g.BackupSetName) - populate(objectMap, "containerName", g.ContainerName) - populate(objectMap, "createMode", g.CreateMode) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", g.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", g.DeferredDeleteTimeRemaining) - populate(objectMap, "fabricName", g.FabricName) - populate(objectMap, "friendlyName", g.FriendlyName) - populate(objectMap, "isArchiveEnabled", g.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", g.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", g.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", g.IsScheduledForDeferredDelete) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", g.LastRecoveryPoint) - populate(objectMap, "policyId", g.PolicyID) - populate(objectMap, "policyName", g.PolicyName) - populate(objectMap, "policyState", g.PolicyState) - populate(objectMap, "protectedItemId", g.ProtectedItemID) - objectMap["protectedItemType"] = "GenericProtectedItem" - populate(objectMap, "protectionState", g.ProtectionState) - populate(objectMap, "resourceGuardOperationRequests", g.ResourceGuardOperationRequests) - populate(objectMap, "sourceAssociations", g.SourceAssociations) - populate(objectMap, "sourceResourceId", g.SourceResourceID) - populate(objectMap, "workloadType", g.WorkloadType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GenericProtectedItem. -func (g *GenericProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSWorkloadItemQueryObject. +func (b *BMSWorkloadItemQueryObject) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) - delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &g.BackupSetName) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &g.ContainerName) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &g.CreateMode) - delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &g.DeferredDeleteTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &g.DeferredDeleteTimeRemaining) - delete(rawMsg, key) - case "fabricName": - err = unpopulate(val, "FabricName", &g.FabricName) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &g.FriendlyName) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &g.IsArchiveEnabled) - delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &g.IsDeferredDeleteScheduleUpcoming) - delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &g.IsRehydrate) - delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &g.IsScheduledForDeferredDelete) - delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &g.LastRecoveryPoint) - delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &g.PolicyID) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &g.PolicyName) - delete(rawMsg, key) - case "policyState": - err = unpopulate(val, "PolicyState", &g.PolicyState) - delete(rawMsg, key) - case "protectedItemId": - err = unpopulate(val, "ProtectedItemID", &g.ProtectedItemID) - delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &g.ProtectedItemType) - delete(rawMsg, key) - case "protectionState": - err = unpopulate(val, "ProtectionState", &g.ProtectionState) - delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &g.ResourceGuardOperationRequests) + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) - case "sourceAssociations": - err = unpopulate(val, "SourceAssociations", &g.SourceAssociations) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &b.ProtectionStatus) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &g.SourceResourceID) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &b.WorkloadItemType) delete(rawMsg, key) case "workloadType": - err = unpopulate(val, "WorkloadType", &g.WorkloadType) + err = unpopulate(val, "WorkloadType", &b.WorkloadType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenericProtectionPolicy. -func (g GenericProtectionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupEngineBase. +func (b BackupEngineBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["backupManagementType"] = "GenericProtectionPolicy" - populate(objectMap, "fabricName", g.FabricName) - populate(objectMap, "protectedItemsCount", g.ProtectedItemsCount) - populate(objectMap, "resourceGuardOperationRequests", g.ResourceGuardOperationRequests) - populate(objectMap, "subProtectionPolicy", g.SubProtectionPolicy) - populate(objectMap, "timeZone", g.TimeZone) + populate(objectMap, "azureBackupAgentVersion", b.AzureBackupAgentVersion) + populate(objectMap, "backupEngineId", b.BackupEngineID) + populate(objectMap, "backupEngineState", b.BackupEngineState) + objectMap["backupEngineType"] = b.BackupEngineType + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "canReRegister", b.CanReRegister) + populate(objectMap, "dpmVersion", b.DpmVersion) + populate(objectMap, "extendedInfo", b.ExtendedInfo) + populate(objectMap, "friendlyName", b.FriendlyName) + populate(objectMap, "healthStatus", b.HealthStatus) + populate(objectMap, "isAzureBackupAgentUpgradeAvailable", b.IsAzureBackupAgentUpgradeAvailable) + populate(objectMap, "isDpmUpgradeAvailable", b.IsDpmUpgradeAvailable) + populate(objectMap, "registrationStatus", b.RegistrationStatus) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenericProtectionPolicy. -func (g *GenericProtectionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineBase. +func (b *BackupEngineBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { + case "azureBackupAgentVersion": + err = unpopulate(val, "AzureBackupAgentVersion", &b.AzureBackupAgentVersion) + delete(rawMsg, key) + case "backupEngineId": + err = unpopulate(val, "BackupEngineID", &b.BackupEngineID) + delete(rawMsg, key) + case "backupEngineState": + err = unpopulate(val, "BackupEngineState", &b.BackupEngineState) + delete(rawMsg, key) + case "backupEngineType": + err = unpopulate(val, "BackupEngineType", &b.BackupEngineType) + delete(rawMsg, key) case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) - case "fabricName": - err = unpopulate(val, "FabricName", &g.FabricName) + case "canReRegister": + err = unpopulate(val, "CanReRegister", &b.CanReRegister) delete(rawMsg, key) - case "protectedItemsCount": - err = unpopulate(val, "ProtectedItemsCount", &g.ProtectedItemsCount) + case "dpmVersion": + err = unpopulate(val, "DpmVersion", &b.DpmVersion) delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &g.ResourceGuardOperationRequests) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &b.ExtendedInfo) delete(rawMsg, key) - case "subProtectionPolicy": - err = unpopulate(val, "SubProtectionPolicy", &g.SubProtectionPolicy) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &b.FriendlyName) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &g.TimeZone) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &b.HealthStatus) + delete(rawMsg, key) + case "isAzureBackupAgentUpgradeAvailable": + err = unpopulate(val, "IsAzureBackupAgentUpgradeAvailable", &b.IsAzureBackupAgentUpgradeAvailable) + delete(rawMsg, key) + case "isDpmUpgradeAvailable": + err = unpopulate(val, "IsDpmUpgradeAvailable", &b.IsDpmUpgradeAvailable) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &b.RegistrationStatus) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenericRecoveryPoint. -func (g GenericRecoveryPoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupEngineBaseResource. +func (b BackupEngineBaseResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "friendlyName", g.FriendlyName) - objectMap["objectType"] = "GenericRecoveryPoint" - populate(objectMap, "recoveryPointAdditionalInfo", g.RecoveryPointAdditionalInfo) - populateTimeRFC3339(objectMap, "recoveryPointTime", g.RecoveryPointTime) - populate(objectMap, "recoveryPointType", g.RecoveryPointType) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenericRecoveryPoint. -func (g *GenericRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineBaseResource. +func (b *BackupEngineBaseResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "friendlyName": - err = unpopulate(val, "FriendlyName", &g.FriendlyName) + case "eTag": + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &g.ObjectType) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "recoveryPointAdditionalInfo": - err = unpopulate(val, "RecoveryPointAdditionalInfo", &g.RecoveryPointAdditionalInfo) + case "location": + err = unpopulate(val, "Location", &b.Location) delete(rawMsg, key) - case "recoveryPointTime": - err = unpopulateTimeRFC3339(val, "RecoveryPointTime", &g.RecoveryPointTime) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "recoveryPointType": - err = unpopulate(val, "RecoveryPointType", &g.RecoveryPointType) + case "properties": + b.Properties, err = unmarshalBackupEngineBaseClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HourlySchedule. -func (h HourlySchedule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupEngineBaseResourceList. +func (b BackupEngineBaseResourceList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "interval", h.Interval) - populate(objectMap, "scheduleWindowDuration", h.ScheduleWindowDuration) - populateTimeRFC3339(objectMap, "scheduleWindowStartTime", h.ScheduleWindowStartTime) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HourlySchedule. -func (h *HourlySchedule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineBaseResourceList. +func (b *BackupEngineBaseResourceList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "interval": - err = unpopulate(val, "Interval", &h.Interval) - delete(rawMsg, key) - case "scheduleWindowDuration": - err = unpopulate(val, "ScheduleWindowDuration", &h.ScheduleWindowDuration) + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) delete(rawMsg, key) - case "scheduleWindowStartTime": - err = unpopulateTimeRFC3339(val, "ScheduleWindowStartTime", &h.ScheduleWindowStartTime) + case "value": + err = unpopulate(val, "Value", &b.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ILRRequestResource. -func (i ILRRequestResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupEngineExtendedInfo. +func (b BackupEngineExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", i.ETag) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) + populate(objectMap, "availableDiskSpace", b.AvailableDiskSpace) + populate(objectMap, "azureProtectedInstances", b.AzureProtectedInstances) + populate(objectMap, "databaseName", b.DatabaseName) + populate(objectMap, "diskCount", b.DiskCount) + populate(objectMap, "protectedItemsCount", b.ProtectedItemsCount) + populate(objectMap, "protectedServersCount", b.ProtectedServersCount) + populateTimeRFC3339(objectMap, "refreshedAt", b.RefreshedAt) + populate(objectMap, "usedDiskSpace", b.UsedDiskSpace) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ILRRequestResource. -func (i *ILRRequestResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineExtendedInfo. +func (b *BackupEngineExtendedInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &i.ETag) + case "availableDiskSpace": + err = unpopulate(val, "AvailableDiskSpace", &b.AvailableDiskSpace) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &i.ID) + case "azureProtectedInstances": + err = unpopulate(val, "AzureProtectedInstances", &b.AzureProtectedInstances) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &i.Location) + case "databaseName": + err = unpopulate(val, "DatabaseName", &b.DatabaseName) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) + case "diskCount": + err = unpopulate(val, "DiskCount", &b.DiskCount) delete(rawMsg, key) - case "properties": - i.Properties, err = unmarshalILRRequestClassification(val) + case "protectedItemsCount": + err = unpopulate(val, "ProtectedItemsCount", &b.ProtectedItemsCount) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &i.Tags) + case "protectedServersCount": + err = unpopulate(val, "ProtectedServersCount", &b.ProtectedServersCount) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "refreshedAt": + err = unpopulateTimeRFC3339(val, "RefreshedAt", &b.RefreshedAt) + delete(rawMsg, key) + case "usedDiskSpace": + err = unpopulate(val, "UsedDiskSpace", &b.UsedDiskSpace) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaaSVMContainer. -func (i IaaSVMContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupManagementUsage. +func (b BackupManagementUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", i.BackupManagementType) - objectMap["containerType"] = ContainerTypeIaasVMContainer - populate(objectMap, "friendlyName", i.FriendlyName) - populate(objectMap, "healthStatus", i.HealthStatus) - populate(objectMap, "protectableObjectType", i.ProtectableObjectType) - populate(objectMap, "registrationStatus", i.RegistrationStatus) - populate(objectMap, "resourceGroup", i.ResourceGroup) - populate(objectMap, "virtualMachineId", i.VirtualMachineID) - populate(objectMap, "virtualMachineVersion", i.VirtualMachineVersion) + populate(objectMap, "currentValue", b.CurrentValue) + populate(objectMap, "limit", b.Limit) + populate(objectMap, "name", b.Name) + populateTimeRFC3339(objectMap, "nextResetTime", b.NextResetTime) + populate(objectMap, "quotaPeriod", b.QuotaPeriod) + populate(objectMap, "unit", b.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaaSVMContainer. -func (i *IaaSVMContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupManagementUsage. +func (b *BackupManagementUsage) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &i.BackupManagementType) - delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &i.ContainerType) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &i.FriendlyName) - delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &i.HealthStatus) + case "currentValue": + err = unpopulate(val, "CurrentValue", &b.CurrentValue) delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &i.ProtectableObjectType) + case "limit": + err = unpopulate(val, "Limit", &b.Limit) delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &i.RegistrationStatus) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "resourceGroup": - err = unpopulate(val, "ResourceGroup", &i.ResourceGroup) + case "nextResetTime": + err = unpopulateTimeRFC3339(val, "NextResetTime", &b.NextResetTime) delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + case "quotaPeriod": + err = unpopulate(val, "QuotaPeriod", &b.QuotaPeriod) delete(rawMsg, key) - case "virtualMachineVersion": - err = unpopulate(val, "VirtualMachineVersion", &i.VirtualMachineVersion) + case "unit": + err = unpopulate(val, "Unit", &b.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaaSVMProtectableItem. -func (i IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupManagementUsageList. +func (b BackupManagementUsageList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", i.BackupManagementType) - populate(objectMap, "friendlyName", i.FriendlyName) - objectMap["protectableItemType"] = "IaaSVMProtectableItem" - populate(objectMap, "protectionState", i.ProtectionState) - populate(objectMap, "resourceGroup", i.ResourceGroup) - populate(objectMap, "virtualMachineId", i.VirtualMachineID) - populate(objectMap, "virtualMachineVersion", i.VirtualMachineVersion) - populate(objectMap, "workloadType", i.WorkloadType) + populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaaSVMProtectableItem. -func (i *IaaSVMProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupManagementUsageList. +func (b *BackupManagementUsageList) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &i.BackupManagementType) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &i.FriendlyName) - delete(rawMsg, key) - case "protectableItemType": - err = unpopulate(val, "ProtectableItemType", &i.ProtectableItemType) - delete(rawMsg, key) - case "protectionState": - err = unpopulate(val, "ProtectionState", &i.ProtectionState) - delete(rawMsg, key) - case "resourceGroup": - err = unpopulate(val, "ResourceGroup", &i.ResourceGroup) - delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) - delete(rawMsg, key) - case "virtualMachineVersion": - err = unpopulate(val, "VirtualMachineVersion", &i.VirtualMachineVersion) - delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &i.WorkloadType) + case "value": + err = unpopulate(val, "Value", &b.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMBackupRequest. -func (i IaasVMBackupRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupRequest. +func (b BackupRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "IaasVMBackupRequest" - populateTimeRFC3339(objectMap, "recoveryPointExpiryTimeInUTC", i.RecoveryPointExpiryTimeInUTC) + objectMap["objectType"] = b.ObjectType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMBackupRequest. -func (i *IaasVMBackupRequest) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) - delete(rawMsg, key) - case "recoveryPointExpiryTimeInUTC": - err = unpopulateTimeRFC3339(val, "RecoveryPointExpiryTimeInUTC", &i.RecoveryPointExpiryTimeInUTC) + err = unpopulate(val, "ObjectType", &b.ObjectType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMILRRegistrationRequest. -func (i IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupRequestResource. +func (b BackupRequestResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "initiatorName", i.InitiatorName) - objectMap["objectType"] = "IaasVMILRRegistrationRequest" - populate(objectMap, "recoveryPointId", i.RecoveryPointID) - populate(objectMap, "renewExistingRegistration", i.RenewExistingRegistration) - populate(objectMap, "virtualMachineId", i.VirtualMachineID) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMILRRegistrationRequest. -func (i *IaasVMILRRegistrationRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupRequestResource. +func (b *BackupRequestResource) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "initiatorName": - err = unpopulate(val, "InitiatorName", &i.InitiatorName) + case "eTag": + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "recoveryPointId": - err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) + case "location": + err = unpopulate(val, "Location", &b.Location) delete(rawMsg, key) - case "renewExistingRegistration": - err = unpopulate(val, "RenewExistingRegistration", &i.RenewExistingRegistration) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + case "properties": + b.Properties, err = unmarshalBackupRequestClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMRecoveryPoint. -func (i IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupResourceConfig. +func (b BackupResourceConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "isInstantIlrSessionActive", i.IsInstantIlrSessionActive) - populate(objectMap, "isManagedVirtualMachine", i.IsManagedVirtualMachine) - populate(objectMap, "isSourceVMEncrypted", i.IsSourceVMEncrypted) - populate(objectMap, "keyAndSecret", i.KeyAndSecret) - populate(objectMap, "osType", i.OSType) - objectMap["objectType"] = "IaasVMRecoveryPoint" - populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) - populate(objectMap, "recoveryPointAdditionalInfo", i.RecoveryPointAdditionalInfo) - populate(objectMap, "recoveryPointDiskConfiguration", i.RecoveryPointDiskConfiguration) - populate(objectMap, "recoveryPointMoveReadinessInfo", i.RecoveryPointMoveReadinessInfo) - populate(objectMap, "recoveryPointTierDetails", i.RecoveryPointTierDetails) - populateTimeRFC3339(objectMap, "recoveryPointTime", i.RecoveryPointTime) - populate(objectMap, "recoveryPointType", i.RecoveryPointType) - populate(objectMap, "sourceVMStorageType", i.SourceVMStorageType) - populate(objectMap, "virtualMachineSize", i.VirtualMachineSize) - populate(objectMap, "zones", i.Zones) + populate(objectMap, "crossRegionRestoreFlag", b.CrossRegionRestoreFlag) + populate(objectMap, "dedupState", b.DedupState) + populate(objectMap, "storageModelType", b.StorageModelType) + populate(objectMap, "storageType", b.StorageType) + populate(objectMap, "storageTypeState", b.StorageTypeState) + populate(objectMap, "xcoolState", b.XcoolState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRecoveryPoint. -func (i *IaasVMRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceConfig. +func (b *BackupResourceConfig) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "isInstantIlrSessionActive": - err = unpopulate(val, "IsInstantIlrSessionActive", &i.IsInstantIlrSessionActive) - delete(rawMsg, key) - case "isManagedVirtualMachine": - err = unpopulate(val, "IsManagedVirtualMachine", &i.IsManagedVirtualMachine) - delete(rawMsg, key) - case "isSourceVMEncrypted": - err = unpopulate(val, "IsSourceVMEncrypted", &i.IsSourceVMEncrypted) - delete(rawMsg, key) - case "keyAndSecret": - err = unpopulate(val, "KeyAndSecret", &i.KeyAndSecret) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &i.OSType) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) - delete(rawMsg, key) - case "originalStorageAccountOption": - err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) + case "crossRegionRestoreFlag": + err = unpopulate(val, "CrossRegionRestoreFlag", &b.CrossRegionRestoreFlag) delete(rawMsg, key) - case "recoveryPointAdditionalInfo": - err = unpopulate(val, "RecoveryPointAdditionalInfo", &i.RecoveryPointAdditionalInfo) - delete(rawMsg, key) - case "recoveryPointDiskConfiguration": - err = unpopulate(val, "RecoveryPointDiskConfiguration", &i.RecoveryPointDiskConfiguration) - delete(rawMsg, key) - case "recoveryPointMoveReadinessInfo": - err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &i.RecoveryPointMoveReadinessInfo) + case "dedupState": + err = unpopulate(val, "DedupState", &b.DedupState) delete(rawMsg, key) - case "recoveryPointTierDetails": - err = unpopulate(val, "RecoveryPointTierDetails", &i.RecoveryPointTierDetails) - delete(rawMsg, key) - case "recoveryPointTime": - err = unpopulateTimeRFC3339(val, "RecoveryPointTime", &i.RecoveryPointTime) - delete(rawMsg, key) - case "recoveryPointType": - err = unpopulate(val, "RecoveryPointType", &i.RecoveryPointType) + case "storageModelType": + err = unpopulate(val, "StorageModelType", &b.StorageModelType) delete(rawMsg, key) - case "sourceVMStorageType": - err = unpopulate(val, "SourceVMStorageType", &i.SourceVMStorageType) + case "storageType": + err = unpopulate(val, "StorageType", &b.StorageType) delete(rawMsg, key) - case "virtualMachineSize": - err = unpopulate(val, "VirtualMachineSize", &i.VirtualMachineSize) + case "storageTypeState": + err = unpopulate(val, "StorageTypeState", &b.StorageTypeState) delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &i.Zones) + case "xcoolState": + err = unpopulate(val, "XcoolState", &b.XcoolState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMRestoreRequest. -func (i IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupResourceConfigResource. +func (b BackupResourceConfigResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "affinityGroup", i.AffinityGroup) - populate(objectMap, "createNewCloudService", i.CreateNewCloudService) - populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) - populate(objectMap, "encryptionDetails", i.EncryptionDetails) - populate(objectMap, "identityBasedRestoreDetails", i.IdentityBasedRestoreDetails) - populate(objectMap, "identityInfo", i.IdentityInfo) - objectMap["objectType"] = "IaasVMRestoreRequest" - populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) - populate(objectMap, "recoveryPointId", i.RecoveryPointID) - populate(objectMap, "recoveryType", i.RecoveryType) - populate(objectMap, "region", i.Region) - populate(objectMap, "restoreDiskLunList", i.RestoreDiskLunList) - populate(objectMap, "restoreWithManagedDisks", i.RestoreWithManagedDisks) - populate(objectMap, "sourceResourceId", i.SourceResourceID) - populate(objectMap, "storageAccountId", i.StorageAccountID) - populate(objectMap, "subnetId", i.SubnetID) - populate(objectMap, "targetDomainNameId", i.TargetDomainNameID) - populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) - populate(objectMap, "targetVirtualMachineId", i.TargetVirtualMachineID) - populate(objectMap, "virtualNetworkId", i.VirtualNetworkID) - populate(objectMap, "zones", i.Zones) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRestoreRequest. -func (i *IaasVMRestoreRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceConfigResource. +func (b *BackupResourceConfigResource) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "affinityGroup": - err = unpopulate(val, "AffinityGroup", &i.AffinityGroup) - delete(rawMsg, key) - case "createNewCloudService": - err = unpopulate(val, "CreateNewCloudService", &i.CreateNewCloudService) - delete(rawMsg, key) - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &i.DiskEncryptionSetID) - delete(rawMsg, key) - case "encryptionDetails": - err = unpopulate(val, "EncryptionDetails", &i.EncryptionDetails) - delete(rawMsg, key) - case "identityBasedRestoreDetails": - err = unpopulate(val, "IdentityBasedRestoreDetails", &i.IdentityBasedRestoreDetails) - delete(rawMsg, key) - case "identityInfo": - err = unpopulate(val, "IdentityInfo", &i.IdentityInfo) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) - delete(rawMsg, key) - case "originalStorageAccountOption": - err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) - delete(rawMsg, key) - case "recoveryPointId": - err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) - delete(rawMsg, key) - case "recoveryType": - err = unpopulate(val, "RecoveryType", &i.RecoveryType) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &i.Region) - delete(rawMsg, key) - case "restoreDiskLunList": - err = unpopulate(val, "RestoreDiskLunList", &i.RestoreDiskLunList) - delete(rawMsg, key) - case "restoreWithManagedDisks": - err = unpopulate(val, "RestoreWithManagedDisks", &i.RestoreWithManagedDisks) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &i.SourceResourceID) - delete(rawMsg, key) - case "storageAccountId": - err = unpopulate(val, "StorageAccountID", &i.StorageAccountID) + case "eTag": + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &i.SubnetID) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "targetDomainNameId": - err = unpopulate(val, "TargetDomainNameID", &i.TargetDomainNameID) + case "location": + err = unpopulate(val, "Location", &b.Location) delete(rawMsg, key) - case "targetResourceGroupId": - err = unpopulate(val, "TargetResourceGroupID", &i.TargetResourceGroupID) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "targetVirtualMachineId": - err = unpopulate(val, "TargetVirtualMachineID", &i.TargetVirtualMachineID) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) delete(rawMsg, key) - case "virtualNetworkId": - err = unpopulate(val, "VirtualNetworkID", &i.VirtualNetworkID) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &i.Zones) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMRestoreWithRehydrationRequest. -func (i IaasVMRestoreWithRehydrationRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfig. +func (b BackupResourceEncryptionConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "affinityGroup", i.AffinityGroup) - populate(objectMap, "createNewCloudService", i.CreateNewCloudService) - populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) - populate(objectMap, "encryptionDetails", i.EncryptionDetails) - populate(objectMap, "identityBasedRestoreDetails", i.IdentityBasedRestoreDetails) - populate(objectMap, "identityInfo", i.IdentityInfo) - objectMap["objectType"] = "IaasVMRestoreWithRehydrationRequest" - populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) - populate(objectMap, "recoveryPointId", i.RecoveryPointID) - populate(objectMap, "recoveryPointRehydrationInfo", i.RecoveryPointRehydrationInfo) - populate(objectMap, "recoveryType", i.RecoveryType) - populate(objectMap, "region", i.Region) - populate(objectMap, "restoreDiskLunList", i.RestoreDiskLunList) - populate(objectMap, "restoreWithManagedDisks", i.RestoreWithManagedDisks) - populate(objectMap, "sourceResourceId", i.SourceResourceID) - populate(objectMap, "storageAccountId", i.StorageAccountID) - populate(objectMap, "subnetId", i.SubnetID) - populate(objectMap, "targetDomainNameId", i.TargetDomainNameID) - populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) - populate(objectMap, "targetVirtualMachineId", i.TargetVirtualMachineID) - populate(objectMap, "virtualNetworkId", i.VirtualNetworkID) - populate(objectMap, "zones", i.Zones) + populate(objectMap, "encryptionAtRestType", b.EncryptionAtRestType) + populate(objectMap, "infrastructureEncryptionState", b.InfrastructureEncryptionState) + populate(objectMap, "keyUri", b.KeyURI) + populate(objectMap, "lastUpdateStatus", b.LastUpdateStatus) + populate(objectMap, "subscriptionId", b.SubscriptionID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRestoreWithRehydrationRequest. -func (i *IaasVMRestoreWithRehydrationRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceEncryptionConfig. +func (b *BackupResourceEncryptionConfig) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "affinityGroup": - err = unpopulate(val, "AffinityGroup", &i.AffinityGroup) - delete(rawMsg, key) - case "createNewCloudService": - err = unpopulate(val, "CreateNewCloudService", &i.CreateNewCloudService) - delete(rawMsg, key) - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &i.DiskEncryptionSetID) - delete(rawMsg, key) - case "encryptionDetails": - err = unpopulate(val, "EncryptionDetails", &i.EncryptionDetails) - delete(rawMsg, key) - case "identityBasedRestoreDetails": - err = unpopulate(val, "IdentityBasedRestoreDetails", &i.IdentityBasedRestoreDetails) - delete(rawMsg, key) - case "identityInfo": - err = unpopulate(val, "IdentityInfo", &i.IdentityInfo) + case "encryptionAtRestType": + err = unpopulate(val, "EncryptionAtRestType", &b.EncryptionAtRestType) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) - delete(rawMsg, key) - case "originalStorageAccountOption": - err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) - delete(rawMsg, key) - case "recoveryPointId": - err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) - delete(rawMsg, key) - case "recoveryPointRehydrationInfo": - err = unpopulate(val, "RecoveryPointRehydrationInfo", &i.RecoveryPointRehydrationInfo) - delete(rawMsg, key) - case "recoveryType": - err = unpopulate(val, "RecoveryType", &i.RecoveryType) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &i.Region) + case "infrastructureEncryptionState": + err = unpopulate(val, "InfrastructureEncryptionState", &b.InfrastructureEncryptionState) delete(rawMsg, key) - case "restoreDiskLunList": - err = unpopulate(val, "RestoreDiskLunList", &i.RestoreDiskLunList) + case "keyUri": + err = unpopulate(val, "KeyURI", &b.KeyURI) delete(rawMsg, key) - case "restoreWithManagedDisks": - err = unpopulate(val, "RestoreWithManagedDisks", &i.RestoreWithManagedDisks) + case "lastUpdateStatus": + err = unpopulate(val, "LastUpdateStatus", &b.LastUpdateStatus) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &i.SourceResourceID) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &b.SubscriptionID) delete(rawMsg, key) - case "storageAccountId": - err = unpopulate(val, "StorageAccountID", &i.StorageAccountID) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigExtended. +func (b BackupResourceEncryptionConfigExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "encryptionAtRestType", b.EncryptionAtRestType) + populate(objectMap, "infrastructureEncryptionState", b.InfrastructureEncryptionState) + populate(objectMap, "keyUri", b.KeyURI) + populate(objectMap, "lastUpdateStatus", b.LastUpdateStatus) + populate(objectMap, "subscriptionId", b.SubscriptionID) + populate(objectMap, "useSystemAssignedIdentity", b.UseSystemAssignedIdentity) + populate(objectMap, "userAssignedIdentity", b.UserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceEncryptionConfigExtended. +func (b *BackupResourceEncryptionConfigExtended) UnmarshalJSON(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 "encryptionAtRestType": + err = unpopulate(val, "EncryptionAtRestType", &b.EncryptionAtRestType) delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &i.SubnetID) + case "infrastructureEncryptionState": + err = unpopulate(val, "InfrastructureEncryptionState", &b.InfrastructureEncryptionState) delete(rawMsg, key) - case "targetDomainNameId": - err = unpopulate(val, "TargetDomainNameID", &i.TargetDomainNameID) + case "keyUri": + err = unpopulate(val, "KeyURI", &b.KeyURI) delete(rawMsg, key) - case "targetResourceGroupId": - err = unpopulate(val, "TargetResourceGroupID", &i.TargetResourceGroupID) + case "lastUpdateStatus": + err = unpopulate(val, "LastUpdateStatus", &b.LastUpdateStatus) delete(rawMsg, key) - case "targetVirtualMachineId": - err = unpopulate(val, "TargetVirtualMachineID", &i.TargetVirtualMachineID) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &b.SubscriptionID) delete(rawMsg, key) - case "virtualNetworkId": - err = unpopulate(val, "VirtualNetworkID", &i.VirtualNetworkID) + case "useSystemAssignedIdentity": + err = unpopulate(val, "UseSystemAssignedIdentity", &b.UseSystemAssignedIdentity) delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &i.Zones) + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &b.UserAssignedIdentity) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InquiryInfo. -func (i InquiryInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorDetail", i.ErrorDetail) - populate(objectMap, "inquiryDetails", i.InquiryDetails) - populate(objectMap, "status", i.Status) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Job. -func (j Job) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigExtendedResource. +func (b BackupResourceEncryptionConfigExtendedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "activityId", j.ActivityID) - populate(objectMap, "backupManagementType", j.BackupManagementType) - populateTimeRFC3339(objectMap, "endTime", j.EndTime) - populate(objectMap, "entityFriendlyName", j.EntityFriendlyName) - objectMap["jobType"] = j.JobType - populate(objectMap, "operation", j.Operation) - populateTimeRFC3339(objectMap, "startTime", j.StartTime) - populate(objectMap, "status", j.Status) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Job. -func (j *Job) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceEncryptionConfigExtendedResource. +func (b *BackupResourceEncryptionConfigExtendedResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "activityId": - err = unpopulate(val, "ActivityID", &j.ActivityID) - delete(rawMsg, key) - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &j.BackupManagementType) + case "eTag": + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &j.EntityFriendlyName) + case "location": + err = unpopulate(val, "Location", &b.Location) delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &j.JobType) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &j.Operation) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigResource. +func (b BackupResourceEncryptionConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceEncryptionConfigResource. +func (b *BackupResourceEncryptionConfigResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &b.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &b.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupResourceVaultConfig. +func (b BackupResourceVaultConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enhancedSecurityState", b.EnhancedSecurityState) + populate(objectMap, "isSoftDeleteFeatureStateEditable", b.IsSoftDeleteFeatureStateEditable) + populate(objectMap, "resourceGuardOperationRequests", b.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteFeatureState", b.SoftDeleteFeatureState) + populate(objectMap, "storageModelType", b.StorageModelType) + populate(objectMap, "storageType", b.StorageType) + populate(objectMap, "storageTypeState", b.StorageTypeState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceVaultConfig. +func (b *BackupResourceVaultConfig) UnmarshalJSON(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 "enhancedSecurityState": + err = unpopulate(val, "EnhancedSecurityState", &b.EnhancedSecurityState) + delete(rawMsg, key) + case "isSoftDeleteFeatureStateEditable": + err = unpopulate(val, "IsSoftDeleteFeatureStateEditable", &b.IsSoftDeleteFeatureStateEditable) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &b.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "softDeleteFeatureState": + err = unpopulate(val, "SoftDeleteFeatureState", &b.SoftDeleteFeatureState) + delete(rawMsg, key) + case "storageModelType": + err = unpopulate(val, "StorageModelType", &b.StorageModelType) + delete(rawMsg, key) + case "storageType": + err = unpopulate(val, "StorageType", &b.StorageType) + delete(rawMsg, key) + case "storageTypeState": + err = unpopulate(val, "StorageTypeState", &b.StorageTypeState) + 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 BackupResourceVaultConfigResource. +func (b BackupResourceVaultConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceVaultConfigResource. +func (b *BackupResourceVaultConfigResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &b.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &b.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupStatusRequest. +func (b BackupStatusRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "poLogicalName", b.PoLogicalName) + populate(objectMap, "resourceId", b.ResourceID) + populate(objectMap, "resourceType", b.ResourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupStatusRequest. +func (b *BackupStatusRequest) UnmarshalJSON(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 "poLogicalName": + err = unpopulate(val, "PoLogicalName", &b.PoLogicalName) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &b.ResourceType) + 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 BackupStatusResponse. +func (b BackupStatusResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "containerName", b.ContainerName) + populate(objectMap, "errorCode", b.ErrorCode) + populate(objectMap, "errorMessage", b.ErrorMessage) + populate(objectMap, "fabricName", b.FabricName) + populate(objectMap, "policyName", b.PolicyName) + populate(objectMap, "protectedItemName", b.ProtectedItemName) + populate(objectMap, "protectionStatus", b.ProtectionStatus) + populate(objectMap, "registrationStatus", b.RegistrationStatus) + populate(objectMap, "vaultId", b.VaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupStatusResponse. +func (b *BackupStatusResponse) UnmarshalJSON(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 "containerName": + err = unpopulate(val, "ContainerName", &b.ContainerName) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &b.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &b.ErrorMessage) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &b.FabricName) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &b.PolicyName) + delete(rawMsg, key) + case "protectedItemName": + err = unpopulate(val, "ProtectedItemName", &b.ProtectedItemName) + delete(rawMsg, key) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &b.ProtectionStatus) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &b.RegistrationStatus) + delete(rawMsg, key) + case "vaultId": + err = unpopulate(val, "VaultID", &b.VaultID) + 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 ClientDiscoveryDisplay. +func (c ClientDiscoveryDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", c.Description) + populate(objectMap, "operation", c.Operation) + populate(objectMap, "provider", c.Provider) + populate(objectMap, "resource", c.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryDisplay. +func (c *ClientDiscoveryDisplay) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &c.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &c.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &c.Resource) + 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 ClientDiscoveryForLogSpecification. +func (c ClientDiscoveryForLogSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobDuration", c.BlobDuration) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryForLogSpecification. +func (c *ClientDiscoveryForLogSpecification) UnmarshalJSON(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 "blobDuration": + err = unpopulate(val, "BlobDuration", &c.BlobDuration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + 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 ClientDiscoveryForProperties. +func (c ClientDiscoveryForProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "serviceSpecification", c.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryForProperties. +func (c *ClientDiscoveryForProperties) UnmarshalJSON(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 "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &c.ServiceSpecification) + 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 ClientDiscoveryForServiceSpecification. +func (c ClientDiscoveryForServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logSpecifications", c.LogSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryForServiceSpecification. +func (c *ClientDiscoveryForServiceSpecification) UnmarshalJSON(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 "logSpecifications": + err = unpopulate(val, "LogSpecifications", &c.LogSpecifications) + 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 ClientDiscoveryResponse. +func (c ClientDiscoveryResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryResponse. +func (c *ClientDiscoveryResponse) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, 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 ClientDiscoveryValueForSingleAPI. +func (c ClientDiscoveryValueForSingleAPI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", c.Display) + populate(objectMap, "name", c.Name) + populate(objectMap, "origin", c.Origin) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryValueForSingleAPI. +func (c *ClientDiscoveryValueForSingleAPI) UnmarshalJSON(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 "display": + err = unpopulate(val, "Display", &c.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &c.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + 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 ClientScriptForConnect. +func (c ClientScriptForConnect) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "osType", c.OSType) + populate(objectMap, "scriptContent", c.ScriptContent) + populate(objectMap, "scriptExtension", c.ScriptExtension) + populate(objectMap, "scriptNameSuffix", c.ScriptNameSuffix) + populate(objectMap, "url", c.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientScriptForConnect. +func (c *ClientScriptForConnect) UnmarshalJSON(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 "osType": + err = unpopulate(val, "OSType", &c.OSType) + delete(rawMsg, key) + case "scriptContent": + err = unpopulate(val, "ScriptContent", &c.ScriptContent) + delete(rawMsg, key) + case "scriptExtension": + err = unpopulate(val, "ScriptExtension", &c.ScriptExtension) + delete(rawMsg, key) + case "scriptNameSuffix": + err = unpopulate(val, "ScriptNameSuffix", &c.ScriptNameSuffix) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &c.URL) + 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 ContainerIdentityInfo. +func (c ContainerIdentityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadTenantId", c.AADTenantID) + populate(objectMap, "audience", c.Audience) + populate(objectMap, "servicePrincipalClientId", c.ServicePrincipalClientID) + populate(objectMap, "uniqueName", c.UniqueName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerIdentityInfo. +func (c *ContainerIdentityInfo) UnmarshalJSON(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 "aadTenantId": + err = unpopulate(val, "AADTenantID", &c.AADTenantID) + delete(rawMsg, key) + case "audience": + err = unpopulate(val, "Audience", &c.Audience) + delete(rawMsg, key) + case "servicePrincipalClientId": + err = unpopulate(val, "ServicePrincipalClientID", &c.ServicePrincipalClientID) + delete(rawMsg, key) + case "uniqueName": + err = unpopulate(val, "UniqueName", &c.UniqueName) + 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 DPMContainerExtendedInfo. +func (d DPMContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "lastRefreshedAt", d.LastRefreshedAt) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DPMContainerExtendedInfo. +func (d *DPMContainerExtendedInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastRefreshedAt": + err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &d.LastRefreshedAt) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DPMProtectedItem. +func (d DPMProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupEngineName", d.BackupEngineName) + populate(objectMap, "backupManagementType", d.BackupManagementType) + populate(objectMap, "backupSetName", d.BackupSetName) + populate(objectMap, "containerName", d.ContainerName) + populate(objectMap, "createMode", d.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", d.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", d.DeferredDeleteTimeRemaining) + populate(objectMap, "extendedInfo", d.ExtendedInfo) + populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "isArchiveEnabled", d.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", d.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", d.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", d.IsScheduledForDeferredDelete) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", d.LastRecoveryPoint) + populate(objectMap, "policyId", d.PolicyID) + populate(objectMap, "policyName", d.PolicyName) + objectMap["protectedItemType"] = "DPMProtectedItem" + populate(objectMap, "protectionState", d.ProtectionState) + populate(objectMap, "resourceGuardOperationRequests", d.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", d.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", d.SourceResourceID) + populate(objectMap, "workloadType", d.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DPMProtectedItem. +func (d *DPMProtectedItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupEngineName": + err = unpopulate(val, "BackupEngineName", &d.BackupEngineName) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + delete(rawMsg, key) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &d.BackupSetName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &d.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &d.CreateMode) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &d.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &d.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + delete(rawMsg, key) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &d.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &d.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &d.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &d.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &d.LastRecoveryPoint) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &d.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &d.PolicyName) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &d.ProtectedItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &d.ProtectionState) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &d.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &d.SoftDeleteRetentionPeriod) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &d.WorkloadType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DPMProtectedItemExtendedInfo. +func (d DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diskStorageUsedInBytes", d.DiskStorageUsedInBytes) + populate(objectMap, "isCollocated", d.IsCollocated) + populate(objectMap, "isPresentOnCloud", d.IsPresentOnCloud) + populate(objectMap, "lastBackupStatus", d.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastRefreshedAt", d.LastRefreshedAt) + populateTimeRFC3339(objectMap, "oldestRecoveryPoint", d.OldestRecoveryPoint) + populateTimeRFC3339(objectMap, "onPremiseLatestRecoveryPoint", d.OnPremiseLatestRecoveryPoint) + populateTimeRFC3339(objectMap, "onPremiseOldestRecoveryPoint", d.OnPremiseOldestRecoveryPoint) + populate(objectMap, "onPremiseRecoveryPointCount", d.OnPremiseRecoveryPointCount) + populate(objectMap, "protectableObjectLoadPath", d.ProtectableObjectLoadPath) + populate(objectMap, "protected", d.Protected) + populate(objectMap, "protectionGroupName", d.ProtectionGroupName) + populate(objectMap, "recoveryPointCount", d.RecoveryPointCount) + populate(objectMap, "totalDiskStorageSizeInBytes", d.TotalDiskStorageSizeInBytes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DPMProtectedItemExtendedInfo. +func (d *DPMProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "diskStorageUsedInBytes": + err = unpopulate(val, "DiskStorageUsedInBytes", &d.DiskStorageUsedInBytes) + delete(rawMsg, key) + case "isCollocated": + err = unpopulate(val, "IsCollocated", &d.IsCollocated) + delete(rawMsg, key) + case "isPresentOnCloud": + err = unpopulate(val, "IsPresentOnCloud", &d.IsPresentOnCloud) + delete(rawMsg, key) + case "lastBackupStatus": + err = unpopulate(val, "LastBackupStatus", &d.LastBackupStatus) + delete(rawMsg, key) + case "lastRefreshedAt": + err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &d.LastRefreshedAt) + delete(rawMsg, key) + case "oldestRecoveryPoint": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &d.OldestRecoveryPoint) + delete(rawMsg, key) + case "onPremiseLatestRecoveryPoint": + err = unpopulateTimeRFC3339(val, "OnPremiseLatestRecoveryPoint", &d.OnPremiseLatestRecoveryPoint) + delete(rawMsg, key) + case "onPremiseOldestRecoveryPoint": + err = unpopulateTimeRFC3339(val, "OnPremiseOldestRecoveryPoint", &d.OnPremiseOldestRecoveryPoint) + delete(rawMsg, key) + case "onPremiseRecoveryPointCount": + err = unpopulate(val, "OnPremiseRecoveryPointCount", &d.OnPremiseRecoveryPointCount) + delete(rawMsg, key) + case "protectableObjectLoadPath": + err = unpopulate(val, "ProtectableObjectLoadPath", &d.ProtectableObjectLoadPath) + delete(rawMsg, key) + case "protected": + err = unpopulate(val, "Protected", &d.Protected) + delete(rawMsg, key) + case "protectionGroupName": + err = unpopulate(val, "ProtectionGroupName", &d.ProtectionGroupName) + delete(rawMsg, key) + case "recoveryPointCount": + err = unpopulate(val, "RecoveryPointCount", &d.RecoveryPointCount) + delete(rawMsg, key) + case "totalDiskStorageSizeInBytes": + err = unpopulate(val, "TotalDiskStorageSizeInBytes", &d.TotalDiskStorageSizeInBytes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DailyRetentionFormat. +func (d DailyRetentionFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "daysOfTheMonth", d.DaysOfTheMonth) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DailyRetentionFormat. +func (d *DailyRetentionFormat) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "daysOfTheMonth": + err = unpopulate(val, "DaysOfTheMonth", &d.DaysOfTheMonth) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DailyRetentionSchedule. +func (d DailyRetentionSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "retentionDuration", d.RetentionDuration) + aux := make([]*timeRFC3339, len(d.RetentionTimes), len(d.RetentionTimes)) + for i := 0; i < len(d.RetentionTimes); i++ { + aux[i] = (*timeRFC3339)(d.RetentionTimes[i]) + } + populate(objectMap, "retentionTimes", aux) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DailyRetentionSchedule. +func (d *DailyRetentionSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "retentionDuration": + err = unpopulate(val, "RetentionDuration", &d.RetentionDuration) + delete(rawMsg, key) + case "retentionTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "RetentionTimes", &aux) + for _, au := range aux { + d.RetentionTimes = append(d.RetentionTimes, (*time.Time)(au)) + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DailySchedule. +func (d DailySchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + aux := make([]*timeRFC3339, len(d.ScheduleRunTimes), len(d.ScheduleRunTimes)) + for i := 0; i < len(d.ScheduleRunTimes); i++ { + aux[i] = (*timeRFC3339)(d.ScheduleRunTimes[i]) + } + populate(objectMap, "scheduleRunTimes", aux) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DailySchedule. +func (d *DailySchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scheduleRunTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "ScheduleRunTimes", &aux) + for _, au := range aux { + d.ScheduleRunTimes = append(d.ScheduleRunTimes, (*time.Time)(au)) + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Day. +func (d Day) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "date", d.Date) + populate(objectMap, "isLast", d.IsLast) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Day. +func (d *Day) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "date": + err = unpopulate(val, "Date", &d.Date) + delete(rawMsg, key) + case "isLast": + err = unpopulate(val, "IsLast", &d.IsLast) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiskExclusionProperties. +func (d DiskExclusionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diskLunList", d.DiskLunList) + populate(objectMap, "isInclusionList", d.IsInclusionList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskExclusionProperties. +func (d *DiskExclusionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "diskLunList": + err = unpopulate(val, "DiskLunList", &d.DiskLunList) + delete(rawMsg, key) + case "isInclusionList": + err = unpopulate(val, "IsInclusionList", &d.IsInclusionList) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiskInformation. +func (d DiskInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "lun", d.Lun) + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskInformation. +func (d *DiskInformation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lun": + err = unpopulate(val, "Lun", &d.Lun) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DistributedNodesInfo. +func (d DistributedNodesInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorDetail", d.ErrorDetail) + populate(objectMap, "nodeName", d.NodeName) + populate(objectMap, "status", d.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedNodesInfo. +func (d *DistributedNodesInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorDetail": + err = unpopulate(val, "ErrorDetail", &d.ErrorDetail) + delete(rawMsg, key) + case "nodeName": + err = unpopulate(val, "NodeName", &d.NodeName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DpmBackupEngine. +func (d DpmBackupEngine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureBackupAgentVersion", d.AzureBackupAgentVersion) + populate(objectMap, "backupEngineId", d.BackupEngineID) + populate(objectMap, "backupEngineState", d.BackupEngineState) + objectMap["backupEngineType"] = BackupEngineTypeDpmBackupEngine + populate(objectMap, "backupManagementType", d.BackupManagementType) + populate(objectMap, "canReRegister", d.CanReRegister) + populate(objectMap, "dpmVersion", d.DpmVersion) + populate(objectMap, "extendedInfo", d.ExtendedInfo) + populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "healthStatus", d.HealthStatus) + populate(objectMap, "isAzureBackupAgentUpgradeAvailable", d.IsAzureBackupAgentUpgradeAvailable) + populate(objectMap, "isDpmUpgradeAvailable", d.IsDpmUpgradeAvailable) + populate(objectMap, "registrationStatus", d.RegistrationStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmBackupEngine. +func (d *DpmBackupEngine) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureBackupAgentVersion": + err = unpopulate(val, "AzureBackupAgentVersion", &d.AzureBackupAgentVersion) + delete(rawMsg, key) + case "backupEngineId": + err = unpopulate(val, "BackupEngineID", &d.BackupEngineID) + delete(rawMsg, key) + case "backupEngineState": + err = unpopulate(val, "BackupEngineState", &d.BackupEngineState) + delete(rawMsg, key) + case "backupEngineType": + err = unpopulate(val, "BackupEngineType", &d.BackupEngineType) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + delete(rawMsg, key) + case "canReRegister": + err = unpopulate(val, "CanReRegister", &d.CanReRegister) + delete(rawMsg, key) + case "dpmVersion": + err = unpopulate(val, "DpmVersion", &d.DpmVersion) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &d.HealthStatus) + delete(rawMsg, key) + case "isAzureBackupAgentUpgradeAvailable": + err = unpopulate(val, "IsAzureBackupAgentUpgradeAvailable", &d.IsAzureBackupAgentUpgradeAvailable) + delete(rawMsg, key) + case "isDpmUpgradeAvailable": + err = unpopulate(val, "IsDpmUpgradeAvailable", &d.IsDpmUpgradeAvailable) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DpmContainer. +func (d DpmContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", d.BackupManagementType) + populate(objectMap, "canReRegister", d.CanReRegister) + populate(objectMap, "containerId", d.ContainerID) + objectMap["containerType"] = ProtectableContainerTypeDPMContainer + populate(objectMap, "dpmAgentVersion", d.DpmAgentVersion) + populate(objectMap, "dpmServers", d.DpmServers) + populate(objectMap, "extendedInfo", d.ExtendedInfo) + populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "healthStatus", d.HealthStatus) + populate(objectMap, "protectableObjectType", d.ProtectableObjectType) + populate(objectMap, "protectedItemCount", d.ProtectedItemCount) + populate(objectMap, "protectionStatus", d.ProtectionStatus) + populate(objectMap, "registrationStatus", d.RegistrationStatus) + populate(objectMap, "upgradeAvailable", d.UpgradeAvailable) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmContainer. +func (d *DpmContainer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + delete(rawMsg, key) + case "canReRegister": + err = unpopulate(val, "CanReRegister", &d.CanReRegister) + delete(rawMsg, key) + case "containerId": + err = unpopulate(val, "ContainerID", &d.ContainerID) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &d.ContainerType) + delete(rawMsg, key) + case "dpmAgentVersion": + err = unpopulate(val, "DpmAgentVersion", &d.DpmAgentVersion) + delete(rawMsg, key) + case "dpmServers": + err = unpopulate(val, "DpmServers", &d.DpmServers) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &d.HealthStatus) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &d.ProtectableObjectType) + delete(rawMsg, key) + case "protectedItemCount": + err = unpopulate(val, "ProtectedItemCount", &d.ProtectedItemCount) + delete(rawMsg, key) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &d.ProtectionStatus) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) + delete(rawMsg, key) + case "upgradeAvailable": + err = unpopulate(val, "UpgradeAvailable", &d.UpgradeAvailable) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DpmErrorInfo. +func (d DpmErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorString", d.ErrorString) + populate(objectMap, "recommendations", d.Recommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmErrorInfo. +func (d *DpmErrorInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorString": + err = unpopulate(val, "ErrorString", &d.ErrorString) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &d.Recommendations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DpmJob. +func (d DpmJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionsInfo", d.ActionsInfo) + populate(objectMap, "activityId", d.ActivityID) + populate(objectMap, "backupManagementType", d.BackupManagementType) + populate(objectMap, "containerName", d.ContainerName) + populate(objectMap, "containerType", d.ContainerType) + populate(objectMap, "dpmServerName", d.DpmServerName) + populate(objectMap, "duration", d.Duration) + populateTimeRFC3339(objectMap, "endTime", d.EndTime) + populate(objectMap, "entityFriendlyName", d.EntityFriendlyName) + populate(objectMap, "errorDetails", d.ErrorDetails) + populate(objectMap, "extendedInfo", d.ExtendedInfo) + objectMap["jobType"] = "DpmJob" + populate(objectMap, "operation", d.Operation) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + populate(objectMap, "status", d.Status) + populate(objectMap, "workloadType", d.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJob. +func (d *DpmJob) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionsInfo": + err = unpopulate(val, "ActionsInfo", &d.ActionsInfo) + delete(rawMsg, key) + case "activityId": + err = unpopulate(val, "ActivityID", &d.ActivityID) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &d.ContainerName) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &d.ContainerType) + delete(rawMsg, key) + case "dpmServerName": + err = unpopulate(val, "DpmServerName", &d.DpmServerName) + delete(rawMsg, key) + case "duration": + err = unpopulate(val, "Duration", &d.Duration) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &d.EndTime) + delete(rawMsg, key) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &d.EntityFriendlyName) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &d.ErrorDetails) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &d.JobType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &d.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &d.WorkloadType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DpmJobExtendedInfo. +func (d DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dynamicErrorMessage", d.DynamicErrorMessage) + populate(objectMap, "propertyBag", d.PropertyBag) + populate(objectMap, "tasksList", d.TasksList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJobExtendedInfo. +func (d *DpmJobExtendedInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &d.DynamicErrorMessage) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &d.PropertyBag) + delete(rawMsg, key) + case "tasksList": + err = unpopulate(val, "TasksList", &d.TasksList) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DpmJobTaskDetails. +func (d DpmJobTaskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "duration", d.Duration) + populateTimeRFC3339(objectMap, "endTime", d.EndTime) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + populate(objectMap, "status", d.Status) + populate(objectMap, "taskId", d.TaskID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJobTaskDetails. +func (d *DpmJobTaskDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "duration": + err = unpopulate(val, "Duration", &d.Duration) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &d.EndTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &d.TaskID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EncryptionDetails. +func (e EncryptionDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "encryptionEnabled", e.EncryptionEnabled) + populate(objectMap, "kekUrl", e.KekURL) + populate(objectMap, "kekVaultId", e.KekVaultID) + populate(objectMap, "secretKeyUrl", e.SecretKeyURL) + populate(objectMap, "secretKeyVaultId", e.SecretKeyVaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionDetails. +func (e *EncryptionDetails) UnmarshalJSON(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 "encryptionEnabled": + err = unpopulate(val, "EncryptionEnabled", &e.EncryptionEnabled) + delete(rawMsg, key) + case "kekUrl": + err = unpopulate(val, "KekURL", &e.KekURL) + delete(rawMsg, key) + case "kekVaultId": + err = unpopulate(val, "KekVaultID", &e.KekVaultID) + delete(rawMsg, key) + case "secretKeyUrl": + err = unpopulate(val, "SecretKeyURL", &e.SecretKeyURL) + delete(rawMsg, key) + case "secretKeyVaultId": + err = unpopulate(val, "SecretKeyVaultID", &e.SecretKeyVaultID) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(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 "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + populate(objectMap, "recommendations", e.Recommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &e.Recommendations) + 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 ExportJobsOperationResultInfo. +func (e ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobSasKey", e.BlobSasKey) + populate(objectMap, "blobUrl", e.BlobURL) + populate(objectMap, "excelFileBlobSasKey", e.ExcelFileBlobSasKey) + populate(objectMap, "excelFileBlobUrl", e.ExcelFileBlobURL) + objectMap["objectType"] = "ExportJobsOperationResultInfo" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportJobsOperationResultInfo. +func (e *ExportJobsOperationResultInfo) UnmarshalJSON(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 "blobSasKey": + err = unpopulate(val, "BlobSasKey", &e.BlobSasKey) + delete(rawMsg, key) + case "blobUrl": + err = unpopulate(val, "BlobURL", &e.BlobURL) + delete(rawMsg, key) + case "excelFileBlobSasKey": + err = unpopulate(val, "ExcelFileBlobSasKey", &e.ExcelFileBlobSasKey) + delete(rawMsg, key) + case "excelFileBlobUrl": + err = unpopulate(val, "ExcelFileBlobURL", &e.ExcelFileBlobURL) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &e.ObjectType) + 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 ExtendedProperties. +func (e ExtendedProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diskExclusionProperties", e.DiskExclusionProperties) + populate(objectMap, "linuxVmApplicationName", e.LinuxVMApplicationName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedProperties. +func (e *ExtendedProperties) UnmarshalJSON(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 "diskExclusionProperties": + err = unpopulate(val, "DiskExclusionProperties", &e.DiskExclusionProperties) + delete(rawMsg, key) + case "linuxVmApplicationName": + err = unpopulate(val, "LinuxVMApplicationName", &e.LinuxVMApplicationName) + 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 FeatureSupportRequest. +func (f FeatureSupportRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["featureType"] = f.FeatureType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureSupportRequest. +func (f *FeatureSupportRequest) UnmarshalJSON(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 "featureType": + err = unpopulate(val, "FeatureType", &f.FeatureType) + 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 GenericContainer. +func (g GenericContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", g.BackupManagementType) + objectMap["containerType"] = ProtectableContainerTypeGenericContainer + populate(objectMap, "extendedInformation", g.ExtendedInformation) + populate(objectMap, "fabricName", g.FabricName) + populate(objectMap, "friendlyName", g.FriendlyName) + populate(objectMap, "healthStatus", g.HealthStatus) + populate(objectMap, "protectableObjectType", g.ProtectableObjectType) + populate(objectMap, "registrationStatus", g.RegistrationStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericContainer. +func (g *GenericContainer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &g.ContainerType) + delete(rawMsg, key) + case "extendedInformation": + err = unpopulate(val, "ExtendedInformation", &g.ExtendedInformation) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &g.FabricName) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &g.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &g.HealthStatus) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &g.ProtectableObjectType) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &g.RegistrationStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenericContainerExtendedInfo. +func (g GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "containerIdentityInfo", g.ContainerIdentityInfo) + populate(objectMap, "rawCertData", g.RawCertData) + populate(objectMap, "serviceEndpoints", g.ServiceEndpoints) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericContainerExtendedInfo. +func (g *GenericContainerExtendedInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "containerIdentityInfo": + err = unpopulate(val, "ContainerIdentityInfo", &g.ContainerIdentityInfo) + delete(rawMsg, key) + case "rawCertData": + err = unpopulate(val, "RawCertData", &g.RawCertData) + delete(rawMsg, key) + case "serviceEndpoints": + err = unpopulate(val, "ServiceEndpoints", &g.ServiceEndpoints) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenericProtectedItem. +func (g GenericProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", g.BackupManagementType) + populate(objectMap, "backupSetName", g.BackupSetName) + populate(objectMap, "containerName", g.ContainerName) + populate(objectMap, "createMode", g.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", g.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", g.DeferredDeleteTimeRemaining) + populate(objectMap, "fabricName", g.FabricName) + populate(objectMap, "friendlyName", g.FriendlyName) + populate(objectMap, "isArchiveEnabled", g.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", g.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", g.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", g.IsScheduledForDeferredDelete) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", g.LastRecoveryPoint) + populate(objectMap, "policyId", g.PolicyID) + populate(objectMap, "policyName", g.PolicyName) + populate(objectMap, "policyState", g.PolicyState) + populate(objectMap, "protectedItemId", g.ProtectedItemID) + objectMap["protectedItemType"] = "GenericProtectedItem" + populate(objectMap, "protectionState", g.ProtectionState) + populate(objectMap, "resourceGuardOperationRequests", g.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", g.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceAssociations", g.SourceAssociations) + populate(objectMap, "sourceResourceId", g.SourceResourceID) + populate(objectMap, "workloadType", g.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericProtectedItem. +func (g *GenericProtectedItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) + delete(rawMsg, key) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &g.BackupSetName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &g.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &g.CreateMode) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &g.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &g.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &g.FabricName) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &g.FriendlyName) + delete(rawMsg, key) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &g.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &g.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &g.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &g.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &g.LastRecoveryPoint) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &g.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &g.PolicyName) + delete(rawMsg, key) + case "policyState": + err = unpopulate(val, "PolicyState", &g.PolicyState) + delete(rawMsg, key) + case "protectedItemId": + err = unpopulate(val, "ProtectedItemID", &g.ProtectedItemID) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &g.ProtectedItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &g.ProtectionState) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &g.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &g.SoftDeleteRetentionPeriod) + delete(rawMsg, key) + case "sourceAssociations": + err = unpopulate(val, "SourceAssociations", &g.SourceAssociations) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &g.SourceResourceID) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &g.WorkloadType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenericProtectionPolicy. +func (g GenericProtectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["backupManagementType"] = "GenericProtectionPolicy" + populate(objectMap, "fabricName", g.FabricName) + populate(objectMap, "protectedItemsCount", g.ProtectedItemsCount) + populate(objectMap, "resourceGuardOperationRequests", g.ResourceGuardOperationRequests) + populate(objectMap, "subProtectionPolicy", g.SubProtectionPolicy) + populate(objectMap, "timeZone", g.TimeZone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericProtectionPolicy. +func (g *GenericProtectionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &g.FabricName) + delete(rawMsg, key) + case "protectedItemsCount": + err = unpopulate(val, "ProtectedItemsCount", &g.ProtectedItemsCount) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &g.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "subProtectionPolicy": + err = unpopulate(val, "SubProtectionPolicy", &g.SubProtectionPolicy) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &g.TimeZone) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenericRecoveryPoint. +func (g GenericRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "friendlyName", g.FriendlyName) + objectMap["objectType"] = "GenericRecoveryPoint" + populate(objectMap, "recoveryPointAdditionalInfo", g.RecoveryPointAdditionalInfo) + populateTimeRFC3339(objectMap, "recoveryPointTime", g.RecoveryPointTime) + populate(objectMap, "recoveryPointType", g.RecoveryPointType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericRecoveryPoint. +func (g *GenericRecoveryPoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "friendlyName": + err = unpopulate(val, "FriendlyName", &g.FriendlyName) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &g.ObjectType) + delete(rawMsg, key) + case "recoveryPointAdditionalInfo": + err = unpopulate(val, "RecoveryPointAdditionalInfo", &g.RecoveryPointAdditionalInfo) + delete(rawMsg, key) + case "recoveryPointTime": + err = unpopulateTimeRFC3339(val, "RecoveryPointTime", &g.RecoveryPointTime) + delete(rawMsg, key) + case "recoveryPointType": + err = unpopulate(val, "RecoveryPointType", &g.RecoveryPointType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GetProtectedItemQueryObject. +func (g GetProtectedItemQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "expand", g.Expand) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetProtectedItemQueryObject. +func (g *GetProtectedItemQueryObject) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expand": + err = unpopulate(val, "Expand", &g.Expand) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HourlySchedule. +func (h HourlySchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "interval", h.Interval) + populate(objectMap, "scheduleWindowDuration", h.ScheduleWindowDuration) + populateTimeRFC3339(objectMap, "scheduleWindowStartTime", h.ScheduleWindowStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HourlySchedule. +func (h *HourlySchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "interval": + err = unpopulate(val, "Interval", &h.Interval) + delete(rawMsg, key) + case "scheduleWindowDuration": + err = unpopulate(val, "ScheduleWindowDuration", &h.ScheduleWindowDuration) + delete(rawMsg, key) + case "scheduleWindowStartTime": + err = unpopulateTimeRFC3339(val, "ScheduleWindowStartTime", &h.ScheduleWindowStartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ILRRequest. +func (i ILRRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = i.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ILRRequest. +func (i *ILRRequest) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + 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 ILRRequestResource. +func (i ILRRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", i.ETag) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ILRRequestResource. +func (i *ILRRequestResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "eTag": + err = unpopulate(val, "ETag", &i.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + i.Properties, err = unmarshalILRRequestClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IaaSVMContainer. +func (i IaaSVMContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", i.BackupManagementType) + objectMap["containerType"] = ProtectableContainerTypeIaasVMContainer + populate(objectMap, "friendlyName", i.FriendlyName) + populate(objectMap, "healthStatus", i.HealthStatus) + populate(objectMap, "protectableObjectType", i.ProtectableObjectType) + populate(objectMap, "registrationStatus", i.RegistrationStatus) + populate(objectMap, "resourceGroup", i.ResourceGroup) + populate(objectMap, "virtualMachineId", i.VirtualMachineID) + populate(objectMap, "virtualMachineVersion", i.VirtualMachineVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaaSVMContainer. +func (i *IaaSVMContainer) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &i.BackupManagementType) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &i.ContainerType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &i.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &i.HealthStatus) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &i.ProtectableObjectType) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &i.RegistrationStatus) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &i.ResourceGroup) + delete(rawMsg, key) + case "virtualMachineId": + err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + delete(rawMsg, key) + case "virtualMachineVersion": + err = unpopulate(val, "VirtualMachineVersion", &i.VirtualMachineVersion) + 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 IaaSVMProtectableItem. +func (i IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", i.BackupManagementType) + populate(objectMap, "friendlyName", i.FriendlyName) + objectMap["protectableItemType"] = "IaaSVMProtectableItem" + populate(objectMap, "protectionState", i.ProtectionState) + populate(objectMap, "resourceGroup", i.ResourceGroup) + populate(objectMap, "virtualMachineId", i.VirtualMachineID) + populate(objectMap, "virtualMachineVersion", i.VirtualMachineVersion) + populate(objectMap, "workloadType", i.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaaSVMProtectableItem. +func (i *IaaSVMProtectableItem) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &i.BackupManagementType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &i.FriendlyName) + delete(rawMsg, key) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &i.ProtectableItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &i.ProtectionState) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &i.ResourceGroup) + delete(rawMsg, key) + case "virtualMachineId": + err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + delete(rawMsg, key) + case "virtualMachineVersion": + err = unpopulate(val, "VirtualMachineVersion", &i.VirtualMachineVersion) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &i.WorkloadType) + 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 IaasVMBackupRequest. +func (i IaasVMBackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = "IaasVMBackupRequest" + populateTimeRFC3339(objectMap, "recoveryPointExpiryTimeInUTC", i.RecoveryPointExpiryTimeInUTC) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMBackupRequest. +func (i *IaasVMBackupRequest) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "recoveryPointExpiryTimeInUTC": + err = unpopulateTimeRFC3339(val, "RecoveryPointExpiryTimeInUTC", &i.RecoveryPointExpiryTimeInUTC) + 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 IaasVMILRRegistrationRequest. +func (i IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "initiatorName", i.InitiatorName) + objectMap["objectType"] = "IaasVMILRRegistrationRequest" + populate(objectMap, "recoveryPointId", i.RecoveryPointID) + populate(objectMap, "renewExistingRegistration", i.RenewExistingRegistration) + populate(objectMap, "virtualMachineId", i.VirtualMachineID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMILRRegistrationRequest. +func (i *IaasVMILRRegistrationRequest) UnmarshalJSON(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 "initiatorName": + err = unpopulate(val, "InitiatorName", &i.InitiatorName) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "recoveryPointId": + err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) + delete(rawMsg, key) + case "renewExistingRegistration": + err = unpopulate(val, "RenewExistingRegistration", &i.RenewExistingRegistration) + delete(rawMsg, key) + case "virtualMachineId": + err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + 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 IaasVMRecoveryPoint. +func (i IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isInstantIlrSessionActive", i.IsInstantIlrSessionActive) + populate(objectMap, "isManagedVirtualMachine", i.IsManagedVirtualMachine) + populate(objectMap, "isSourceVMEncrypted", i.IsSourceVMEncrypted) + populate(objectMap, "keyAndSecret", i.KeyAndSecret) + populate(objectMap, "osType", i.OSType) + objectMap["objectType"] = "IaasVMRecoveryPoint" + populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) + populate(objectMap, "recoveryPointAdditionalInfo", i.RecoveryPointAdditionalInfo) + populate(objectMap, "recoveryPointDiskConfiguration", i.RecoveryPointDiskConfiguration) + populate(objectMap, "recoveryPointMoveReadinessInfo", i.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointTierDetails", i.RecoveryPointTierDetails) + populateTimeRFC3339(objectMap, "recoveryPointTime", i.RecoveryPointTime) + populate(objectMap, "recoveryPointType", i.RecoveryPointType) + populate(objectMap, "sourceVMStorageType", i.SourceVMStorageType) + populate(objectMap, "virtualMachineSize", i.VirtualMachineSize) + populate(objectMap, "zones", i.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRecoveryPoint. +func (i *IaasVMRecoveryPoint) UnmarshalJSON(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 "isInstantIlrSessionActive": + err = unpopulate(val, "IsInstantIlrSessionActive", &i.IsInstantIlrSessionActive) + delete(rawMsg, key) + case "isManagedVirtualMachine": + err = unpopulate(val, "IsManagedVirtualMachine", &i.IsManagedVirtualMachine) + delete(rawMsg, key) + case "isSourceVMEncrypted": + err = unpopulate(val, "IsSourceVMEncrypted", &i.IsSourceVMEncrypted) + delete(rawMsg, key) + case "keyAndSecret": + err = unpopulate(val, "KeyAndSecret", &i.KeyAndSecret) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &i.OSType) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "originalStorageAccountOption": + err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) + delete(rawMsg, key) + case "recoveryPointAdditionalInfo": + err = unpopulate(val, "RecoveryPointAdditionalInfo", &i.RecoveryPointAdditionalInfo) + delete(rawMsg, key) + case "recoveryPointDiskConfiguration": + err = unpopulate(val, "RecoveryPointDiskConfiguration", &i.RecoveryPointDiskConfiguration) + delete(rawMsg, key) + case "recoveryPointMoveReadinessInfo": + err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &i.RecoveryPointMoveReadinessInfo) + delete(rawMsg, key) + case "recoveryPointTierDetails": + err = unpopulate(val, "RecoveryPointTierDetails", &i.RecoveryPointTierDetails) + delete(rawMsg, key) + case "recoveryPointTime": + err = unpopulateTimeRFC3339(val, "RecoveryPointTime", &i.RecoveryPointTime) + delete(rawMsg, key) + case "recoveryPointType": + err = unpopulate(val, "RecoveryPointType", &i.RecoveryPointType) + delete(rawMsg, key) + case "sourceVMStorageType": + err = unpopulate(val, "SourceVMStorageType", &i.SourceVMStorageType) + delete(rawMsg, key) + case "virtualMachineSize": + err = unpopulate(val, "VirtualMachineSize", &i.VirtualMachineSize) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &i.Zones) + 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 IaasVMRestoreRequest. +func (i IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "affinityGroup", i.AffinityGroup) + populate(objectMap, "createNewCloudService", i.CreateNewCloudService) + populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) + populate(objectMap, "encryptionDetails", i.EncryptionDetails) + populate(objectMap, "identityBasedRestoreDetails", i.IdentityBasedRestoreDetails) + populate(objectMap, "identityInfo", i.IdentityInfo) + objectMap["objectType"] = "IaasVMRestoreRequest" + populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) + populate(objectMap, "recoveryPointId", i.RecoveryPointID) + populate(objectMap, "recoveryType", i.RecoveryType) + populate(objectMap, "region", i.Region) + populate(objectMap, "restoreDiskLunList", i.RestoreDiskLunList) + populate(objectMap, "restoreWithManagedDisks", i.RestoreWithManagedDisks) + populate(objectMap, "sourceResourceId", i.SourceResourceID) + populate(objectMap, "storageAccountId", i.StorageAccountID) + populate(objectMap, "subnetId", i.SubnetID) + populate(objectMap, "targetDomainNameId", i.TargetDomainNameID) + populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) + populate(objectMap, "targetVirtualMachineId", i.TargetVirtualMachineID) + populate(objectMap, "virtualNetworkId", i.VirtualNetworkID) + populate(objectMap, "zones", i.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRestoreRequest. +func (i *IaasVMRestoreRequest) UnmarshalJSON(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 "affinityGroup": + err = unpopulate(val, "AffinityGroup", &i.AffinityGroup) + delete(rawMsg, key) + case "createNewCloudService": + err = unpopulate(val, "CreateNewCloudService", &i.CreateNewCloudService) + delete(rawMsg, key) + case "diskEncryptionSetId": + err = unpopulate(val, "DiskEncryptionSetID", &i.DiskEncryptionSetID) + delete(rawMsg, key) + case "encryptionDetails": + err = unpopulate(val, "EncryptionDetails", &i.EncryptionDetails) + delete(rawMsg, key) + case "identityBasedRestoreDetails": + err = unpopulate(val, "IdentityBasedRestoreDetails", &i.IdentityBasedRestoreDetails) + delete(rawMsg, key) + case "identityInfo": + err = unpopulate(val, "IdentityInfo", &i.IdentityInfo) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "originalStorageAccountOption": + err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) + delete(rawMsg, key) + case "recoveryPointId": + err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) + delete(rawMsg, key) + case "recoveryType": + err = unpopulate(val, "RecoveryType", &i.RecoveryType) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &i.Region) + delete(rawMsg, key) + case "restoreDiskLunList": + err = unpopulate(val, "RestoreDiskLunList", &i.RestoreDiskLunList) + delete(rawMsg, key) + case "restoreWithManagedDisks": + err = unpopulate(val, "RestoreWithManagedDisks", &i.RestoreWithManagedDisks) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &i.SourceResourceID) + delete(rawMsg, key) + case "storageAccountId": + err = unpopulate(val, "StorageAccountID", &i.StorageAccountID) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &i.SubnetID) + delete(rawMsg, key) + case "targetDomainNameId": + err = unpopulate(val, "TargetDomainNameID", &i.TargetDomainNameID) + delete(rawMsg, key) + case "targetResourceGroupId": + err = unpopulate(val, "TargetResourceGroupID", &i.TargetResourceGroupID) + delete(rawMsg, key) + case "targetVirtualMachineId": + err = unpopulate(val, "TargetVirtualMachineID", &i.TargetVirtualMachineID) + delete(rawMsg, key) + case "virtualNetworkId": + err = unpopulate(val, "VirtualNetworkID", &i.VirtualNetworkID) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &i.Zones) + 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 IaasVMRestoreWithRehydrationRequest. +func (i IaasVMRestoreWithRehydrationRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "affinityGroup", i.AffinityGroup) + populate(objectMap, "createNewCloudService", i.CreateNewCloudService) + populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) + populate(objectMap, "encryptionDetails", i.EncryptionDetails) + populate(objectMap, "identityBasedRestoreDetails", i.IdentityBasedRestoreDetails) + populate(objectMap, "identityInfo", i.IdentityInfo) + objectMap["objectType"] = "IaasVMRestoreWithRehydrationRequest" + populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) + populate(objectMap, "recoveryPointId", i.RecoveryPointID) + populate(objectMap, "recoveryPointRehydrationInfo", i.RecoveryPointRehydrationInfo) + populate(objectMap, "recoveryType", i.RecoveryType) + populate(objectMap, "region", i.Region) + populate(objectMap, "restoreDiskLunList", i.RestoreDiskLunList) + populate(objectMap, "restoreWithManagedDisks", i.RestoreWithManagedDisks) + populate(objectMap, "sourceResourceId", i.SourceResourceID) + populate(objectMap, "storageAccountId", i.StorageAccountID) + populate(objectMap, "subnetId", i.SubnetID) + populate(objectMap, "targetDomainNameId", i.TargetDomainNameID) + populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) + populate(objectMap, "targetVirtualMachineId", i.TargetVirtualMachineID) + populate(objectMap, "virtualNetworkId", i.VirtualNetworkID) + populate(objectMap, "zones", i.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRestoreWithRehydrationRequest. +func (i *IaasVMRestoreWithRehydrationRequest) UnmarshalJSON(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 "affinityGroup": + err = unpopulate(val, "AffinityGroup", &i.AffinityGroup) + delete(rawMsg, key) + case "createNewCloudService": + err = unpopulate(val, "CreateNewCloudService", &i.CreateNewCloudService) + delete(rawMsg, key) + case "diskEncryptionSetId": + err = unpopulate(val, "DiskEncryptionSetID", &i.DiskEncryptionSetID) + delete(rawMsg, key) + case "encryptionDetails": + err = unpopulate(val, "EncryptionDetails", &i.EncryptionDetails) + delete(rawMsg, key) + case "identityBasedRestoreDetails": + err = unpopulate(val, "IdentityBasedRestoreDetails", &i.IdentityBasedRestoreDetails) + delete(rawMsg, key) + case "identityInfo": + err = unpopulate(val, "IdentityInfo", &i.IdentityInfo) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "originalStorageAccountOption": + err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) + delete(rawMsg, key) + case "recoveryPointId": + err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) + delete(rawMsg, key) + case "recoveryPointRehydrationInfo": + err = unpopulate(val, "RecoveryPointRehydrationInfo", &i.RecoveryPointRehydrationInfo) + delete(rawMsg, key) + case "recoveryType": + err = unpopulate(val, "RecoveryType", &i.RecoveryType) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &i.Region) + delete(rawMsg, key) + case "restoreDiskLunList": + err = unpopulate(val, "RestoreDiskLunList", &i.RestoreDiskLunList) + delete(rawMsg, key) + case "restoreWithManagedDisks": + err = unpopulate(val, "RestoreWithManagedDisks", &i.RestoreWithManagedDisks) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &i.SourceResourceID) + delete(rawMsg, key) + case "storageAccountId": + err = unpopulate(val, "StorageAccountID", &i.StorageAccountID) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &i.SubnetID) + delete(rawMsg, key) + case "targetDomainNameId": + err = unpopulate(val, "TargetDomainNameID", &i.TargetDomainNameID) + delete(rawMsg, key) + case "targetResourceGroupId": + err = unpopulate(val, "TargetResourceGroupID", &i.TargetResourceGroupID) + delete(rawMsg, key) + case "targetVirtualMachineId": + err = unpopulate(val, "TargetVirtualMachineID", &i.TargetVirtualMachineID) + delete(rawMsg, key) + case "virtualNetworkId": + err = unpopulate(val, "VirtualNetworkID", &i.VirtualNetworkID) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &i.Zones) + 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 IdentityBasedRestoreDetails. +func (i IdentityBasedRestoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "objectType", i.ObjectType) + populate(objectMap, "targetStorageAccountId", i.TargetStorageAccountID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityBasedRestoreDetails. +func (i *IdentityBasedRestoreDetails) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "targetStorageAccountId": + err = unpopulate(val, "TargetStorageAccountID", &i.TargetStorageAccountID) + 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 IdentityInfo. +func (i IdentityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isSystemAssignedIdentity", i.IsSystemAssignedIdentity) + populate(objectMap, "managedIdentityResourceId", i.ManagedIdentityResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityInfo. +func (i *IdentityInfo) UnmarshalJSON(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 "isSystemAssignedIdentity": + err = unpopulate(val, "IsSystemAssignedIdentity", &i.IsSystemAssignedIdentity) + delete(rawMsg, key) + case "managedIdentityResourceId": + err = unpopulate(val, "ManagedIdentityResourceID", &i.ManagedIdentityResourceID) + 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 InquiryInfo. +func (i InquiryInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorDetail", i.ErrorDetail) + populate(objectMap, "inquiryDetails", i.InquiryDetails) + populate(objectMap, "status", i.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InquiryInfo. +func (i *InquiryInfo) UnmarshalJSON(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 "errorDetail": + err = unpopulate(val, "ErrorDetail", &i.ErrorDetail) + delete(rawMsg, key) + case "inquiryDetails": + err = unpopulate(val, "InquiryDetails", &i.InquiryDetails) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + 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 InquiryValidation. +func (i InquiryValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalDetail", i.AdditionalDetail) + populate(objectMap, "errorDetail", i.ErrorDetail) + populate(objectMap, "status", i.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InquiryValidation. +func (i *InquiryValidation) UnmarshalJSON(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 "additionalDetail": + err = unpopulate(val, "AdditionalDetail", &i.AdditionalDetail) + delete(rawMsg, key) + case "errorDetail": + err = unpopulate(val, "ErrorDetail", &i.ErrorDetail) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + 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 InstantItemRecoveryTarget. +func (i InstantItemRecoveryTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientScripts", i.ClientScripts) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstantItemRecoveryTarget. +func (i *InstantItemRecoveryTarget) UnmarshalJSON(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 "clientScripts": + err = unpopulate(val, "ClientScripts", &i.ClientScripts) + 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 InstantRPAdditionalDetails. +func (i InstantRPAdditionalDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureBackupRGNamePrefix", i.AzureBackupRGNamePrefix) + populate(objectMap, "azureBackupRGNameSuffix", i.AzureBackupRGNameSuffix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstantRPAdditionalDetails. +func (i *InstantRPAdditionalDetails) UnmarshalJSON(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 "azureBackupRGNamePrefix": + err = unpopulate(val, "AzureBackupRGNamePrefix", &i.AzureBackupRGNamePrefix) + delete(rawMsg, key) + case "azureBackupRGNameSuffix": + err = unpopulate(val, "AzureBackupRGNameSuffix", &i.AzureBackupRGNameSuffix) + 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 Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "activityId", j.ActivityID) + populate(objectMap, "backupManagementType", j.BackupManagementType) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "entityFriendlyName", j.EntityFriendlyName) + objectMap["jobType"] = j.JobType + populate(objectMap, "operation", j.Operation) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Job. +func (j *Job) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activityId": + err = unpopulate(val, "ActivityID", &j.ActivityID) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &j.BackupManagementType) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &j.EntityFriendlyName) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &j.JobType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &j.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobQueryObject. +func (j JobQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", j.BackupManagementType) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "jobId", j.JobID) + populate(objectMap, "operation", j.Operation) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobQueryObject. +func (j *JobQueryObject) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &j.BackupManagementType) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "jobId": + err = unpopulate(val, "JobID", &j.JobID) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &j.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobResource. +func (j JobResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", j.ETag) + populate(objectMap, "id", j.ID) + populate(objectMap, "location", j.Location) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "tags", j.Tags) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobResource. +func (j *JobResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "eTag": + err = unpopulate(val, "ETag", &j.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &j.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + j.Properties, err = unmarshalJobClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &j.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobResourceList. +func (j JobResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobResourceList. +func (j *JobResourceList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KEKDetails. +func (k KEKDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyBackupData", k.KeyBackupData) + populate(objectMap, "keyUrl", k.KeyURL) + populate(objectMap, "keyVaultId", k.KeyVaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KEKDetails. +func (k *KEKDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyBackupData": + err = unpopulate(val, "KeyBackupData", &k.KeyBackupData) + delete(rawMsg, key) + case "keyUrl": + err = unpopulate(val, "KeyURL", &k.KeyURL) + delete(rawMsg, key) + case "keyVaultId": + err = unpopulate(val, "KeyVaultID", &k.KeyVaultID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KPIResourceHealthDetails. +func (k KPIResourceHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resourceHealthDetails", k.ResourceHealthDetails) + populate(objectMap, "resourceHealthStatus", k.ResourceHealthStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KPIResourceHealthDetails. +func (k *KPIResourceHealthDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceHealthDetails": + err = unpopulate(val, "ResourceHealthDetails", &k.ResourceHealthDetails) + delete(rawMsg, key) + case "resourceHealthStatus": + err = unpopulate(val, "ResourceHealthStatus", &k.ResourceHealthStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyAndSecretDetails. +func (k KeyAndSecretDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bekDetails", k.BekDetails) + populate(objectMap, "encryptionMechanism", k.EncryptionMechanism) + populate(objectMap, "kekDetails", k.KekDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyAndSecretDetails. +func (k *KeyAndSecretDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bekDetails": + err = unpopulate(val, "BekDetails", &k.BekDetails) + delete(rawMsg, key) + case "encryptionMechanism": + err = unpopulate(val, "EncryptionMechanism", &k.EncryptionMechanism) + delete(rawMsg, key) + case "kekDetails": + err = unpopulate(val, "KekDetails", &k.KekDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListRecoveryPointsRecommendedForMoveRequest. +func (l ListRecoveryPointsRecommendedForMoveRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "excludedRPList", l.ExcludedRPList) + populate(objectMap, "objectType", l.ObjectType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListRecoveryPointsRecommendedForMoveRequest. +func (l *ListRecoveryPointsRecommendedForMoveRequest) UnmarshalJSON(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 "excludedRPList": + err = unpopulate(val, "ExcludedRPList", &l.ExcludedRPList) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &l.ObjectType) + 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 LogSchedulePolicy. +func (l LogSchedulePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "scheduleFrequencyInMins", l.ScheduleFrequencyInMins) + objectMap["schedulePolicyType"] = "LogSchedulePolicy" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSchedulePolicy. +func (l *LogSchedulePolicy) UnmarshalJSON(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 "scheduleFrequencyInMins": + err = unpopulate(val, "ScheduleFrequencyInMins", &l.ScheduleFrequencyInMins) + delete(rawMsg, key) + case "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &l.SchedulePolicyType) + 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 LongTermRetentionPolicy. +func (l LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dailySchedule", l.DailySchedule) + populate(objectMap, "monthlySchedule", l.MonthlySchedule) + objectMap["retentionPolicyType"] = "LongTermRetentionPolicy" + populate(objectMap, "weeklySchedule", l.WeeklySchedule) + populate(objectMap, "yearlySchedule", l.YearlySchedule) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionPolicy. +func (l *LongTermRetentionPolicy) UnmarshalJSON(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 "dailySchedule": + err = unpopulate(val, "DailySchedule", &l.DailySchedule) + delete(rawMsg, key) + case "monthlySchedule": + err = unpopulate(val, "MonthlySchedule", &l.MonthlySchedule) + delete(rawMsg, key) + case "retentionPolicyType": + err = unpopulate(val, "RetentionPolicyType", &l.RetentionPolicyType) + delete(rawMsg, key) + case "weeklySchedule": + err = unpopulate(val, "WeeklySchedule", &l.WeeklySchedule) + delete(rawMsg, key) + case "yearlySchedule": + err = unpopulate(val, "YearlySchedule", &l.YearlySchedule) + 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 LongTermSchedulePolicy. +func (l LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["schedulePolicyType"] = "LongTermSchedulePolicy" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermSchedulePolicy. +func (l *LongTermSchedulePolicy) UnmarshalJSON(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 "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &l.SchedulePolicyType) + 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 MABContainerHealthDetails. +func (m MABContainerHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", m.Code) + populate(objectMap, "message", m.Message) + populate(objectMap, "recommendations", m.Recommendations) + populate(objectMap, "title", m.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MABContainerHealthDetails. +func (m *MABContainerHealthDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &m.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &m.Recommendations) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &m.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MabContainer. +func (m MabContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentVersion", m.AgentVersion) + populate(objectMap, "backupManagementType", m.BackupManagementType) + populate(objectMap, "canReRegister", m.CanReRegister) + populate(objectMap, "containerHealthState", m.ContainerHealthState) + populate(objectMap, "containerId", m.ContainerID) + objectMap["containerType"] = ProtectableContainerTypeWindows + populate(objectMap, "extendedInfo", m.ExtendedInfo) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "healthStatus", m.HealthStatus) + populate(objectMap, "mabContainerHealthDetails", m.MabContainerHealthDetails) + populate(objectMap, "protectableObjectType", m.ProtectableObjectType) + populate(objectMap, "protectedItemCount", m.ProtectedItemCount) + populate(objectMap, "registrationStatus", m.RegistrationStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabContainer. +func (m *MabContainer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "agentVersion": + err = unpopulate(val, "AgentVersion", &m.AgentVersion) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + delete(rawMsg, key) + case "canReRegister": + err = unpopulate(val, "CanReRegister", &m.CanReRegister) + delete(rawMsg, key) + case "containerHealthState": + err = unpopulate(val, "ContainerHealthState", &m.ContainerHealthState) + delete(rawMsg, key) + case "containerId": + err = unpopulate(val, "ContainerID", &m.ContainerID) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &m.ContainerType) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &m.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &m.HealthStatus) + delete(rawMsg, key) + case "mabContainerHealthDetails": + err = unpopulate(val, "MabContainerHealthDetails", &m.MabContainerHealthDetails) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &m.ProtectableObjectType) + delete(rawMsg, key) + case "protectedItemCount": + err = unpopulate(val, "ProtectedItemCount", &m.ProtectedItemCount) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &m.RegistrationStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MabContainerExtendedInfo. +func (m MabContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupItemType", m.BackupItemType) + populate(objectMap, "backupItems", m.BackupItems) + populate(objectMap, "lastBackupStatus", m.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastRefreshedAt", m.LastRefreshedAt) + populate(objectMap, "policyName", m.PolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabContainerExtendedInfo. +func (m *MabContainerExtendedInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupItemType": + err = unpopulate(val, "BackupItemType", &m.BackupItemType) + delete(rawMsg, key) + case "backupItems": + err = unpopulate(val, "BackupItems", &m.BackupItems) + delete(rawMsg, key) + case "lastBackupStatus": + err = unpopulate(val, "LastBackupStatus", &m.LastBackupStatus) + delete(rawMsg, key) + case "lastRefreshedAt": + err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &m.LastRefreshedAt) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &m.PolicyName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MabErrorInfo. +func (m MabErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorString", m.ErrorString) + populate(objectMap, "recommendations", m.Recommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabErrorInfo. +func (m *MabErrorInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorString": + err = unpopulate(val, "ErrorString", &m.ErrorString) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &m.Recommendations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MabFileFolderProtectedItem. +func (m MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", m.BackupManagementType) + populate(objectMap, "backupSetName", m.BackupSetName) + populate(objectMap, "computerName", m.ComputerName) + populate(objectMap, "containerName", m.ContainerName) + populate(objectMap, "createMode", m.CreateMode) + populate(objectMap, "deferredDeleteSyncTimeInUTC", m.DeferredDeleteSyncTimeInUTC) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", m.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", m.DeferredDeleteTimeRemaining) + populate(objectMap, "extendedInfo", m.ExtendedInfo) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "isArchiveEnabled", m.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", m.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", m.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", m.IsScheduledForDeferredDelete) + populate(objectMap, "lastBackupStatus", m.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastBackupTime", m.LastBackupTime) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", m.LastRecoveryPoint) + populate(objectMap, "policyId", m.PolicyID) + populate(objectMap, "policyName", m.PolicyName) + objectMap["protectedItemType"] = "MabFileFolderProtectedItem" + populate(objectMap, "protectionState", m.ProtectionState) + populate(objectMap, "resourceGuardOperationRequests", m.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", m.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", m.SourceResourceID) + populate(objectMap, "workloadType", m.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabFileFolderProtectedItem. +func (m *MabFileFolderProtectedItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + delete(rawMsg, key) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &m.BackupSetName) + delete(rawMsg, key) + case "computerName": + err = unpopulate(val, "ComputerName", &m.ComputerName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &m.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &m.CreateMode) + delete(rawMsg, key) + case "deferredDeleteSyncTimeInUTC": + err = unpopulate(val, "DeferredDeleteSyncTimeInUTC", &m.DeferredDeleteSyncTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &m.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &m.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &m.FriendlyName) + delete(rawMsg, key) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &m.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &m.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &m.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &m.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "lastBackupStatus": + err = unpopulate(val, "LastBackupStatus", &m.LastBackupStatus) + delete(rawMsg, key) + case "lastBackupTime": + err = unpopulateTimeRFC3339(val, "LastBackupTime", &m.LastBackupTime) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &m.LastRecoveryPoint) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &m.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &m.PolicyName) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &m.ProtectedItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &m.ProtectionState) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &m.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &m.SoftDeleteRetentionPeriod) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &m.SourceResourceID) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &m.WorkloadType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MabFileFolderProtectedItemExtendedInfo. +func (m MabFileFolderProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "lastRefreshedAt", m.LastRefreshedAt) + populateTimeRFC3339(objectMap, "oldestRecoveryPoint", m.OldestRecoveryPoint) + populate(objectMap, "recoveryPointCount", m.RecoveryPointCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabFileFolderProtectedItemExtendedInfo. +func (m *MabFileFolderProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastRefreshedAt": + err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &m.LastRefreshedAt) + delete(rawMsg, key) + case "oldestRecoveryPoint": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &m.OldestRecoveryPoint) + delete(rawMsg, key) + case "recoveryPointCount": + err = unpopulate(val, "RecoveryPointCount", &m.RecoveryPointCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MabJob. +func (m MabJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionsInfo", m.ActionsInfo) + populate(objectMap, "activityId", m.ActivityID) + populate(objectMap, "backupManagementType", m.BackupManagementType) + populate(objectMap, "duration", m.Duration) + populateTimeRFC3339(objectMap, "endTime", m.EndTime) + populate(objectMap, "entityFriendlyName", m.EntityFriendlyName) + populate(objectMap, "errorDetails", m.ErrorDetails) + populate(objectMap, "extendedInfo", m.ExtendedInfo) + objectMap["jobType"] = "MabJob" + populate(objectMap, "mabServerName", m.MabServerName) + populate(objectMap, "mabServerType", m.MabServerType) + populate(objectMap, "operation", m.Operation) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "status", m.Status) + populate(objectMap, "workloadType", m.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabJob. +func (m *MabJob) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionsInfo": + err = unpopulate(val, "ActionsInfo", &m.ActionsInfo) + delete(rawMsg, key) + case "activityId": + err = unpopulate(val, "ActivityID", &m.ActivityID) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + delete(rawMsg, key) + case "duration": + err = unpopulate(val, "Duration", &m.Duration) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) + delete(rawMsg, key) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &m.EntityFriendlyName) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &m.ErrorDetails) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &m.JobType) + delete(rawMsg, key) + case "mabServerName": + err = unpopulate(val, "MabServerName", &m.MabServerName) + delete(rawMsg, key) + case "mabServerType": + err = unpopulate(val, "MabServerType", &m.MabServerType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &m.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &m.WorkloadType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MabJobExtendedInfo. +func (m MabJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dynamicErrorMessage", m.DynamicErrorMessage) + populate(objectMap, "propertyBag", m.PropertyBag) + populate(objectMap, "tasksList", m.TasksList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabJobExtendedInfo. +func (m *MabJobExtendedInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &m.DynamicErrorMessage) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &m.PropertyBag) + delete(rawMsg, key) + case "tasksList": + err = unpopulate(val, "TasksList", &m.TasksList) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MabJobTaskDetails. +func (m MabJobTaskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "duration", m.Duration) + populateTimeRFC3339(objectMap, "endTime", m.EndTime) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "status", m.Status) + populate(objectMap, "taskId", m.TaskID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabJobTaskDetails. +func (m *MabJobTaskDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "duration": + err = unpopulate(val, "Duration", &m.Duration) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &m.TaskID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MabProtectionPolicy. +func (m MabProtectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["backupManagementType"] = "MAB" + populate(objectMap, "protectedItemsCount", m.ProtectedItemsCount) + populate(objectMap, "resourceGuardOperationRequests", m.ResourceGuardOperationRequests) + populate(objectMap, "retentionPolicy", m.RetentionPolicy) + populate(objectMap, "schedulePolicy", m.SchedulePolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabProtectionPolicy. +func (m *MabProtectionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + delete(rawMsg, key) + case "protectedItemsCount": + err = unpopulate(val, "ProtectedItemsCount", &m.ProtectedItemsCount) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &m.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "retentionPolicy": + m.RetentionPolicy, err = unmarshalRetentionPolicyClassification(val) + delete(rawMsg, key) + case "schedulePolicy": + m.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MonthlyRetentionSchedule. +func (m MonthlyRetentionSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "retentionDuration", m.RetentionDuration) + populate(objectMap, "retentionScheduleDaily", m.RetentionScheduleDaily) + populate(objectMap, "retentionScheduleFormatType", m.RetentionScheduleFormatType) + populate(objectMap, "retentionScheduleWeekly", m.RetentionScheduleWeekly) + aux := make([]*timeRFC3339, len(m.RetentionTimes), len(m.RetentionTimes)) + for i := 0; i < len(m.RetentionTimes); i++ { + aux[i] = (*timeRFC3339)(m.RetentionTimes[i]) + } + populate(objectMap, "retentionTimes", aux) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonthlyRetentionSchedule. +func (m *MonthlyRetentionSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "retentionDuration": + err = unpopulate(val, "RetentionDuration", &m.RetentionDuration) + delete(rawMsg, key) + case "retentionScheduleDaily": + err = unpopulate(val, "RetentionScheduleDaily", &m.RetentionScheduleDaily) + delete(rawMsg, key) + case "retentionScheduleFormatType": + err = unpopulate(val, "RetentionScheduleFormatType", &m.RetentionScheduleFormatType) + delete(rawMsg, key) + case "retentionScheduleWeekly": + err = unpopulate(val, "RetentionScheduleWeekly", &m.RetentionScheduleWeekly) + delete(rawMsg, key) + case "retentionTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "RetentionTimes", &aux) + for _, au := range aux { + m.RetentionTimes = append(m.RetentionTimes, (*time.Time)(au)) + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MoveRPAcrossTiersRequest. +func (m MoveRPAcrossTiersRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "objectType", m.ObjectType) + populate(objectMap, "sourceTierType", m.SourceTierType) + populate(objectMap, "targetTierType", m.TargetTierType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MoveRPAcrossTiersRequest. +func (m *MoveRPAcrossTiersRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "objectType": + err = unpopulate(val, "ObjectType", &m.ObjectType) + delete(rawMsg, key) + case "sourceTierType": + err = unpopulate(val, "SourceTierType", &m.SourceTierType) + delete(rawMsg, key) + case "targetTierType": + err = unpopulate(val, "TargetTierType", &m.TargetTierType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NameInfo. +func (n NameInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "localizedValue", n.LocalizedValue) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NameInfo. +func (n *NameInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &n.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NewErrorResponse. +func (n NewErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", n.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NewErrorResponse. +func (n *NewErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &n.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NewErrorResponseError. +func (n NewErrorResponseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", n.AdditionalInfo) + populate(objectMap, "code", n.Code) + populate(objectMap, "details", n.Details) + populate(objectMap, "message", n.Message) + populate(objectMap, "target", n.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NewErrorResponseError. +func (n *NewErrorResponseError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &n.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &n.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &n.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &n.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &n.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationResultInfo. +func (o OperationResultInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "jobList", o.JobList) + objectMap["objectType"] = "OperationResultInfo" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfo. +func (o *OperationResultInfo) UnmarshalJSON(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 "jobList": + err = unpopulate(val, "JobList", &o.JobList) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationResultInfoBase. +func (o OperationResultInfoBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = o.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfoBase. +func (o *OperationResultInfoBase) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationResultInfoBaseResource. +func (o OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "headers", o.Headers) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "statusCode", o.StatusCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfoBaseResource. +func (o *OperationResultInfoBaseResource) UnmarshalJSON(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 "headers": + err = unpopulate(val, "Headers", &o.Headers) + delete(rawMsg, key) + case "operation": + o.Operation, err = unmarshalOperationResultInfoBaseClassification(val) + delete(rawMsg, key) + case "statusCode": + err = unpopulate(val, "StatusCode", &o.StatusCode) + 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, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + 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 "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + o.Properties, err = unmarshalOperationStatusExtendedInfoClassification(val) + 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 OperationStatusError. +func (o OperationStatusError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", o.Code) + populate(objectMap, "message", o.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusError. +func (o *OperationStatusError) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &o.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + 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 OperationStatusExtendedInfo. +func (o OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = o.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusExtendedInfo. +func (o *OperationStatusExtendedInfo) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationStatusJobExtendedInfo. +func (o OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "jobId", o.JobID) + objectMap["objectType"] = "OperationStatusJobExtendedInfo" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusJobExtendedInfo. +func (o *OperationStatusJobExtendedInfo) UnmarshalJSON(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 "jobId": + err = unpopulate(val, "JobID", &o.JobID) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationStatusJobsExtendedInfo. +func (o OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "failedJobsError", o.FailedJobsError) + populate(objectMap, "jobIds", o.JobIDs) + objectMap["objectType"] = "OperationStatusJobsExtendedInfo" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusJobsExtendedInfo. +func (o *OperationStatusJobsExtendedInfo) UnmarshalJSON(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 "failedJobsError": + err = unpopulate(val, "FailedJobsError", &o.FailedJobsError) + delete(rawMsg, key) + case "jobIds": + err = unpopulate(val, "JobIDs", &o.JobIDs) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationStatusProvisionILRExtendedInfo. +func (o OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = "OperationStatusProvisionILRExtendedInfo" + populate(objectMap, "recoveryTarget", o.RecoveryTarget) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusProvisionILRExtendedInfo. +func (o *OperationStatusProvisionILRExtendedInfo) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + delete(rawMsg, key) + case "recoveryTarget": + err = unpopulate(val, "RecoveryTarget", &o.RecoveryTarget) + 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 OperationStatusValidateOperationExtendedInfo. +func (o OperationStatusValidateOperationExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = "OperationStatusValidateOperationExtendedInfo" + populate(objectMap, "validateOperationResponse", o.ValidateOperationResponse) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusValidateOperationExtendedInfo. +func (o *OperationStatusValidateOperationExtendedInfo) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + delete(rawMsg, key) + case "validateOperationResponse": + err = unpopulate(val, "ValidateOperationResponse", &o.ValidateOperationResponse) + 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 OperationWorkerResponse. +func (o OperationWorkerResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "headers", o.Headers) + populate(objectMap, "statusCode", o.StatusCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationWorkerResponse. +func (o *OperationWorkerResponse) UnmarshalJSON(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 "headers": + err = unpopulate(val, "Headers", &o.Headers) + delete(rawMsg, key) + case "statusCode": + err = unpopulate(val, "StatusCode", &o.StatusCode) + 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 PointInTimeRange. +func (p PointInTimeRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", p.EndTime) + populateTimeRFC3339(objectMap, "startTime", p.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PointInTimeRange. +func (p *PointInTimeRange) UnmarshalJSON(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 "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &p.EndTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) + 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 PreBackupValidation. +func (p PreBackupValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", p.Code) + populate(objectMap, "message", p.Message) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PreBackupValidation. +func (p *PreBackupValidation) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &p.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &p.Message) + 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 PreValidateEnableBackupRequest. +func (p PreValidateEnableBackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "resourceId", p.ResourceID) + populate(objectMap, "resourceType", p.ResourceType) + populate(objectMap, "vaultId", p.VaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PreValidateEnableBackupRequest. +func (p *PreValidateEnableBackupRequest) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &p.ResourceID) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &p.ResourceType) + delete(rawMsg, key) + case "vaultId": + err = unpopulate(val, "VaultID", &p.VaultID) + 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 PreValidateEnableBackupResponse. +func (p PreValidateEnableBackupResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "containerName", p.ContainerName) + populate(objectMap, "errorCode", p.ErrorCode) + populate(objectMap, "errorMessage", p.ErrorMessage) + populate(objectMap, "protectedItemName", p.ProtectedItemName) + populate(objectMap, "recommendation", p.Recommendation) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PreValidateEnableBackupResponse. +func (p *PreValidateEnableBackupResponse) UnmarshalJSON(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 "containerName": + err = unpopulate(val, "ContainerName", &p.ContainerName) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &p.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &p.ErrorMessage) + delete(rawMsg, key) + case "protectedItemName": + err = unpopulate(val, "ProtectedItemName", &p.ProtectedItemName) + delete(rawMsg, key) + case "recommendation": + err = unpopulate(val, "Recommendation", &p.Recommendation) + 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 PrepareDataMoveRequest. +func (p PrepareDataMoveRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataMoveLevel", p.DataMoveLevel) + populate(objectMap, "ignoreMoved", p.IgnoreMoved) + populate(objectMap, "sourceContainerArmIds", p.SourceContainerArmIDs) + populate(objectMap, "targetRegion", p.TargetRegion) + populate(objectMap, "targetResourceId", p.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrepareDataMoveRequest. +func (p *PrepareDataMoveRequest) UnmarshalJSON(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 "dataMoveLevel": + err = unpopulate(val, "DataMoveLevel", &p.DataMoveLevel) + delete(rawMsg, key) + case "ignoreMoved": + err = unpopulate(val, "IgnoreMoved", &p.IgnoreMoved) + delete(rawMsg, key) + case "sourceContainerArmIds": + err = unpopulate(val, "SourceContainerArmIDs", &p.SourceContainerArmIDs) + delete(rawMsg, key) + case "targetRegion": + err = unpopulate(val, "TargetRegion", &p.TargetRegion) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &p.TargetResourceID) + 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 PrepareDataMoveResponse. +func (p PrepareDataMoveResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "correlationId", p.CorrelationID) + objectMap["objectType"] = "PrepareDataMoveResponse" + populate(objectMap, "sourceVaultProperties", p.SourceVaultProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrepareDataMoveResponse. +func (p *PrepareDataMoveResponse) UnmarshalJSON(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 "correlationId": + err = unpopulate(val, "CorrelationID", &p.CorrelationID) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &p.ObjectType) + delete(rawMsg, key) + case "sourceVaultProperties": + err = unpopulate(val, "SourceVaultProperties", &p.SourceVaultProperties) + 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, "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 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 "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 PrivateEndpointConnectionResource. +func (p PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionResource. +func (p *PrivateEndpointConnectionResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionRequired", p.ActionRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionRequired": + err = unpopulate(val, "ActionRequired", &p.ActionRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProtectableContainer. +func (p ProtectableContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "containerId", p.ContainerID) + populate(objectMap, "friendlyName", p.FriendlyName) + populate(objectMap, "healthStatus", p.HealthStatus) + objectMap["protectableContainerType"] = p.ProtectableContainerType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectableContainer. +func (p *ProtectableContainer) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "containerId": + err = unpopulate(val, "ContainerID", &p.ContainerID) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &p.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &p.HealthStatus) + delete(rawMsg, key) + case "protectableContainerType": + err = unpopulate(val, "ProtectableContainerType", &p.ProtectableContainerType) + 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 ProtectableContainerResource. +func (p ProtectableContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectableContainerResource. +func (p *ProtectableContainerResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectableContainerClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectableContainerResourceList. +func (p ProtectableContainerResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectableContainerResourceList. +func (p *ProtectableContainerResourceList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 ProtectedItem. +func (p ProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "backupSetName", p.BackupSetName) + populate(objectMap, "containerName", p.ContainerName) + populate(objectMap, "createMode", p.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", p.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", p.DeferredDeleteTimeRemaining) + populate(objectMap, "isArchiveEnabled", p.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", p.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", p.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", p.IsScheduledForDeferredDelete) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", p.LastRecoveryPoint) + populate(objectMap, "policyId", p.PolicyID) + populate(objectMap, "policyName", p.PolicyName) + objectMap["protectedItemType"] = p.ProtectedItemType + populate(objectMap, "resourceGuardOperationRequests", p.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", p.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", p.SourceResourceID) + populate(objectMap, "workloadType", p.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItem. +func (p *ProtectedItem) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &p.BackupSetName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &p.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &p.CreateMode) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &p.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &p.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &p.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &p.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &p.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &p.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &p.LastRecoveryPoint) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &p.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &p.PolicyName) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &p.ProtectedItemType) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &p.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &p.SoftDeleteRetentionPeriod) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &p.SourceResourceID) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &p.WorkloadType) + 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 ProtectedItemQueryObject. +func (p ProtectedItemQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupEngineName", p.BackupEngineName) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "backupSetName", p.BackupSetName) + populate(objectMap, "containerName", p.ContainerName) + populate(objectMap, "fabricName", p.FabricName) + populate(objectMap, "friendlyName", p.FriendlyName) + populate(objectMap, "healthState", p.HealthState) + populate(objectMap, "itemType", p.ItemType) + populate(objectMap, "policyName", p.PolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItemQueryObject. +func (p *ProtectedItemQueryObject) UnmarshalJSON(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 "backupEngineName": + err = unpopulate(val, "BackupEngineName", &p.BackupEngineName) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &p.BackupSetName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &p.ContainerName) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &p.FabricName) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &p.FriendlyName) + delete(rawMsg, key) + case "healthState": + err = unpopulate(val, "HealthState", &p.HealthState) + delete(rawMsg, key) + case "itemType": + err = unpopulate(val, "ItemType", &p.ItemType) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &p.PolicyName) + 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 ProtectedItemResource. +func (p ProtectedItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItemResource. +func (p *ProtectedItemResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectedItemClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectedItemResourceList. +func (p ProtectedItemResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItemResourceList. +func (p *ProtectedItemResourceList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 ProtectionContainer. +func (p ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", p.BackupManagementType) + objectMap["containerType"] = p.ContainerType + populate(objectMap, "friendlyName", p.FriendlyName) + populate(objectMap, "healthStatus", p.HealthStatus) + populate(objectMap, "protectableObjectType", p.ProtectableObjectType) + populate(objectMap, "registrationStatus", p.RegistrationStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionContainer. +func (p *ProtectionContainer) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &p.ContainerType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &p.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &p.HealthStatus) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &p.ProtectableObjectType) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &p.RegistrationStatus) + 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 ProtectionContainerResource. +func (p ProtectionContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionContainerResource. +func (p *ProtectionContainerResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectionContainerClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectionContainerResourceList. +func (p ProtectionContainerResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionContainerResourceList. +func (p *ProtectionContainerResourceList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 ProtectionIntent. +func (p ProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "itemId", p.ItemID) + populate(objectMap, "policyId", p.PolicyID) + objectMap["protectionIntentItemType"] = p.ProtectionIntentItemType + populate(objectMap, "protectionState", p.ProtectionState) + populate(objectMap, "sourceResourceId", p.SourceResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionIntent. +func (p *ProtectionIntent) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "itemId": + err = unpopulate(val, "ItemID", &p.ItemID) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &p.PolicyID) + delete(rawMsg, key) + case "protectionIntentItemType": + err = unpopulate(val, "ProtectionIntentItemType", &p.ProtectionIntentItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &p.ProtectionState) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &p.SourceResourceID) + 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 ProtectionIntentQueryObject. +func (p ProtectionIntentQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "itemName", p.ItemName) + populate(objectMap, "itemType", p.ItemType) + populate(objectMap, "parentName", p.ParentName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionIntentQueryObject. +func (p *ProtectionIntentQueryObject) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "itemName": + err = unpopulate(val, "ItemName", &p.ItemName) + delete(rawMsg, key) + case "itemType": + err = unpopulate(val, "ItemType", &p.ItemType) + delete(rawMsg, key) + case "parentName": + err = unpopulate(val, "ParentName", &p.ParentName) + 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 ProtectionIntentResource. +func (p ProtectionIntentResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionIntentResource. +func (p *ProtectionIntentResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectionIntentClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectionIntentResourceList. +func (p ProtectionIntentResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionIntentResourceList. +func (p *ProtectionIntentResourceList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 ProtectionPolicy. +func (p ProtectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["backupManagementType"] = p.BackupManagementType + populate(objectMap, "protectedItemsCount", p.ProtectedItemsCount) + populate(objectMap, "resourceGuardOperationRequests", p.ResourceGuardOperationRequests) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionPolicy. +func (p *ProtectionPolicy) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "protectedItemsCount": + err = unpopulate(val, "ProtectedItemsCount", &p.ProtectedItemsCount) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &p.ResourceGuardOperationRequests) + 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 ProtectionPolicyQueryObject. +func (p ProtectionPolicyQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "fabricName", p.FabricName) + populate(objectMap, "workloadType", p.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionPolicyQueryObject. +func (p *ProtectionPolicyQueryObject) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &p.FabricName) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &p.WorkloadType) + 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 ProtectionPolicyResource. +func (p ProtectionPolicyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionPolicyResource. +func (p *ProtectionPolicyResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectionPolicyClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectionPolicyResourceList. +func (p ProtectionPolicyResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionPolicyResourceList. +func (p *ProtectionPolicyResourceList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, 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 RecoveryPoint. +func (r RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = r.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPoint. +func (r *RecoveryPoint) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &r.ObjectType) + 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 RecoveryPointDiskConfiguration. +func (r RecoveryPointDiskConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "excludedDiskList", r.ExcludedDiskList) + populate(objectMap, "includedDiskList", r.IncludedDiskList) + populate(objectMap, "numberOfDisksAttachedToVm", r.NumberOfDisksAttachedToVM) + populate(objectMap, "numberOfDisksIncludedInBackup", r.NumberOfDisksIncludedInBackup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointDiskConfiguration. +func (r *RecoveryPointDiskConfiguration) UnmarshalJSON(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 "excludedDiskList": + err = unpopulate(val, "ExcludedDiskList", &r.ExcludedDiskList) + delete(rawMsg, key) + case "includedDiskList": + err = unpopulate(val, "IncludedDiskList", &r.IncludedDiskList) + delete(rawMsg, key) + case "numberOfDisksAttachedToVm": + err = unpopulate(val, "NumberOfDisksAttachedToVM", &r.NumberOfDisksAttachedToVM) + delete(rawMsg, key) + case "numberOfDisksIncludedInBackup": + err = unpopulate(val, "NumberOfDisksIncludedInBackup", &r.NumberOfDisksIncludedInBackup) + 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 RecoveryPointMoveReadinessInfo. +func (r RecoveryPointMoveReadinessInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", r.AdditionalInfo) + populate(objectMap, "isReadyForMove", r.IsReadyForMove) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointMoveReadinessInfo. +func (r *RecoveryPointMoveReadinessInfo) UnmarshalJSON(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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &r.AdditionalInfo) + delete(rawMsg, key) + case "isReadyForMove": + err = unpopulate(val, "IsReadyForMove", &r.IsReadyForMove) + 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 RecoveryPointRehydrationInfo. +func (r RecoveryPointRehydrationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "rehydrationPriority", r.RehydrationPriority) + populate(objectMap, "rehydrationRetentionDuration", r.RehydrationRetentionDuration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointRehydrationInfo. +func (r *RecoveryPointRehydrationInfo) UnmarshalJSON(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 "rehydrationPriority": + err = unpopulate(val, "RehydrationPriority", &r.RehydrationPriority) + delete(rawMsg, key) + case "rehydrationRetentionDuration": + err = unpopulate(val, "RehydrationRetentionDuration", &r.RehydrationRetentionDuration) + 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 RecoveryPointResource. +func (r RecoveryPointResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", r.ETag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointResource. +func (r *RecoveryPointResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &r.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + r.Properties, err = unmarshalRecoveryPointClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + 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 } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobQueryObject. -func (j *JobQueryObject) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type RecoveryPointResourceList. +func (r RecoveryPointResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointResourceList. +func (r *RecoveryPointResourceList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &j.BackupManagementType) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "jobId": - err = unpopulate(val, "JobID", &j.JobID) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &j.Operation) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobResource. -func (j JobResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecoveryPointTierInformation. +func (r RecoveryPointTierInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", j.ETag) - populate(objectMap, "id", j.ID) - populate(objectMap, "location", j.Location) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "tags", j.Tags) - populate(objectMap, "type", j.Type) + populate(objectMap, "extendedInfo", r.ExtendedInfo) + populate(objectMap, "status", r.Status) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobResource. -func (j *JobResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointTierInformation. +func (r *RecoveryPointTierInformation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &j.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &j.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &j.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "properties": - j.Properties, err = unmarshalJobClassification(val) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &r.ExtendedInfo) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &j.Tags) + case "status": + err = unpopulate(val, "Status", &r.Status) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &j.Type) + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KPIResourceHealthDetails. -func (k KPIResourceHealthDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "resourceHealthDetails", k.ResourceHealthDetails) - populate(objectMap, "resourceHealthStatus", k.ResourceHealthStatus) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ListRecoveryPointsRecommendedForMoveRequest. -func (l ListRecoveryPointsRecommendedForMoveRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "excludedRPList", l.ExcludedRPList) - populate(objectMap, "objectType", l.ObjectType) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogSchedulePolicy. -func (l LogSchedulePolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecoveryPointTierInformationV2. +func (r RecoveryPointTierInformationV2) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "scheduleFrequencyInMins", l.ScheduleFrequencyInMins) - objectMap["schedulePolicyType"] = "LogSchedulePolicy" + populate(objectMap, "extendedInfo", r.ExtendedInfo) + populate(objectMap, "status", r.Status) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogSchedulePolicy. -func (l *LogSchedulePolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointTierInformationV2. +func (r *RecoveryPointTierInformationV2) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "scheduleFrequencyInMins": - err = unpopulate(val, "ScheduleFrequencyInMins", &l.ScheduleFrequencyInMins) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &r.ExtendedInfo) delete(rawMsg, key) - case "schedulePolicyType": - err = unpopulate(val, "SchedulePolicyType", &l.SchedulePolicyType) + case "status": + err = unpopulate(val, "Status", &r.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicy. -func (l LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "dailySchedule", l.DailySchedule) - populate(objectMap, "monthlySchedule", l.MonthlySchedule) - objectMap["retentionPolicyType"] = "LongTermRetentionPolicy" - populate(objectMap, "weeklySchedule", l.WeeklySchedule) - populate(objectMap, "yearlySchedule", l.YearlySchedule) + populate(objectMap, "eTag", r.ETag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionPolicy. -func (l *LongTermRetentionPolicy) UnmarshalJSON(data []byte) error { +// 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "dailySchedule": - err = unpopulate(val, "DailySchedule", &l.DailySchedule) + case "eTag": + err = unpopulate(val, "ETag", &r.ETag) delete(rawMsg, key) - case "monthlySchedule": - err = unpopulate(val, "MonthlySchedule", &l.MonthlySchedule) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "retentionPolicyType": - err = unpopulate(val, "RetentionPolicyType", &l.RetentionPolicyType) + case "location": + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) - case "weeklySchedule": - err = unpopulate(val, "WeeklySchedule", &l.WeeklySchedule) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "yearlySchedule": - err = unpopulate(val, "YearlySchedule", &l.YearlySchedule) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermSchedulePolicy. -func (l LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceGuardOperationDetail. +func (r ResourceGuardOperationDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["schedulePolicyType"] = "LongTermSchedulePolicy" + populate(objectMap, "defaultResourceRequest", r.DefaultResourceRequest) + populate(objectMap, "vaultCriticalOperation", r.VaultCriticalOperation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermSchedulePolicy. -func (l *LongTermSchedulePolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardOperationDetail. +func (r *ResourceGuardOperationDetail) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "schedulePolicyType": - err = unpopulate(val, "SchedulePolicyType", &l.SchedulePolicyType) + case "defaultResourceRequest": + err = unpopulate(val, "DefaultResourceRequest", &r.DefaultResourceRequest) + delete(rawMsg, key) + case "vaultCriticalOperation": + err = unpopulate(val, "VaultCriticalOperation", &r.VaultCriticalOperation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MABContainerHealthDetails. -func (m MABContainerHealthDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", m.Code) - populate(objectMap, "message", m.Message) - populate(objectMap, "recommendations", m.Recommendations) - populate(objectMap, "title", m.Title) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MabContainer. -func (m MabContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBase. +func (r ResourceGuardProxyBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "agentVersion", m.AgentVersion) - populate(objectMap, "backupManagementType", m.BackupManagementType) - populate(objectMap, "canReRegister", m.CanReRegister) - populate(objectMap, "containerHealthState", m.ContainerHealthState) - populate(objectMap, "containerId", m.ContainerID) - objectMap["containerType"] = ContainerTypeWindows - populate(objectMap, "extendedInfo", m.ExtendedInfo) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "healthStatus", m.HealthStatus) - populate(objectMap, "mabContainerHealthDetails", m.MabContainerHealthDetails) - populate(objectMap, "protectableObjectType", m.ProtectableObjectType) - populate(objectMap, "protectedItemCount", m.ProtectedItemCount) - populate(objectMap, "registrationStatus", m.RegistrationStatus) + populate(objectMap, "description", r.Description) + populate(objectMap, "lastUpdatedTime", r.LastUpdatedTime) + populate(objectMap, "resourceGuardOperationDetails", r.ResourceGuardOperationDetails) + populate(objectMap, "resourceGuardResourceId", r.ResourceGuardResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabContainer. -func (m *MabContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardProxyBase. +func (r *ResourceGuardProxyBase) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + 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", &m.AgentVersion) - delete(rawMsg, key) - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) - delete(rawMsg, key) - case "canReRegister": - err = unpopulate(val, "CanReRegister", &m.CanReRegister) + case "description": + err = unpopulate(val, "Description", &r.Description) delete(rawMsg, key) - case "containerHealthState": - err = unpopulate(val, "ContainerHealthState", &m.ContainerHealthState) + case "lastUpdatedTime": + err = unpopulate(val, "LastUpdatedTime", &r.LastUpdatedTime) delete(rawMsg, key) - case "containerId": - err = unpopulate(val, "ContainerID", &m.ContainerID) + case "resourceGuardOperationDetails": + err = unpopulate(val, "ResourceGuardOperationDetails", &r.ResourceGuardOperationDetails) delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &m.ContainerType) + case "resourceGuardResourceId": + err = unpopulate(val, "ResourceGuardResourceID", &r.ResourceGuardResourceID) delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBaseResource. +func (r ResourceGuardProxyBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eTag", r.ETag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardProxyBaseResource. +func (r *ResourceGuardProxyBaseResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &r.ETag) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &m.FriendlyName) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &m.HealthStatus) + case "location": + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) - case "mabContainerHealthDetails": - err = unpopulate(val, "MabContainerHealthDetails", &m.MabContainerHealthDetails) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &m.ProtectableObjectType) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) - case "protectedItemCount": - err = unpopulate(val, "ProtectedItemCount", &m.ProtectedItemCount) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &m.RegistrationStatus) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabContainerExtendedInfo. -func (m MabContainerExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBaseResourceList. +func (r ResourceGuardProxyBaseResourceList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupItemType", m.BackupItemType) - populate(objectMap, "backupItems", m.BackupItems) - populate(objectMap, "lastBackupStatus", m.LastBackupStatus) - populateTimeRFC3339(objectMap, "lastRefreshedAt", m.LastRefreshedAt) - populate(objectMap, "policyName", m.PolicyName) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabContainerExtendedInfo. -func (m *MabContainerExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardProxyBaseResourceList. +func (r *ResourceGuardProxyBaseResourceList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "backupItemType": - err = unpopulate(val, "BackupItemType", &m.BackupItemType) - delete(rawMsg, key) - case "backupItems": - err = unpopulate(val, "BackupItems", &m.BackupItems) - delete(rawMsg, key) - case "lastBackupStatus": - err = unpopulate(val, "LastBackupStatus", &m.LastBackupStatus) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "lastRefreshedAt": - err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &m.LastRefreshedAt) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &m.PolicyName) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabErrorInfo. -func (m MabErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorString", m.ErrorString) - populate(objectMap, "recommendations", m.Recommendations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MabFileFolderProtectedItem. -func (m MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceHealthDetails. +func (r ResourceHealthDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", m.BackupManagementType) - populate(objectMap, "backupSetName", m.BackupSetName) - populate(objectMap, "computerName", m.ComputerName) - populate(objectMap, "containerName", m.ContainerName) - populate(objectMap, "createMode", m.CreateMode) - populate(objectMap, "deferredDeleteSyncTimeInUTC", m.DeferredDeleteSyncTimeInUTC) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", m.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", m.DeferredDeleteTimeRemaining) - populate(objectMap, "extendedInfo", m.ExtendedInfo) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "isArchiveEnabled", m.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", m.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", m.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", m.IsScheduledForDeferredDelete) - populate(objectMap, "lastBackupStatus", m.LastBackupStatus) - populateTimeRFC3339(objectMap, "lastBackupTime", m.LastBackupTime) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", m.LastRecoveryPoint) - populate(objectMap, "policyId", m.PolicyID) - populate(objectMap, "policyName", m.PolicyName) - objectMap["protectedItemType"] = "MabFileFolderProtectedItem" - populate(objectMap, "protectionState", m.ProtectionState) - populate(objectMap, "resourceGuardOperationRequests", m.ResourceGuardOperationRequests) - populate(objectMap, "sourceResourceId", m.SourceResourceID) - populate(objectMap, "workloadType", m.WorkloadType) + populate(objectMap, "code", r.Code) + populate(objectMap, "message", r.Message) + populate(objectMap, "recommendations", r.Recommendations) + populate(objectMap, "title", r.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabFileFolderProtectedItem. -func (m *MabFileFolderProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceHealthDetails. +func (r *ResourceHealthDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) - delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &m.BackupSetName) - delete(rawMsg, key) - case "computerName": - err = unpopulate(val, "ComputerName", &m.ComputerName) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &m.ContainerName) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &m.CreateMode) - delete(rawMsg, key) - case "deferredDeleteSyncTimeInUTC": - err = unpopulate(val, "DeferredDeleteSyncTimeInUTC", &m.DeferredDeleteSyncTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &m.DeferredDeleteTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &m.DeferredDeleteTimeRemaining) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &m.FriendlyName) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &m.IsArchiveEnabled) - delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &m.IsDeferredDeleteScheduleUpcoming) - delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &m.IsRehydrate) - delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &m.IsScheduledForDeferredDelete) - delete(rawMsg, key) - case "lastBackupStatus": - err = unpopulate(val, "LastBackupStatus", &m.LastBackupStatus) - delete(rawMsg, key) - case "lastBackupTime": - err = unpopulateTimeRFC3339(val, "LastBackupTime", &m.LastBackupTime) - delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &m.LastRecoveryPoint) - delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &m.PolicyID) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &m.PolicyName) - delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &m.ProtectedItemType) - delete(rawMsg, key) - case "protectionState": - err = unpopulate(val, "ProtectionState", &m.ProtectionState) + case "code": + err = unpopulate(val, "Code", &r.Code) delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &m.ResourceGuardOperationRequests) + case "message": + err = unpopulate(val, "Message", &r.Message) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &m.SourceResourceID) + case "recommendations": + err = unpopulate(val, "Recommendations", &r.Recommendations) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &m.WorkloadType) + case "title": + err = unpopulate(val, "Title", &r.Title) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabFileFolderProtectedItemExtendedInfo. -func (m MabFileFolderProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceList. +func (r ResourceList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastRefreshedAt", m.LastRefreshedAt) - populateTimeRFC3339(objectMap, "oldestRecoveryPoint", m.OldestRecoveryPoint) - populate(objectMap, "recoveryPointCount", m.RecoveryPointCount) + populate(objectMap, "nextLink", r.NextLink) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabFileFolderProtectedItemExtendedInfo. -func (m *MabFileFolderProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceList. +func (r *ResourceList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "lastRefreshedAt": - err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &m.LastRefreshedAt) - delete(rawMsg, key) - case "oldestRecoveryPoint": - err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &m.OldestRecoveryPoint) - delete(rawMsg, key) - case "recoveryPointCount": - err = unpopulate(val, "RecoveryPointCount", &m.RecoveryPointCount) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabJob. -func (m MabJob) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestoreFileSpecs. +func (r RestoreFileSpecs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "actionsInfo", m.ActionsInfo) - populate(objectMap, "activityId", m.ActivityID) - populate(objectMap, "backupManagementType", m.BackupManagementType) - populate(objectMap, "duration", m.Duration) - populateTimeRFC3339(objectMap, "endTime", m.EndTime) - populate(objectMap, "entityFriendlyName", m.EntityFriendlyName) - populate(objectMap, "errorDetails", m.ErrorDetails) - populate(objectMap, "extendedInfo", m.ExtendedInfo) - objectMap["jobType"] = "MabJob" - populate(objectMap, "mabServerName", m.MabServerName) - populate(objectMap, "mabServerType", m.MabServerType) - populate(objectMap, "operation", m.Operation) - populateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "status", m.Status) - populate(objectMap, "workloadType", m.WorkloadType) + populate(objectMap, "fileSpecType", r.FileSpecType) + populate(objectMap, "path", r.Path) + populate(objectMap, "targetFolderPath", r.TargetFolderPath) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabJob. -func (m *MabJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreFileSpecs. +func (r *RestoreFileSpecs) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "actionsInfo": - err = unpopulate(val, "ActionsInfo", &m.ActionsInfo) - delete(rawMsg, key) - case "activityId": - err = unpopulate(val, "ActivityID", &m.ActivityID) - delete(rawMsg, key) - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) - delete(rawMsg, key) - case "duration": - err = unpopulate(val, "Duration", &m.Duration) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) - delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &m.EntityFriendlyName) - delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &m.ErrorDetails) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &m.JobType) - delete(rawMsg, key) - case "mabServerName": - err = unpopulate(val, "MabServerName", &m.MabServerName) - delete(rawMsg, key) - case "mabServerType": - err = unpopulate(val, "MabServerType", &m.MabServerType) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &m.Operation) + case "fileSpecType": + err = unpopulate(val, "FileSpecType", &r.FileSpecType) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + case "path": + err = unpopulate(val, "Path", &r.Path) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "targetFolderPath": + err = unpopulate(val, "TargetFolderPath", &r.TargetFolderPath) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &m.WorkloadType) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestoreRequest. +func (r RestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["objectType"] = r.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreRequest. +func (r *RestoreRequest) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &r.ObjectType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabJobExtendedInfo. -func (m MabJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dynamicErrorMessage", m.DynamicErrorMessage) - populate(objectMap, "propertyBag", m.PropertyBag) - populate(objectMap, "tasksList", m.TasksList) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MabJobTaskDetails. -func (m MabJobTaskDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RestoreRequestResource. +func (r RestoreRequestResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "duration", m.Duration) - populateTimeRFC3339(objectMap, "endTime", m.EndTime) - populateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "status", m.Status) - populate(objectMap, "taskId", m.TaskID) + populate(objectMap, "eTag", r.ETag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabJobTaskDetails. -func (m *MabJobTaskDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreRequestResource. +func (r *RestoreRequestResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "duration": - err = unpopulate(val, "Duration", &m.Duration) + case "eTag": + err = unpopulate(val, "ETag", &r.ETag) delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + case "location": + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "taskId": - err = unpopulate(val, "TaskID", &m.TaskID) + case "properties": + r.Properties, err = unmarshalRestoreRequestClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabProtectionPolicy. -func (m MabProtectionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RetentionDuration. +func (r RetentionDuration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["backupManagementType"] = "MAB" - populate(objectMap, "protectedItemsCount", m.ProtectedItemsCount) - populate(objectMap, "resourceGuardOperationRequests", m.ResourceGuardOperationRequests) - populate(objectMap, "retentionPolicy", m.RetentionPolicy) - populate(objectMap, "schedulePolicy", m.SchedulePolicy) + populate(objectMap, "count", r.Count) + populate(objectMap, "durationType", r.DurationType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabProtectionPolicy. -func (m *MabProtectionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionDuration. +func (r *RetentionDuration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) - delete(rawMsg, key) - case "protectedItemsCount": - err = unpopulate(val, "ProtectedItemsCount", &m.ProtectedItemsCount) - delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &m.ResourceGuardOperationRequests) - delete(rawMsg, key) - case "retentionPolicy": - m.RetentionPolicy, err = unmarshalRetentionPolicyClassification(val) + case "count": + err = unpopulate(val, "Count", &r.Count) delete(rawMsg, key) - case "schedulePolicy": - m.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) + case "durationType": + err = unpopulate(val, "DurationType", &r.DurationType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MonthlyRetentionSchedule. -func (m MonthlyRetentionSchedule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RetentionPolicy. +func (r RetentionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "retentionDuration", m.RetentionDuration) - populate(objectMap, "retentionScheduleDaily", m.RetentionScheduleDaily) - populate(objectMap, "retentionScheduleFormatType", m.RetentionScheduleFormatType) - populate(objectMap, "retentionScheduleWeekly", m.RetentionScheduleWeekly) - aux := make([]*timeRFC3339, len(m.RetentionTimes), len(m.RetentionTimes)) - for i := 0; i < len(m.RetentionTimes); i++ { - aux[i] = (*timeRFC3339)(m.RetentionTimes[i]) - } - populate(objectMap, "retentionTimes", aux) + objectMap["retentionPolicyType"] = r.RetentionPolicyType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfo. -func (o *OperationResultInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionPolicy. +func (r *RetentionPolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "jobList": - err = unpopulate(val, "JobList", &o.JobList) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "retentionPolicyType": + err = unpopulate(val, "RetentionPolicyType", &r.RetentionPolicyType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfoBaseResource. -func (o *OperationResultInfoBaseResource) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type SQLDataDirectory. +func (s SQLDataDirectory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logicalName", s.LogicalName) + populate(objectMap, "path", s.Path) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDataDirectory. +func (s *SQLDataDirectory) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "headers": - err = unpopulate(val, "Headers", &o.Headers) + case "logicalName": + err = unpopulate(val, "LogicalName", &s.LogicalName) delete(rawMsg, key) - case "operation": - o.Operation, err = unmarshalOperationResultInfoBaseClassification(val) + case "path": + err = unpopulate(val, "Path", &s.Path) delete(rawMsg, key) - case "statusCode": - err = unpopulate(val, "StatusCode", &o.StatusCode) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. -func (o *OperationStatus) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type SQLDataDirectoryMapping. +func (s SQLDataDirectoryMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "mappingType", s.MappingType) + populate(objectMap, "sourceLogicalName", s.SourceLogicalName) + populate(objectMap, "sourcePath", s.SourcePath) + populate(objectMap, "targetPath", s.TargetPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDataDirectoryMapping. +func (s *SQLDataDirectoryMapping) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, 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 "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "mappingType": + err = unpopulate(val, "MappingType", &s.MappingType) delete(rawMsg, key) - case "properties": - o.Properties, err = unmarshalOperationStatusExtendedInfoClassification(val) + case "sourceLogicalName": + err = unpopulate(val, "SourceLogicalName", &s.SourceLogicalName) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) + case "sourcePath": + err = unpopulate(val, "SourcePath", &s.SourcePath) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) + case "targetPath": + err = unpopulate(val, "TargetPath", &s.TargetPath) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusJobExtendedInfo. -func (o *OperationStatusJobExtendedInfo) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type SchedulePolicy. +func (s SchedulePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["schedulePolicyType"] = s.SchedulePolicyType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchedulePolicy. +func (s *SchedulePolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "jobId": - err = unpopulate(val, "JobID", &o.JobID) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusJobsExtendedInfo. -func (o *OperationStatusJobsExtendedInfo) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type SecurityPinBase. +func (s SecurityPinBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resourceGuardOperationRequests", s.ResourceGuardOperationRequests) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPinBase. +func (s *SecurityPinBase) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "failedJobsError": - err = unpopulate(val, "FailedJobsError", &o.FailedJobsError) - delete(rawMsg, key) - case "jobIds": - err = unpopulate(val, "JobIDs", &o.JobIDs) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &s.ResourceGuardOperationRequests) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusProvisionILRExtendedInfo. -func (o *OperationStatusProvisionILRExtendedInfo) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type Settings. +func (s Settings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isCompression", s.IsCompression) + populate(objectMap, "issqlcompression", s.Issqlcompression) + populate(objectMap, "timeZone", s.TimeZone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Settings. +func (s *Settings) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "isCompression": + err = unpopulate(val, "IsCompression", &s.IsCompression) delete(rawMsg, key) - case "recoveryTarget": - err = unpopulate(val, "RecoveryTarget", &o.RecoveryTarget) + case "issqlcompression": + err = unpopulate(val, "Issqlcompression", &s.Issqlcompression) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &s.TimeZone) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusValidateOperationExtendedInfo. -func (o *OperationStatusValidateOperationExtendedInfo) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type SimpleRetentionPolicy. +func (s SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "retentionDuration", s.RetentionDuration) + objectMap["retentionPolicyType"] = "SimpleRetentionPolicy" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleRetentionPolicy. +func (s *SimpleRetentionPolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "retentionDuration": + err = unpopulate(val, "RetentionDuration", &s.RetentionDuration) delete(rawMsg, key) - case "validateOperationResponse": - err = unpopulate(val, "ValidateOperationResponse", &o.ValidateOperationResponse) + case "retentionPolicyType": + err = unpopulate(val, "RetentionPolicyType", &s.RetentionPolicyType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PointInTimeRange. -func (p PointInTimeRange) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SimpleSchedulePolicy. +func (s SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", p.EndTime) - populateTimeRFC3339(objectMap, "startTime", p.StartTime) + populate(objectMap, "hourlySchedule", s.HourlySchedule) + objectMap["schedulePolicyType"] = "SimpleSchedulePolicy" + populate(objectMap, "scheduleRunDays", s.ScheduleRunDays) + populate(objectMap, "scheduleRunFrequency", s.ScheduleRunFrequency) + aux := make([]*timeRFC3339, len(s.ScheduleRunTimes), len(s.ScheduleRunTimes)) + for i := 0; i < len(s.ScheduleRunTimes); i++ { + aux[i] = (*timeRFC3339)(s.ScheduleRunTimes[i]) + } + populate(objectMap, "scheduleRunTimes", aux) + populate(objectMap, "scheduleWeeklyFrequency", s.ScheduleWeeklyFrequency) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PointInTimeRange. -func (p *PointInTimeRange) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleSchedulePolicy. +func (s *SimpleSchedulePolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &p.EndTime) + switch key { + case "hourlySchedule": + err = unpopulate(val, "HourlySchedule", &s.HourlySchedule) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) + case "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) + delete(rawMsg, key) + case "scheduleRunDays": + err = unpopulate(val, "ScheduleRunDays", &s.ScheduleRunDays) + delete(rawMsg, key) + case "scheduleRunFrequency": + err = unpopulate(val, "ScheduleRunFrequency", &s.ScheduleRunFrequency) + delete(rawMsg, key) + case "scheduleRunTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "ScheduleRunTimes", &aux) + for _, au := range aux { + s.ScheduleRunTimes = append(s.ScheduleRunTimes, (*time.Time)(au)) + } + delete(rawMsg, key) + case "scheduleWeeklyFrequency": + err = unpopulate(val, "ScheduleWeeklyFrequency", &s.ScheduleWeeklyFrequency) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrepareDataMoveRequest. -func (p PrepareDataMoveRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SimpleSchedulePolicyV2. +func (s SimpleSchedulePolicyV2) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "dataMoveLevel", p.DataMoveLevel) - populate(objectMap, "ignoreMoved", p.IgnoreMoved) - populate(objectMap, "sourceContainerArmIds", p.SourceContainerArmIDs) - populate(objectMap, "targetRegion", p.TargetRegion) - populate(objectMap, "targetResourceId", p.TargetResourceID) + populate(objectMap, "dailySchedule", s.DailySchedule) + populate(objectMap, "hourlySchedule", s.HourlySchedule) + objectMap["schedulePolicyType"] = "SimpleSchedulePolicyV2" + populate(objectMap, "scheduleRunFrequency", s.ScheduleRunFrequency) + populate(objectMap, "weeklySchedule", s.WeeklySchedule) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrepareDataMoveResponse. -func (p *PrepareDataMoveResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleSchedulePolicyV2. +func (s *SimpleSchedulePolicyV2) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "correlationId": - err = unpopulate(val, "CorrelationID", &p.CorrelationID) + case "dailySchedule": + err = unpopulate(val, "DailySchedule", &s.DailySchedule) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &p.ObjectType) + case "hourlySchedule": + err = unpopulate(val, "HourlySchedule", &s.HourlySchedule) delete(rawMsg, key) - case "sourceVaultProperties": - err = unpopulate(val, "SourceVaultProperties", &p.SourceVaultProperties) + case "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) + delete(rawMsg, key) + case "scheduleRunFrequency": + err = unpopulate(val, "ScheduleRunFrequency", &s.ScheduleRunFrequency) + delete(rawMsg, key) + case "weeklySchedule": + err = unpopulate(val, "WeeklySchedule", &s.WeeklySchedule) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionResource. -func (p PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProtectableContainerResource. -func (p ProtectableContainerResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SubProtectionPolicy. +func (s SubProtectionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + populate(objectMap, "policyType", s.PolicyType) + populate(objectMap, "retentionPolicy", s.RetentionPolicy) + populate(objectMap, "schedulePolicy", s.SchedulePolicy) + populate(objectMap, "tieringPolicy", s.TieringPolicy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectableContainerResource. -func (p *ProtectableContainerResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SubProtectionPolicy. +func (s *SubProtectionPolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "policyType": + err = unpopulate(val, "PolicyType", &s.PolicyType) delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectableContainerClassification(val) + case "retentionPolicy": + s.RetentionPolicy, err = unmarshalRetentionPolicyClassification(val) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "schedulePolicy": + s.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "tieringPolicy": + err = unpopulate(val, "TieringPolicy", &s.TieringPolicy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectedItem. -func (p ProtectedItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TargetAFSRestoreInfo. +func (t TargetAFSRestoreInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", p.BackupManagementType) - populate(objectMap, "backupSetName", p.BackupSetName) - populate(objectMap, "containerName", p.ContainerName) - populate(objectMap, "createMode", p.CreateMode) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", p.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", p.DeferredDeleteTimeRemaining) - populate(objectMap, "isArchiveEnabled", p.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", p.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", p.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", p.IsScheduledForDeferredDelete) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", p.LastRecoveryPoint) - populate(objectMap, "policyId", p.PolicyID) - populate(objectMap, "policyName", p.PolicyName) - objectMap["protectedItemType"] = p.ProtectedItemType - populate(objectMap, "resourceGuardOperationRequests", p.ResourceGuardOperationRequests) - populate(objectMap, "sourceResourceId", p.SourceResourceID) - populate(objectMap, "workloadType", p.WorkloadType) + populate(objectMap, "name", t.Name) + populate(objectMap, "targetResourceId", t.TargetResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItem. -func (p *ProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetAFSRestoreInfo. +func (t *TargetAFSRestoreInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) - delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &p.BackupSetName) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &p.ContainerName) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &p.CreateMode) - delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &p.DeferredDeleteTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &p.DeferredDeleteTimeRemaining) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &p.IsArchiveEnabled) - delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &p.IsDeferredDeleteScheduleUpcoming) - delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &p.IsRehydrate) - delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &p.IsScheduledForDeferredDelete) - delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &p.LastRecoveryPoint) - delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &p.PolicyID) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &p.PolicyName) - delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &p.ProtectedItemType) - delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &p.ResourceGuardOperationRequests) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &p.SourceResourceID) + case "name": + err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &p.WorkloadType) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &t.TargetResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectedItemResource. -func (p ProtectedItemResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TargetRestoreInfo. +func (t TargetRestoreInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + populate(objectMap, "containerId", t.ContainerID) + populate(objectMap, "databaseName", t.DatabaseName) + populate(objectMap, "overwriteOption", t.OverwriteOption) + populate(objectMap, "targetDirectoryForFileRestore", t.TargetDirectoryForFileRestore) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItemResource. -func (p *ProtectedItemResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetRestoreInfo. +func (t *TargetRestoreInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "containerId": + err = unpopulate(val, "ContainerID", &t.ContainerID) delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectedItemClassification(val) + case "databaseName": + err = unpopulate(val, "DatabaseName", &t.DatabaseName) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "overwriteOption": + err = unpopulate(val, "OverwriteOption", &t.OverwriteOption) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "targetDirectoryForFileRestore": + err = unpopulate(val, "TargetDirectoryForFileRestore", &t.TargetDirectoryForFileRestore) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectionContainerResource. -func (p ProtectionContainerResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TieringPolicy. +func (t TieringPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + populate(objectMap, "duration", t.Duration) + populate(objectMap, "durationType", t.DurationType) + populate(objectMap, "tieringMode", t.TieringMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionContainerResource. -func (p *ProtectionContainerResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TieringPolicy. +func (t *TieringPolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { - var err error - switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectionContainerClassification(val) + var err error + switch key { + case "duration": + err = unpopulate(val, "Duration", &t.Duration) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "durationType": + err = unpopulate(val, "DurationType", &t.DurationType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "tieringMode": + err = unpopulate(val, "TieringMode", &t.TieringMode) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectionIntentResource. -func (p ProtectionIntentResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TokenInformation. +func (t TokenInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + populate(objectMap, "expiryTimeInUtcTicks", t.ExpiryTimeInUTCTicks) + populate(objectMap, "securityPIN", t.SecurityPIN) + populate(objectMap, "token", t.Token) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionIntentResource. -func (p *ProtectionIntentResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TokenInformation. +func (t *TokenInformation) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectionIntentClassification(val) + case "expiryTimeInUtcTicks": + err = unpopulate(val, "ExpiryTimeInUTCTicks", &t.ExpiryTimeInUTCTicks) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "securityPIN": + err = unpopulate(val, "SecurityPIN", &t.SecurityPIN) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "token": + err = unpopulate(val, "Token", &t.Token) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectionPolicy. -func (p ProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["backupManagementType"] = p.BackupManagementType - populate(objectMap, "protectedItemsCount", p.ProtectedItemsCount) - populate(objectMap, "resourceGuardOperationRequests", p.ResourceGuardOperationRequests) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProtectionPolicyResource. -func (p ProtectionPolicyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TriggerDataMoveRequest. +func (t TriggerDataMoveRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) + populate(objectMap, "correlationId", t.CorrelationID) + populate(objectMap, "dataMoveLevel", t.DataMoveLevel) + populate(objectMap, "pauseGC", t.PauseGC) + populate(objectMap, "sourceContainerArmIds", t.SourceContainerArmIDs) + populate(objectMap, "sourceRegion", t.SourceRegion) + populate(objectMap, "sourceResourceId", t.SourceResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionPolicyResource. -func (p *ProtectionPolicyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerDataMoveRequest. +func (t *TriggerDataMoveRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) + case "correlationId": + err = unpopulate(val, "CorrelationID", &t.CorrelationID) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) + case "dataMoveLevel": + err = unpopulate(val, "DataMoveLevel", &t.DataMoveLevel) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "pauseGC": + err = unpopulate(val, "PauseGC", &t.PauseGC) delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectionPolicyClassification(val) + case "sourceContainerArmIds": + err = unpopulate(val, "SourceContainerArmIDs", &t.SourceContainerArmIDs) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "sourceRegion": + err = unpopulate(val, "SourceRegion", &t.SourceRegion) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &t.SourceResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoveryPointDiskConfiguration. -func (r RecoveryPointDiskConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "excludedDiskList", r.ExcludedDiskList) - populate(objectMap, "includedDiskList", r.IncludedDiskList) - populate(objectMap, "numberOfDisksAttachedToVm", r.NumberOfDisksAttachedToVM) - populate(objectMap, "numberOfDisksIncludedInBackup", r.NumberOfDisksIncludedInBackup) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RecoveryPointResource. -func (r RecoveryPointResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UnlockDeleteRequest. +func (u UnlockDeleteRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", r.ETag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) + populate(objectMap, "resourceGuardOperationRequests", u.ResourceGuardOperationRequests) + populate(objectMap, "resourceToBeDeleted", u.ResourceToBeDeleted) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointResource. -func (r *RecoveryPointResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UnlockDeleteRequest. +func (u *UnlockDeleteRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &r.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - r.Properties, err = unmarshalRecoveryPointClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &u.ResourceGuardOperationRequests) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "resourceToBeDeleted": + err = unpopulate(val, "ResourceToBeDeleted", &u.ResourceToBeDeleted) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoveryPointTierInformation. -func (r RecoveryPointTierInformation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type UnlockDeleteResponse. +func (u UnlockDeleteResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "extendedInfo", r.ExtendedInfo) - populate(objectMap, "status", r.Status) - populate(objectMap, "type", r.Type) + populate(objectMap, "unlockDeleteExpiryTime", u.UnlockDeleteExpiryTime) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type RecoveryPointTierInformationV2. -func (r RecoveryPointTierInformationV2) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedInfo", r.ExtendedInfo) - populate(objectMap, "status", r.Status) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) +// UnmarshalJSON implements the json.Unmarshaller interface for type UnlockDeleteResponse. +func (u *UnlockDeleteResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "unlockDeleteExpiryTime": + err = unpopulate(val, "UnlockDeleteExpiryTime", &u.UnlockDeleteExpiryTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ValidateIaasVMRestoreOperationRequest. +func (v ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", r.ETag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) + objectMap["objectType"] = "ValidateIaasVMRestoreOperationRequest" + populate(objectMap, "restoreRequest", v.RestoreRequest) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBase. -func (r ResourceGuardProxyBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", r.Description) - populate(objectMap, "lastUpdatedTime", r.LastUpdatedTime) - populate(objectMap, "resourceGuardOperationDetails", r.ResourceGuardOperationDetails) - populate(objectMap, "resourceGuardResourceId", r.ResourceGuardResourceID) - return json.Marshal(objectMap) +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateIaasVMRestoreOperationRequest. +func (v *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "objectType": + err = unpopulate(val, "ObjectType", &v.ObjectType) + delete(rawMsg, key) + case "restoreRequest": + v.RestoreRequest, err = unmarshalRestoreRequestClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBaseResource. -func (r ResourceGuardProxyBaseResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ValidateOperationRequest. +func (v ValidateOperationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", r.ETag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) + objectMap["objectType"] = v.ObjectType return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type ResourceHealthDetails. -func (r ResourceHealthDetails) MarshalJSON() ([]byte, error) { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOperationRequest. +func (v *ValidateOperationRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "objectType": + err = unpopulate(val, "ObjectType", &v.ObjectType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateOperationResponse. +func (v ValidateOperationResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "code", r.Code) - populate(objectMap, "message", r.Message) - populate(objectMap, "recommendations", r.Recommendations) - populate(objectMap, "title", r.Title) + populate(objectMap, "validationResults", v.ValidationResults) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type RestoreRequestResource. -func (r RestoreRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", r.ETag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOperationResponse. +func (v *ValidateOperationResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "validationResults": + err = unpopulate(val, "ValidationResults", &v.ValidationResults) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateOperationsResponse. +func (v ValidateOperationsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "validateOperationResponse", v.ValidateOperationResponse) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreRequestResource. -func (r *RestoreRequestResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOperationsResponse. +func (v *ValidateOperationsResponse) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &r.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - r.Properties, err = unmarshalRestoreRequestClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "validateOperationResponse": + err = unpopulate(val, "ValidateOperationResponse", &v.ValidateOperationResponse) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityPinBase. -func (s SecurityPinBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "resourceGuardOperationRequests", s.ResourceGuardOperationRequests) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SimpleRetentionPolicy. -func (s SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ValidateRestoreOperationRequest. +func (v ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "retentionDuration", s.RetentionDuration) - objectMap["retentionPolicyType"] = "SimpleRetentionPolicy" + objectMap["objectType"] = "ValidateRestoreOperationRequest" + populate(objectMap, "restoreRequest", v.RestoreRequest) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleRetentionPolicy. -func (s *SimpleRetentionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateRestoreOperationRequest. +func (v *ValidateRestoreOperationRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "retentionDuration": - err = unpopulate(val, "RetentionDuration", &s.RetentionDuration) + case "objectType": + err = unpopulate(val, "ObjectType", &v.ObjectType) delete(rawMsg, key) - case "retentionPolicyType": - err = unpopulate(val, "RetentionPolicyType", &s.RetentionPolicyType) + case "restoreRequest": + v.RestoreRequest, err = unmarshalRestoreRequestClassification(val) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SimpleSchedulePolicy. -func (s SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VaultJob. +func (v VaultJob) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "hourlySchedule", s.HourlySchedule) - objectMap["schedulePolicyType"] = "SimpleSchedulePolicy" - populate(objectMap, "scheduleRunDays", s.ScheduleRunDays) - populate(objectMap, "scheduleRunFrequency", s.ScheduleRunFrequency) - aux := make([]*timeRFC3339, len(s.ScheduleRunTimes), len(s.ScheduleRunTimes)) - for i := 0; i < len(s.ScheduleRunTimes); i++ { - aux[i] = (*timeRFC3339)(s.ScheduleRunTimes[i]) - } - populate(objectMap, "scheduleRunTimes", aux) - populate(objectMap, "scheduleWeeklyFrequency", s.ScheduleWeeklyFrequency) + populate(objectMap, "actionsInfo", v.ActionsInfo) + populate(objectMap, "activityId", v.ActivityID) + populate(objectMap, "backupManagementType", v.BackupManagementType) + populate(objectMap, "duration", v.Duration) + populateTimeRFC3339(objectMap, "endTime", v.EndTime) + populate(objectMap, "entityFriendlyName", v.EntityFriendlyName) + populate(objectMap, "errorDetails", v.ErrorDetails) + populate(objectMap, "extendedInfo", v.ExtendedInfo) + objectMap["jobType"] = "VaultJob" + populate(objectMap, "operation", v.Operation) + populateTimeRFC3339(objectMap, "startTime", v.StartTime) + populate(objectMap, "status", v.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleSchedulePolicy. -func (s *SimpleSchedulePolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultJob. +func (v *VaultJob) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "hourlySchedule": - err = unpopulate(val, "HourlySchedule", &s.HourlySchedule) + case "actionsInfo": + err = unpopulate(val, "ActionsInfo", &v.ActionsInfo) delete(rawMsg, key) - case "schedulePolicyType": - err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) + case "activityId": + err = unpopulate(val, "ActivityID", &v.ActivityID) delete(rawMsg, key) - case "scheduleRunDays": - err = unpopulate(val, "ScheduleRunDays", &s.ScheduleRunDays) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &v.BackupManagementType) delete(rawMsg, key) - case "scheduleRunFrequency": - err = unpopulate(val, "ScheduleRunFrequency", &s.ScheduleRunFrequency) + case "duration": + err = unpopulate(val, "Duration", &v.Duration) delete(rawMsg, key) - case "scheduleRunTimes": - var aux []*timeRFC3339 - err = unpopulate(val, "ScheduleRunTimes", &aux) - for _, au := range aux { - s.ScheduleRunTimes = append(s.ScheduleRunTimes, (*time.Time)(au)) - } + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) delete(rawMsg, key) - case "scheduleWeeklyFrequency": - err = unpopulate(val, "ScheduleWeeklyFrequency", &s.ScheduleWeeklyFrequency) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &v.EntityFriendlyName) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &v.ErrorDetails) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &v.ExtendedInfo) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &v.JobType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &v.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &v.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SimpleSchedulePolicyV2. -func (s SimpleSchedulePolicyV2) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VaultJobErrorInfo. +func (v VaultJobErrorInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "dailySchedule", s.DailySchedule) - populate(objectMap, "hourlySchedule", s.HourlySchedule) - objectMap["schedulePolicyType"] = "SimpleSchedulePolicyV2" - populate(objectMap, "scheduleRunFrequency", s.ScheduleRunFrequency) - populate(objectMap, "weeklySchedule", s.WeeklySchedule) + populate(objectMap, "errorCode", v.ErrorCode) + populate(objectMap, "errorString", v.ErrorString) + populate(objectMap, "recommendations", v.Recommendations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleSchedulePolicyV2. -func (s *SimpleSchedulePolicyV2) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultJobErrorInfo. +func (v *VaultJobErrorInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "dailySchedule": - err = unpopulate(val, "DailySchedule", &s.DailySchedule) - delete(rawMsg, key) - case "hourlySchedule": - err = unpopulate(val, "HourlySchedule", &s.HourlySchedule) - delete(rawMsg, key) - case "schedulePolicyType": - err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) + case "errorCode": + err = unpopulate(val, "ErrorCode", &v.ErrorCode) delete(rawMsg, key) - case "scheduleRunFrequency": - err = unpopulate(val, "ScheduleRunFrequency", &s.ScheduleRunFrequency) + case "errorString": + err = unpopulate(val, "ErrorString", &v.ErrorString) delete(rawMsg, key) - case "weeklySchedule": - err = unpopulate(val, "WeeklySchedule", &s.WeeklySchedule) + case "recommendations": + err = unpopulate(val, "Recommendations", &v.Recommendations) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SubProtectionPolicy. -func (s SubProtectionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VaultJobExtendedInfo. +func (v VaultJobExtendedInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "policyType", s.PolicyType) - populate(objectMap, "retentionPolicy", s.RetentionPolicy) - populate(objectMap, "schedulePolicy", s.SchedulePolicy) + populate(objectMap, "propertyBag", v.PropertyBag) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SubProtectionPolicy. -func (s *SubProtectionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultJobExtendedInfo. +func (v *VaultJobExtendedInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "policyType": - err = unpopulate(val, "PolicyType", &s.PolicyType) - delete(rawMsg, key) - case "retentionPolicy": - s.RetentionPolicy, err = unmarshalRetentionPolicyClassification(val) - delete(rawMsg, key) - case "schedulePolicy": - s.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &v.PropertyBag) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TriggerDataMoveRequest. -func (t TriggerDataMoveRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VaultStorageConfigOperationResultResponse. +func (v VaultStorageConfigOperationResultResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "correlationId", t.CorrelationID) - populate(objectMap, "dataMoveLevel", t.DataMoveLevel) - populate(objectMap, "pauseGC", t.PauseGC) - populate(objectMap, "sourceContainerArmIds", t.SourceContainerArmIDs) - populate(objectMap, "sourceRegion", t.SourceRegion) - populate(objectMap, "sourceResourceId", t.SourceResourceID) + objectMap["objectType"] = v.ObjectType return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type UnlockDeleteRequest. -func (u UnlockDeleteRequest) MarshalJSON() ([]byte, error) { +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultStorageConfigOperationResultResponse. +func (v *VaultStorageConfigOperationResultResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "objectType": + err = unpopulate(val, "ObjectType", &v.ObjectType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WeeklyRetentionFormat. +func (w WeeklyRetentionFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "resourceGuardOperationRequests", u.ResourceGuardOperationRequests) - populate(objectMap, "resourceToBeDeleted", u.ResourceToBeDeleted) + populate(objectMap, "daysOfTheWeek", w.DaysOfTheWeek) + populate(objectMap, "weeksOfTheMonth", w.WeeksOfTheMonth) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type ValidateIaasVMRestoreOperationRequest. -func (v ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { +// UnmarshalJSON implements the json.Unmarshaller interface for type WeeklyRetentionFormat. +func (w *WeeklyRetentionFormat) UnmarshalJSON(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 "daysOfTheWeek": + err = unpopulate(val, "DaysOfTheWeek", &w.DaysOfTheWeek) + delete(rawMsg, key) + case "weeksOfTheMonth": + err = unpopulate(val, "WeeksOfTheMonth", &w.WeeksOfTheMonth) + 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 WeeklyRetentionSchedule. +func (w WeeklyRetentionSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "ValidateIaasVMRestoreOperationRequest" - populate(objectMap, "restoreRequest", v.RestoreRequest) + populate(objectMap, "daysOfTheWeek", w.DaysOfTheWeek) + populate(objectMap, "retentionDuration", w.RetentionDuration) + aux := make([]*timeRFC3339, len(w.RetentionTimes), len(w.RetentionTimes)) + for i := 0; i < len(w.RetentionTimes); i++ { + aux[i] = (*timeRFC3339)(w.RetentionTimes[i]) + } + populate(objectMap, "retentionTimes", aux) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateIaasVMRestoreOperationRequest. -func (v *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WeeklyRetentionSchedule. +func (w *WeeklyRetentionSchedule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &v.ObjectType) + case "daysOfTheWeek": + err = unpopulate(val, "DaysOfTheWeek", &w.DaysOfTheWeek) delete(rawMsg, key) - case "restoreRequest": - v.RestoreRequest, err = unmarshalRestoreRequestClassification(val) + case "retentionDuration": + err = unpopulate(val, "RetentionDuration", &w.RetentionDuration) + delete(rawMsg, key) + case "retentionTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "RetentionTimes", &aux) + for _, au := range aux { + w.RetentionTimes = append(w.RetentionTimes, (*time.Time)(au)) + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ValidateRestoreOperationRequest. -func (v ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WeeklySchedule. +func (w WeeklySchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - objectMap["objectType"] = "ValidateRestoreOperationRequest" - populate(objectMap, "restoreRequest", v.RestoreRequest) + populate(objectMap, "scheduleRunDays", w.ScheduleRunDays) + aux := make([]*timeRFC3339, len(w.ScheduleRunTimes), len(w.ScheduleRunTimes)) + for i := 0; i < len(w.ScheduleRunTimes); i++ { + aux[i] = (*timeRFC3339)(w.ScheduleRunTimes[i]) + } + populate(objectMap, "scheduleRunTimes", aux) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateRestoreOperationRequest. -func (v *ValidateRestoreOperationRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WeeklySchedule. +func (w *WeeklySchedule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &v.ObjectType) + case "scheduleRunDays": + err = unpopulate(val, "ScheduleRunDays", &w.ScheduleRunDays) delete(rawMsg, key) - case "restoreRequest": - v.RestoreRequest, err = unmarshalRestoreRequestClassification(val) + case "scheduleRunTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "ScheduleRunTimes", &aux) + for _, au := range aux { + w.ScheduleRunTimes = append(w.ScheduleRunTimes, (*time.Time)(au)) + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VaultJob. -func (v VaultJob) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadInquiryDetails. +func (w WorkloadInquiryDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "actionsInfo", v.ActionsInfo) - populate(objectMap, "activityId", v.ActivityID) - populate(objectMap, "backupManagementType", v.BackupManagementType) - populate(objectMap, "duration", v.Duration) - populateTimeRFC3339(objectMap, "endTime", v.EndTime) - populate(objectMap, "entityFriendlyName", v.EntityFriendlyName) - populate(objectMap, "errorDetails", v.ErrorDetails) - populate(objectMap, "extendedInfo", v.ExtendedInfo) - objectMap["jobType"] = "VaultJob" - populate(objectMap, "operation", v.Operation) - populateTimeRFC3339(objectMap, "startTime", v.StartTime) - populate(objectMap, "status", v.Status) + populate(objectMap, "inquiryValidation", w.InquiryValidation) + populate(objectMap, "itemCount", w.ItemCount) + populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultJob. -func (v *VaultJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadInquiryDetails. +func (w *WorkloadInquiryDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { - case "actionsInfo": - err = unpopulate(val, "ActionsInfo", &v.ActionsInfo) - delete(rawMsg, key) - case "activityId": - err = unpopulate(val, "ActivityID", &v.ActivityID) - delete(rawMsg, key) - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &v.BackupManagementType) - delete(rawMsg, key) - case "duration": - err = unpopulate(val, "Duration", &v.Duration) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) - delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &v.EntityFriendlyName) + case "inquiryValidation": + err = unpopulate(val, "InquiryValidation", &w.InquiryValidation) delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &v.ErrorDetails) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &v.ExtendedInfo) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &v.JobType) + case "itemCount": + err = unpopulate(val, "ItemCount", &w.ItemCount) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &v.Operation) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &v.Status) + case "type": + err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VaultJobErrorInfo. -func (v VaultJobErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorCode", v.ErrorCode) - populate(objectMap, "errorString", v.ErrorString) - populate(objectMap, "recommendations", v.Recommendations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VaultJobExtendedInfo. -func (v VaultJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "propertyBag", v.PropertyBag) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WeeklyRetentionFormat. -func (w WeeklyRetentionFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type WorkloadItem. +func (w WorkloadItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "daysOfTheWeek", w.DaysOfTheWeek) - populate(objectMap, "weeksOfTheMonth", w.WeeksOfTheMonth) + populate(objectMap, "backupManagementType", w.BackupManagementType) + populate(objectMap, "friendlyName", w.FriendlyName) + populate(objectMap, "protectionState", w.ProtectionState) + objectMap["workloadItemType"] = w.WorkloadItemType + populate(objectMap, "workloadType", w.WorkloadType) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type WeeklyRetentionSchedule. -func (w WeeklyRetentionSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "daysOfTheWeek", w.DaysOfTheWeek) - populate(objectMap, "retentionDuration", w.RetentionDuration) - aux := make([]*timeRFC3339, len(w.RetentionTimes), len(w.RetentionTimes)) - for i := 0; i < len(w.RetentionTimes); i++ { - aux[i] = (*timeRFC3339)(w.RetentionTimes[i]) +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadItem. +func (w *WorkloadItem) UnmarshalJSON(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) } - populate(objectMap, "retentionTimes", aux) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WeeklySchedule. -func (w WeeklySchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "scheduleRunDays", w.ScheduleRunDays) - aux := make([]*timeRFC3339, len(w.ScheduleRunTimes), len(w.ScheduleRunTimes)) - for i := 0; i < len(w.ScheduleRunTimes); i++ { - aux[i] = (*timeRFC3339)(w.ScheduleRunTimes[i]) + for key, val := range rawMsg { + var err error + switch key { + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &w.BackupManagementType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &w.FriendlyName) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &w.ProtectionState) + delete(rawMsg, key) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &w.WorkloadItemType) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &w.WorkloadType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } } - populate(objectMap, "scheduleRunTimes", aux) - return json.Marshal(objectMap) + return nil } // MarshalJSON implements the json.Marshaller interface for type WorkloadItemResource. @@ -8945,6 +14084,80 @@ func (w *WorkloadItemResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadItemResourceList. +func (w WorkloadItemResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadItemResourceList. +func (w *WorkloadItemResourceList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, 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 WorkloadProtectableItem. +func (w WorkloadProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupManagementType", w.BackupManagementType) + populate(objectMap, "friendlyName", w.FriendlyName) + objectMap["protectableItemType"] = w.ProtectableItemType + populate(objectMap, "protectionState", w.ProtectionState) + populate(objectMap, "workloadType", w.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadProtectableItem. +func (w *WorkloadProtectableItem) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &w.BackupManagementType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &w.FriendlyName) + delete(rawMsg, key) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &w.ProtectableItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &w.ProtectionState) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &w.WorkloadType) + 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 WorkloadProtectableItemResource. func (w WorkloadProtectableItemResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -8996,6 +14209,37 @@ func (w *WorkloadProtectableItemResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadProtectableItemResourceList. +func (w WorkloadProtectableItemResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadProtectableItemResourceList. +func (w *WorkloadProtectableItemResourceList) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, 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 YearlyRetentionSchedule. func (y YearlyRetentionSchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -9012,6 +14256,45 @@ func (y YearlyRetentionSchedule) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type YearlyRetentionSchedule. +func (y *YearlyRetentionSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", y, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "monthsOfYear": + err = unpopulate(val, "MonthsOfYear", &y.MonthsOfYear) + delete(rawMsg, key) + case "retentionDuration": + err = unpopulate(val, "RetentionDuration", &y.RetentionDuration) + delete(rawMsg, key) + case "retentionScheduleDaily": + err = unpopulate(val, "RetentionScheduleDaily", &y.RetentionScheduleDaily) + delete(rawMsg, key) + case "retentionScheduleFormatType": + err = unpopulate(val, "RetentionScheduleFormatType", &y.RetentionScheduleFormatType) + delete(rawMsg, key) + case "retentionScheduleWeekly": + err = unpopulate(val, "RetentionScheduleWeekly", &y.RetentionScheduleWeekly) + delete(rawMsg, key) + case "retentionTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "RetentionTimes", &aux) + for _, au := range aux { + y.RetentionTimes = append(y.RetentionTimes, (*time.Time)(au)) + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", y, err) + } + } + return nil +} + func populate(m map[string]interface{}, k string, v interface{}) { if v == nil { return diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operation_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operation_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go index 0bd94c75acfd..460f9bd0b93b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operation_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewOperationClient(subscriptionID string, credential azcore.TokenCredential // Validate - Validate operation for specified backed up item. This is a synchronous operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - resource validate operation request @@ -96,7 +97,7 @@ func (client *OperationClient) validateCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go similarity index 96% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operations_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go index a931c0fa78ff..4c4e32a1d2df 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup @@ -49,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Returns the list of available operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // 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 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.go similarity index 93% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.go index 2a4d745ec89a..b2e7bb99483a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.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 armrecoveryservicesbackup @@ -156,9 +157,9 @@ func unmarshalProtectableContainerClassification(rawMsg json.RawMessage) (Protec } var b ProtectableContainerClassification switch m["protectableContainerType"] { - case string(ContainerTypeStorageContainer): + case string(ProtectableContainerTypeStorageContainer): b = &AzureStorageProtectableContainer{} - case string(ContainerTypeVMAppContainer): + case string(ProtectableContainerTypeVMAppContainer): b = &AzureVMAppContainerProtectableContainer{} default: b = &ProtectableContainer{} @@ -184,6 +185,8 @@ func unmarshalProtectedItemClassification(rawMsg json.RawMessage) (ProtectedItem b = &AzureVMWorkloadProtectedItem{} case "AzureVmWorkloadSAPAseDatabase": b = &AzureVMWorkloadSAPAseDatabaseProtectedItem{} + case "AzureVmWorkloadSAPHanaDBInstance": + b = &AzureVMWorkloadSAPHanaDBInstanceProtectedItem{} case "AzureVmWorkloadSAPHanaDatabase": b = &AzureVMWorkloadSAPHanaDatabaseProtectedItem{} case "AzureVmWorkloadSQLDatabase": @@ -216,29 +219,29 @@ func unmarshalProtectionContainerClassification(rawMsg json.RawMessage) (Protect } var b ProtectionContainerClassification switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer): + case string(ProtectableContainerTypeAzureBackupServerContainer): b = &AzureBackupServerContainer{} - case string(ContainerTypeAzureSQLContainer): + case string(ProtectableContainerTypeAzureSQLContainer): b = &AzureSQLContainer{} - case string(ContainerTypeAzureWorkloadContainer): + case string(ProtectableContainerTypeAzureWorkloadContainer): b = &AzureWorkloadContainer{} - case string(ContainerTypeDPMContainer): + case string(ProtectableContainerTypeDPMContainer): b = &DpmContainer{} - case string(ContainerTypeGenericContainer): + case string(ProtectableContainerTypeGenericContainer): b = &GenericContainer{} - case string(ContainerTypeIaasVMContainer): + case string(ProtectableContainerTypeIaasVMContainer): b = &IaaSVMContainer{} - case string(ContainerTypeMicrosoftClassicComputeVirtualMachines): + case string(ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines): b = &AzureIaaSClassicComputeVMContainer{} - case string(ContainerTypeMicrosoftComputeVirtualMachines): + case string(ProtectableContainerTypeMicrosoftComputeVirtualMachines): b = &AzureIaaSComputeVMContainer{} - case string(ContainerTypeSQLAGWorkLoadContainer): + case string(ProtectableContainerTypeSQLAGWorkLoadContainer): b = &AzureSQLAGWorkloadContainerProtectionContainer{} - case string(ContainerTypeStorageContainer): + case string(ProtectableContainerTypeStorageContainer): b = &AzureStorageContainer{} - case string(ContainerTypeVMAppContainer): + case string(ProtectableContainerTypeVMAppContainer): b = &AzureVMAppContainerProtectionContainer{} - case string(ContainerTypeWindows): + case string(ProtectableContainerTypeWindows): b = &MabContainer{} default: b = &ProtectionContainer{} @@ -490,8 +493,12 @@ func unmarshalWorkloadProtectableItemClassification(rawMsg json.RawMessage) (Wor b = &AzureIaaSComputeVMProtectableItem{} case "SAPAseSystem": b = &AzureVMWorkloadSAPAseSystemProtectableItem{} + case "SAPHanaDBInstance": + b = &AzureVMWorkloadSAPHanaDBInstance{} case "SAPHanaDatabase": b = &AzureVMWorkloadSAPHanaDatabaseProtectableItem{} + case "SAPHanaHSR": + b = &AzureVMWorkloadSAPHanaHSR{} case "SAPHanaSystem": b = &AzureVMWorkloadSAPHanaSystemProtectableItem{} case "SQLAvailabilityGroupContainer": diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpoint_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpoint_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go index dfff28f1ad05..b7d6b18e73bb 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpoint_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewPrivateEndpointClient(subscriptionID string, credential azcore.TokenCred // GetOperationStatus - Gets the operation status for a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -106,7 +107,7 @@ func (client *PrivateEndpointClient) getOperationStatusCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpointconnection_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go similarity index 96% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpointconnection_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go index c2c4e85ecd73..be7e8f992de4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpointconnection_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore // BeginDelete - Delete Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -76,7 +77,7 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, // Delete - Delete Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, options) if err != nil { @@ -116,7 +117,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +125,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C // Get - Get Private Endpoint Connection. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -169,7 +170,7 @@ func (client *PrivateEndpointConnectionClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +187,7 @@ func (client *PrivateEndpointConnectionClient) getHandleResponse(resp *http.Resp // BeginPut - Approve or Reject Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -207,7 +208,7 @@ func (client *PrivateEndpointConnectionClient) BeginPut(ctx context.Context, vau // Put - Approve or Reject Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview func (client *PrivateEndpointConnectionClient) put(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource, options *PrivateEndpointConnectionClientBeginPutOptions) (*http.Response, error) { req, err := client.putCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -247,7 +248,7 @@ func (client *PrivateEndpointConnectionClient) putCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectablecontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectablecontainers_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go index b26e6ab02a06..34880cc27f2b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectablecontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_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 armrecoveryservicesbackup @@ -55,8 +56,7 @@ func NewProtectableContainersClient(subscriptionID string, credential azcore.Tok } // NewListPager - Lists the containers that can be registered to Recovery Services Vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - ProtectableContainersClientListOptions contains the optional parameters for the ProtectableContainersClient.List @@ -113,7 +113,7 @@ func (client *ProtectableContainersClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go index 20e83697bb71..40796c0894d8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewProtectedItemOperationResultsClient(subscriptionID string, credential az // Get - Fetches the result of any operation on the backup item. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backup item. @@ -116,7 +117,7 @@ func (client *ProtectedItemOperationResultsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationstatuses_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go index 78a841e89ed4..44e6f3b28cff 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_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 armrecoveryservicesbackup @@ -58,7 +59,7 @@ func NewProtectedItemOperationStatusesClient(subscriptionID string, credential a // or failed. You can refer to the OperationStatus enum for all the possible states of // the operation. Some operations create jobs. This method returns the list of jobs associated with the operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backup item. @@ -118,7 +119,7 @@ func (client *ProtectedItemOperationStatusesClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditems_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go index 2169380f4b0d..2e652760f063 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_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 armrecoveryservicesbackup @@ -58,7 +59,7 @@ func NewProtectedItemsClient(subscriptionID string, credential azcore.TokenCrede // is an asynchronous operation. To know the status of the operation, call the // GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backup item. @@ -114,7 +115,7 @@ func (client *ProtectedItemsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -132,7 +133,7 @@ func (client *ProtectedItemsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of // the request, call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backed up item. @@ -186,7 +187,7 @@ func (client *ProtectedItemsClient) deleteCreateRequest(ctx context.Context, vau return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +196,7 @@ func (client *ProtectedItemsClient) deleteCreateRequest(ctx context.Context, vau // Get - Provides the details of the backed up item. This is an asynchronous operation. To know the status of the operation, // call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backed up item. @@ -249,7 +250,7 @@ func (client *ProtectedItemsClient) getCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontaineroperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontaineroperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go index 4d8f3a4418ec..6e65380ec5c1 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontaineroperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewProtectionContainerOperationResultsClient(subscriptionID string, credent // Get - Fetches the result of any operation on the container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the container. @@ -111,7 +112,7 @@ func (client *ProtectionContainerOperationResultsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainerrefreshoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainerrefreshoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go index 66c262c53bd6..b7ef39f69826 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainerrefreshoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewProtectionContainerRefreshOperationResultsClient(subscriptionID string, // Get - Provides the result of the refresh operation triggered by the BeginRefresh operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the container. @@ -106,7 +107,7 @@ func (client *ProtectionContainerRefreshOperationResultsClient) getCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainers_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go index 653d17ff255d..86fe79c40b28 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewProtectionContainersClient(subscriptionID string, credential azcore.Toke // Get - Gets details of the specific container registered to your Recovery Services Vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Name of the fabric where the container belongs. @@ -106,7 +107,7 @@ func (client *ProtectionContainersClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +124,7 @@ func (client *ProtectionContainersClient) getHandleResponse(resp *http.Response) // Inquire - This is an async operation and the results should be tracked using location header or Azure-async-url. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric Name associated with the container. @@ -173,7 +174,7 @@ func (client *ProtectionContainersClient) inquireCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -186,7 +187,7 @@ func (client *ProtectionContainersClient) inquireCreateRequest(ctx context.Conte // asynchronous operation. To know the status of the operation, call // GetRefreshOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated the container. @@ -231,7 +232,7 @@ func (client *ProtectionContainersClient) refreshCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -243,7 +244,7 @@ func (client *ProtectionContainersClient) refreshCreateRequest(ctx context.Conte // Register - Registers the container with Recovery Services vault. This is an asynchronous operation. To track the operation // status, use location header to call get latest status of the operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the container. @@ -294,7 +295,7 @@ func (client *ProtectionContainersClient) registerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -313,7 +314,7 @@ func (client *ProtectionContainersClient) registerHandleResponse(resp *http.Resp // whether the backend service has finished processing the request, call Get Container // Operation Result API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Name of the fabric where the container belongs. @@ -363,7 +364,7 @@ func (client *ProtectionContainersClient) unregisterCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionintent_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionintent_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go index 0ce8720d1d3c..f277cdc5d517 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionintent_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewProtectionIntentClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Create Intent for Enabling backup of an item. This is a synchronous operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backup item. @@ -107,7 +108,7 @@ func (client *ProtectionIntentClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") 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 *ProtectionIntentClient) createOrUpdateHandleResponse(resp *http.Re // Delete - Used to remove intent from an item // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the intent. @@ -173,7 +174,7 @@ func (client *ProtectionIntentClient) deleteCreateRequest(ctx context.Context, v return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -181,7 +182,7 @@ func (client *ProtectionIntentClient) deleteCreateRequest(ctx context.Context, v // Get - Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of the // operation, call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backed up item. @@ -230,7 +231,7 @@ func (client *ProtectionIntentClient) getCreateRequest(ctx context.Context, vaul return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +251,7 @@ func (client *ProtectionIntentClient) getHandleResponse(resp *http.Response) (Pr // 2. VM is already protected // 3. Any VM related configuration passed in properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // azureRegion - Azure region to hit Api // parameters - Enable backup validation request on Virtual Machine // options - ProtectionIntentClientValidateOptions contains the optional parameters for the ProtectionIntentClient.Validate @@ -286,7 +287,7 @@ func (client *ProtectionIntentClient) validateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicies_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go index e9685fc0d0d8..7140f3d17c66 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_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 armrecoveryservicesbackup @@ -57,7 +58,7 @@ func NewProtectionPoliciesClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be // fetched using GetPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // policyName - Backup policy to be created. @@ -103,7 +104,7 @@ func (client *ProtectionPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +122,7 @@ func (client *ProtectionPoliciesClient) createOrUpdateHandleResponse(resp *http. // BeginDelete - Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status // of the operation can be fetched using GetProtectionPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // policyName - Backup policy to be deleted. @@ -142,7 +143,7 @@ func (client *ProtectionPoliciesClient) BeginDelete(ctx context.Context, vaultNa // Delete - Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of // the operation can be fetched using GetProtectionPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview func (client *ProtectionPoliciesClient) deleteOperation(ctx context.Context, vaultName string, resourceGroupName string, policyName string, options *ProtectionPoliciesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, policyName, options) if err != nil { @@ -182,7 +183,7 @@ func (client *ProtectionPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +192,7 @@ func (client *ProtectionPoliciesClient) deleteCreateRequest(ctx context.Context, // Get - Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous operation. // Status of the operation can be fetched using GetPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // policyName - Backup policy information to be fetched. @@ -235,7 +236,7 @@ func (client *ProtectionPoliciesClient) getCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go index d56626c67f6e..044110f4860c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewProtectionPolicyOperationResultsClient(subscriptionID string, credential // Get - Provides the result of an operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // policyName - Backup policy name whose operation's result needs to be fetched. @@ -106,7 +107,7 @@ func (client *ProtectionPolicyOperationResultsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationstatuses_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go index b5ceb9e62c1f..e14c1dac8300 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_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 armrecoveryservicesbackup @@ -58,7 +59,7 @@ func NewProtectionPolicyOperationStatusesClient(subscriptionID string, credentia // or failed. You can refer to the Operation Status enum for all the possible states of // an operation. Some operations create jobs. This method returns the list of jobs associated with operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // policyName - Backup policy name whose operation's status needs to be fetched. @@ -108,7 +109,7 @@ func (client *ProtectionPolicyOperationStatusesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypoints_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypoints_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go index 0cd4c82556d8..0c0903a41eb8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypoints_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_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 armrecoveryservicesbackup @@ -57,7 +58,7 @@ func NewRecoveryPointsClient(subscriptionID string, credential azcore.TokenCrede // Get - Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous operation. // To know the status of the operation, call the GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with backed up item. @@ -116,7 +117,7 @@ func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -132,8 +133,7 @@ func (client *RecoveryPointsClient) getHandleResponse(resp *http.Response) (Reco } // NewListPager - Lists the backup copies for the backed up item. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backed up item. @@ -200,7 +200,7 @@ func (client *RecoveryPointsClient) listCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypointsrecommendedformove_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypointsrecommendedformove_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go index 9bb18d31537e..f780e080dee8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypointsrecommendedformove_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_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 armrecoveryservicesbackup @@ -55,8 +56,7 @@ func NewRecoveryPointsRecommendedForMoveClient(subscriptionID string, credential } // NewListPager - Lists the recovery points recommended for move to another tier -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - List Recovery points Recommended for Move Request @@ -122,7 +122,7 @@ func (client *RecoveryPointsRecommendedForMoveClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxies_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go index af406e23cd6a..d71c748e1c50 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_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 armrecoveryservicesbackup @@ -55,8 +56,7 @@ func NewResourceGuardProxiesClient(subscriptionID string, credential azcore.Toke } // NewGetPager - List the ResourceGuardProxies under vault -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - ResourceGuardProxiesClientGetOptions contains the optional parameters for the ResourceGuardProxiesClient.Get @@ -109,7 +109,7 @@ func (client *ResourceGuardProxiesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxy_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxy_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go index b6485eb7b7b7..4d4dab18023e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxy_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewResourceGuardProxyClient(subscriptionID string, credential azcore.TokenC // Delete - Delete ResourceGuardProxy under vault // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - ResourceGuardProxyClientDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.Delete @@ -100,7 +101,7 @@ func (client *ResourceGuardProxyClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,7 +109,7 @@ func (client *ResourceGuardProxyClient) deleteCreateRequest(ctx context.Context, // Get - Returns ResourceGuardProxy under vault and with the name referenced in request // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - ResourceGuardProxyClientGetOptions contains the optional parameters for the ResourceGuardProxyClient.Get method. @@ -151,7 +152,7 @@ func (client *ResourceGuardProxyClient) getCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -168,7 +169,7 @@ func (client *ResourceGuardProxyClient) getHandleResponse(resp *http.Response) ( // Put - Add or Update ResourceGuardProxy under vault Secures vault critical operations // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - Request body for operation @@ -212,7 +213,7 @@ func (client *ResourceGuardProxyClient) putCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -229,7 +230,7 @@ func (client *ResourceGuardProxyClient) putHandleResponse(resp *http.Response) ( // UnlockDelete - Secures delete ResourceGuardProxy operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - Request body for operation @@ -274,7 +275,7 @@ func (client *ResourceGuardProxyClient) unlockDeleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_response_types.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/response_types.go similarity index 98% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_response_types.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/response_types.go index 503e61ea7611..f94e35c35c69 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_response_types.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armrecoveryservicesbackup @@ -153,6 +154,11 @@ type ClientMoveRecoveryPointResponse struct { // placeholder for future response values } +// DeletedProtectionContainersClientListResponse contains the response from method DeletedProtectionContainersClient.List. +type DeletedProtectionContainersClientListResponse struct { + ProtectionContainerResourceList +} + // ExportJobsOperationResultsClientGetResponse contains the response from method ExportJobsOperationResultsClient.Get. type ExportJobsOperationResultsClientGetResponse struct { OperationResultInfoBaseResource diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_restores_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_restores_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go index 10c057c70838..ecb61d200766 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_restores_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_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 armrecoveryservicesbackup @@ -57,7 +58,7 @@ func NewRestoresClient(subscriptionID string, credential azcore.TokenCredential, // BeginTrigger - Restores the specified backed up data. This is an asynchronous operation. To know the status of this API // call, use GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // fabricName - Fabric name associated with the backed up items. @@ -81,7 +82,7 @@ func (client *RestoresClient) BeginTrigger(ctx context.Context, vaultName string // Trigger - Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, // use GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview func (client *RestoresClient) trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource, options *RestoresClientBeginTriggerOptions) (*http.Response, error) { req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) if err != nil { @@ -133,7 +134,7 @@ func (client *RestoresClient) triggerCreateRequest(ctx context.Context, vaultNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_securitypins_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_securitypins_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go index d73873399d77..1573a52cac0d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_securitypins_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewSecurityPINsClient(subscriptionID string, credential azcore.TokenCredent // Get - Get the security PIN. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // options - SecurityPINsClientGetOptions contains the optional parameters for the SecurityPINsClient.Get method. @@ -95,7 +96,7 @@ func (client *SecurityPINsClient) getCreateRequest(ctx context.Context, vaultNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_time_rfc3339.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/time_rfc3339.go index 53a33e130bf5..b2a5a77d826f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperation_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperation_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go index 265a67434378..85147e7ab30d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperation_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_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 armrecoveryservicesbackup @@ -57,7 +58,7 @@ func NewValidateOperationClient(subscriptionID string, credential azcore.TokenCr // BeginTrigger - Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking // headers which can be tracked using GetValidateOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // parameters - resource validate operation request @@ -78,7 +79,7 @@ func (client *ValidateOperationClient) BeginTrigger(ctx context.Context, vaultNa // Trigger - Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking headers // which can be tracked using GetValidateOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview func (client *ValidateOperationClient) trigger(ctx context.Context, vaultName string, resourceGroupName string, parameters ValidateOperationRequestClassification, options *ValidateOperationClientBeginTriggerOptions) (*http.Response, error) { req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -114,7 +115,7 @@ func (client *ValidateOperationClient) triggerCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go index 49eb69242657..20a32e97ac4f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_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 armrecoveryservicesbackup @@ -56,7 +57,7 @@ func NewValidateOperationResultsClient(subscriptionID string, credential azcore. // Get - Fetches the result of a triggered validate operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // operationID - OperationID which represents the operation whose result needs to be fetched. @@ -101,7 +102,7 @@ func (client *ValidateOperationResultsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go similarity index 97% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationstatuses_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go index f4f2d5bae359..77878e0a3ca4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_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 armrecoveryservicesbackup @@ -58,7 +59,7 @@ func NewValidateOperationStatusesClient(subscriptionID string, credential azcore // refer to the OperationStatus enum for all the possible states of the operation. If // operation has completed, this method returns the list of errors obtained while validating the operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-09-01-preview // vaultName - The name of the recovery services vault. // resourceGroupName - The name of the resource group where the recovery services vault is present. // operationID - OperationID represents the operation whose status needs to be fetched. @@ -103,7 +104,7 @@ func (client *ValidateOperationStatusesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupengines_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupengines_client_test.go deleted file mode 100644 index a8913b89bc28..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupengines_client_test.go +++ /dev/null @@ -1,70 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Dpm/BackupEngines_List.json -func ExampleBackupEnginesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupEnginesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testVault", - "testRG", - &armrecoveryservicesbackup.BackupEnginesClientListOptions{Filter: nil, - SkipToken: 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Dpm/BackupEngines_Get.json -func ExampleBackupEnginesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupEnginesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testVault", - "testRG", - "testServer", - &armrecoveryservicesbackup.BackupEnginesClientGetOptions{Filter: nil, - SkipToken: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupjobs_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupjobs_client_test.go deleted file mode 100644 index 73c24ff03dc7..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupjobs_client_test.go +++ /dev/null @@ -1,45 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ListJobs.json -func ExampleBackupJobsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: nil, - SkipToken: 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationresults_client_test.go deleted file mode 100644 index d5930bab2b7f..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationresults_client_test.go +++ /dev/null @@ -1,38 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ProtectedItem_Delete_OperationResult.json -func ExampleBackupOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Get(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationstatuses_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationstatuses_client_test.go deleted file mode 100644 index 9b795da734e0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationstatuses_client_test.go +++ /dev/null @@ -1,40 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ProtectedItem_Delete_OperationStatus.json -func ExampleBackupOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backuppolicies_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backuppolicies_client_test.go deleted file mode 100644 index 6375ff93710e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backuppolicies_client_test.go +++ /dev/null @@ -1,44 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/BackupPolicies_List.json -func ExampleBackupPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'")}) - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectableitems_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectableitems_client_test.go deleted file mode 100644 index 691ecad8c377..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectableitems_client_test.go +++ /dev/null @@ -1,46 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/BackupProtectableItems_List.json -func ExampleBackupProtectableItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupProtectableItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.BackupProtectableItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'"), - SkipToken: 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotecteditems_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotecteditems_client_test.go deleted file mode 100644 index 31cb83afc857..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotecteditems_client_test.go +++ /dev/null @@ -1,46 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/BackupProtectedItems_List.json -func ExampleBackupProtectedItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.BackupProtectedItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM' and itemType eq 'VM'"), - SkipToken: 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectioncontainers_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectioncontainers_client_test.go deleted file mode 100644 index bdfef7fed858..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectioncontainers_client_test.go +++ /dev/null @@ -1,44 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionContainers_List.json -func ExampleBackupProtectionContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testVault", - "testRg", - &armrecoveryservicesbackup.BackupProtectionContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectionintent_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectionintent_client_test.go deleted file mode 100644 index 20885bbf9225..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectionintent_client_test.go +++ /dev/null @@ -1,45 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/BackupProtectionIntent_List.json -func ExampleBackupProtectionIntentClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myVault", - "myRG", - &armrecoveryservicesbackup.BackupProtectionIntentClientListOptions{Filter: nil, - SkipToken: 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourceencryptionconfigs_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourceencryptionconfigs_client_test.go deleted file mode 100644 index 78b145b43284..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourceencryptionconfigs_client_test.go +++ /dev/null @@ -1,68 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupResourceEncryptionConfig_Get.json -func ExampleBackupResourceEncryptionConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceEncryptionConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rishTestVault", - "rishgrp", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupResourceEncryptionConfig_Put.json -func ExampleBackupResourceEncryptionConfigsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceEncryptionConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "source-rsv", - "test-rg", - armrecoveryservicesbackup.BackupResourceEncryptionConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceEncryptionConfig{ - EncryptionAtRestType: to.Ptr(armrecoveryservicesbackup.EncryptionAtRestTypeCustomerManaged), - InfrastructureEncryptionState: to.Ptr(armrecoveryservicesbackup.InfrastructureEncryptionState("true")), - KeyURI: to.Ptr("https://gktestkv1.vault.azure.net/keys/Test1/ed2e8cdc7f86477ebf0c6462b504a9ed"), - SubscriptionID: to.Ptr("1a2311d9-66f5-47d3-a9fb-7a37da63934b"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcestorageconfigsnoncrr_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcestorageconfigsnoncrr_client_test.go deleted file mode 100644 index e34464adc6b0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcestorageconfigsnoncrr_client_test.go +++ /dev/null @@ -1,94 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupStorageConfig_Get.json -func ExampleBackupResourceStorageConfigsNonCRRClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceStorageConfigsNonCRRClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupStorageConfig_Put.json -func ExampleBackupResourceStorageConfigsNonCRRClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceStorageConfigsNonCRRClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - armrecoveryservicesbackup.BackupResourceConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupStorageConfig_Patch.json -func ExampleBackupResourceStorageConfigsNonCRRClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceStorageConfigsNonCRRClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Patch(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - armrecoveryservicesbackup.BackupResourceConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcevaultconfigs_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcevaultconfigs_client_test.go deleted file mode 100644 index d51f276eef30..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcevaultconfigs_client_test.go +++ /dev/null @@ -1,95 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupResourceVaultConfigs_Get.json -func ExampleBackupResourceVaultConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceVaultConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SwaggerTest", - "SwaggerTestRg", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupResourceVaultConfigs_Patch.json -func ExampleBackupResourceVaultConfigsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceVaultConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "SwaggerTest", - "SwaggerTestRg", - armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupResourceVaultConfigs_Put.json -func ExampleBackupResourceVaultConfigsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceVaultConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, - "SwaggerTest", - "SwaggerTestRg", - armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - SoftDeleteFeatureState: to.Ptr(armrecoveryservicesbackup.SoftDeleteFeatureStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backups_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backups_client_test.go deleted file mode 100644 index d067bf427337..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backups_client_test.go +++ /dev/null @@ -1,46 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/TriggerBackup_Post.json -func ExampleBackupsClient_Trigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Trigger(ctx, - "linuxRsVault", - "linuxRsVaultRG", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;testrg;v1win2012r", - "VM;iaasvmcontainerv2;testrg;v1win2012r", - armrecoveryservicesbackup.BackupRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMBackupRequest{ - ObjectType: to.Ptr("IaasVMBackupRequest"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupstatus_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupstatus_client_test.go deleted file mode 100644 index cbba6c17e7a3..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupstatus_client_test.go +++ /dev/null @@ -1,43 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/GetBackupStatus.json -func ExampleBackupStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupStatusClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "southeastasia", - armrecoveryservicesbackup.BackupStatusRequest{ - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Compute/VirtualMachines/testVm"), - ResourceType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupusagesummaries_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupusagesummaries_client_test.go deleted file mode 100644 index d05bdb545d0a..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupusagesummaries_client_test.go +++ /dev/null @@ -1,46 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json -func ExampleBackupUsageSummariesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupUsageSummariesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testVault", - "testRG", - &armrecoveryservicesbackup.BackupUsageSummariesClientListOptions{Filter: to.Ptr("type eq 'BackupProtectionContainerCountSummary'"), - SkipToken: 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupworkloaditems_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupworkloaditems_client_test.go deleted file mode 100644 index 808e73bea499..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupworkloaditems_client_test.go +++ /dev/null @@ -1,48 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/BackupWorkloadItems_List.json -func ExampleBackupWorkloadItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupWorkloadItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("suchandr-seacan-rsv", - "testRg", - "Azure", - "VMAppContainer;Compute;bvtdtestag;sqlserver-1", - &armrecoveryservicesbackup.BackupWorkloadItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'"), - SkipToken: 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_bmspreparedatamoveoperationresult_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_bmspreparedatamoveoperationresult_client_test.go deleted file mode 100644 index c8b4aaac4770..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_bmspreparedatamoveoperationresult_client_test.go +++ /dev/null @@ -1,40 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json -func ExampleBMSPrepareDataMoveOperationResultClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBMSPrepareDataMoveOperationResultClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "source-rsv", - "sourceRG", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_exportjobsoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_exportjobsoperationresults_client_test.go deleted file mode 100644 index bb169e407f69..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_exportjobsoperationresults_client_test.go +++ /dev/null @@ -1,40 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ExportJobsOperationResult.json -func ExampleExportJobsOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewExportJobsOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_featuresupport_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_featuresupport_client_test.go deleted file mode 100644 index 2e1cfa7f5a30..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_featuresupport_client_test.go +++ /dev/null @@ -1,44 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/BackupFeature_Validate.json -func ExampleFeatureSupportClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewFeatureSupportClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Validate(ctx, - "southeastasia", - &armrecoveryservicesbackup.AzureVMResourceFeatureSupportRequest{ - FeatureType: to.Ptr("AzureVMResourceBackup"), - VMSize: to.Ptr("Basic_A0"), - VMSKU: to.Ptr("Premium"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_itemlevelrecoveryconnections_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_itemlevelrecoveryconnections_client_test.go deleted file mode 100644 index 4fb7dad09dd3..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_itemlevelrecoveryconnections_client_test.go +++ /dev/null @@ -1,75 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/Provision_Ilr.json -func ExampleItemLevelRecoveryConnectionsClient_Provision() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewItemLevelRecoveryConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Provision(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "Azure", - "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "1", - armrecoveryservicesbackup.ILRRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMILRRegistrationRequest{ - ObjectType: to.Ptr("IaasVMILRRegistrationRequest"), - InitiatorName: to.Ptr("Hello World"), - RecoveryPointID: to.Ptr("38823086363464"), - RenewExistingRegistration: to.Ptr(true), - VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pysdktestrg/providers/Microsoft.Compute/virtualMachines/pysdktestv2vm1"), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/Revoke_Ilr.json -func ExampleItemLevelRecoveryConnectionsClient_Revoke() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewItemLevelRecoveryConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Revoke(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "Azure", - "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobcancellations_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobcancellations_client_test.go deleted file mode 100644 index bd364ae498d0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobcancellations_client_test.go +++ /dev/null @@ -1,38 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/TriggerCancelJob.json -func ExampleJobCancellationsClient_Trigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewJobCancellationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Trigger(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobdetails_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobdetails_client_test.go deleted file mode 100644 index 924363803561..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobdetails_client_test.go +++ /dev/null @@ -1,40 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/GetJobDetails.json -func ExampleJobDetailsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewJobDetailsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_joboperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_joboperationresults_client_test.go deleted file mode 100644 index de97051fca05..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_joboperationresults_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/CancelJobOperationResult.json -func ExampleJobOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewJobOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobs_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobs_client_test.go deleted file mode 100644 index 50c7f707a0ff..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobs_client_test.go +++ /dev/null @@ -1,37 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/TriggerExportJobs.json -func ExampleJobsClient_Export() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Export(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.JobsClientExportOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operation_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operation_client_test.go deleted file mode 100644 index 5c148937c83e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operation_client_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json -func ExampleOperationClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewOperationClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Validate(ctx, - "testVault", - "testRG", - &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ - ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), - RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operations_client_test.go deleted file mode 100644 index c88f34bab51e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListOperations.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 := armrecoveryservicesbackup.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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpoint_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpoint_client_test.go deleted file mode 100644 index cffd02abd5ff..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpoint_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json -func ExamplePrivateEndpointClient_GetOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewPrivateEndpointClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOperationStatus(ctx, - "gaallavaultbvtd2msi", - "gaallaRG", - "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", - "0f48183b-0a44-4dca-aec1-bba5daab888a", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpointconnection_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpointconnection_client_test.go deleted file mode 100644 index 4b6d642df182..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpointconnection_client_test.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewPrivateEndpointConnectionClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "gaallavaultbvtd2msi", - "gaallaRG", - "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_BeginPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewPrivateEndpointConnectionClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPut(ctx, - "gaallavaultbvtd2msi", - "gaallaRG", - "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", - armrecoveryservicesbackup.PrivateEndpointConnectionResource{ - Properties: &armrecoveryservicesbackup.PrivateEndpointConnection{ - PrivateEndpoint: &armrecoveryservicesbackup.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3"), - }, - PrivateLinkServiceConnectionState: &armrecoveryservicesbackup.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by johndoe@company.com"), - Status: to.Ptr(armrecoveryservicesbackup.PrivateEndpointConnectionStatusApproved), - }, - ProvisioningState: to.Ptr(armrecoveryservicesbackup.ProvisioningStateSucceeded), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewPrivateEndpointConnectionClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "gaallavaultbvtd2msi", - "gaallaRG", - "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectablecontainers_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectablecontainers_client_test.go deleted file mode 100644 index 0a8fa43b56b0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectablecontainers_client_test.go +++ /dev/null @@ -1,45 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectableContainers_List.json -func ExampleProtectableContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectableContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testvault", - "testRg", - "Azure", - &armrecoveryservicesbackup.ProtectableContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureStorage' and workloadType eq 'AzureFileShare'")}) - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationresults_client_test.go deleted file mode 100644 index abddb7e687f0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationresults_client_test.go +++ /dev/null @@ -1,43 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectedItemOperationResults.json -func ExampleProtectedItemOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationstatuses_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationstatuses_client_test.go deleted file mode 100644 index cd3df261a20f..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationstatuses_client_test.go +++ /dev/null @@ -1,43 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectedItemOperationStatus.json -func ExampleProtectedItemOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditems_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditems_client_test.go deleted file mode 100644 index ea89d9f8a0e4..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditems_client_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json -func ExampleProtectedItemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "Azure", - "iaasvmcontainer;iaasvmcontainer;iaasvm-rg;iaasvm-1", - "vm;iaasvmcontainer;iaasvm-rg;iaasvm-1", - &armrecoveryservicesbackup.ProtectedItemsClientGetOptions{Filter: 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ConfigureProtection.json -func ExampleProtectedItemsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - armrecoveryservicesbackup.ProtectedItemResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - PolicyID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), - ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ProtectedItem_Delete.json -func ExampleProtectedItemsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "Azure", - "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontaineroperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontaineroperationresults_client_test.go deleted file mode 100644 index ac9f878a2c1c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontaineroperationresults_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionContainers_Inquire_Result.json -func ExampleProtectionContainerOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainerOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testvault", - "test-rg", - "Azure", - "VMAppContainer;Compute;testRG;testSQL", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainerrefreshoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainerrefreshoperationresults_client_test.go deleted file mode 100644 index c94e33a84a2a..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainerrefreshoperationresults_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/RefreshContainers_OperationResults.json -func ExampleProtectionContainerRefreshOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainerRefreshOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainers_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainers_client_test.go deleted file mode 100644 index a787d14a6b8d..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainers_client_test.go +++ /dev/null @@ -1,140 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/ProtectionContainers_Get.json -func ExampleProtectionContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testVault", - "testRg", - "Azure", - "VMAppContainer;Compute;testRG;testSQL", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionContainers_Register.json -func ExampleProtectionContainersClient_Register() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Register(ctx, - "swaggertestvault", - "SwaggerTestRg", - "Azure", - "StorageContainer;Storage;SwaggerTestRg;swaggertestsa", - armrecoveryservicesbackup.ProtectionContainerResource{ - Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - ContainerType: to.Ptr(armrecoveryservicesbackup.ContainerTypeStorageContainer), - FriendlyName: to.Ptr("swaggertestsa"), - AcquireStorageAccountLock: to.Ptr(armrecoveryservicesbackup.AcquireStorageAccountLockAcquire), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa"), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/ProtectionContainers_Unregister.json -func ExampleProtectionContainersClient_Unregister() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Unregister(ctx, - "testVault", - "testRg", - "Azure", - "storagecontainer;Storage;test-rg;teststorage", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionContainers_Inquire.json -func ExampleProtectionContainersClient_Inquire() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Inquire(ctx, - "testvault", - "test-rg", - "Azure", - "storagecontainer;Storage;test-rg;teststorage", - &armrecoveryservicesbackup.ProtectionContainersClientInquireOptions{Filter: 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/RefreshContainers.json -func ExampleProtectionContainersClient_Refresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Refresh(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - &armrecoveryservicesbackup.ProtectionContainersClientRefreshOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionintent_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionintent_client_test.go deleted file mode 100644 index 4fafe3ea4390..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionintent_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionIntent_Validate.json -func ExampleProtectionIntentClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Validate(ctx, - "southeastasia", - armrecoveryservicesbackup.PreValidateEnableBackupRequest{ - Properties: to.Ptr(""), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arunaupgrade/providers/Microsoft.Compute/VirtualMachines/upgrade1"), - ResourceType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - VaultID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/Vaults/myVault"), - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/BackupProtectionIntent_Get.json -func ExampleProtectionIntentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myVault", - "myRG", - "Azure", - "249D9B07-D2EF-4202-AA64-65F35418564E", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json -func ExampleProtectionIntentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myVault", - "myRG", - "Azure", - "vm;iaasvmcontainerv2;chamsrgtest;chamscandel", - armrecoveryservicesbackup.ProtectionIntentResource{ - Properties: &armrecoveryservicesbackup.AzureResourceProtectionIntent{ - PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), - ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureResourceItem), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/chamsrgtest/providers/Microsoft.Compute/virtualMachines/chamscandel"), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/BackupProtectionIntent_Delete.json -func ExampleProtectionIntentClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myVault", - "myRG", - "Azure", - "249D9B07-D2EF-4202-AA64-65F35418564E", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicies_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicies_client_test.go deleted file mode 100644 index e735c451d487..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicies_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/V2Policy/v2-Get-Policy.json -func ExampleProtectionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "v2-daily-sample", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json -func ExampleProtectionPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "swaggertestvault", - "SwaggerTestRg", - "dailyPolicy2", - armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - BackupManagementType: to.Ptr("AzureStorage"), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](5), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](60), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](12), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](10), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - TimeZone: to.Ptr("UTC"), - WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeAzureFileShare), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionPolicies_Delete.json -func ExampleProtectionPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "testPolicy1", - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationresults_client_test.go deleted file mode 100644 index 62b203fbc99f..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationresults_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json -func ExampleProtectionPolicyOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPolicyOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "testPolicy1", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationstatuses_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationstatuses_client_test.go deleted file mode 100644 index 641c1dd40f73..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationstatuses_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json -func ExampleProtectionPolicyOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPolicyOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "testPolicy1", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypoints_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypoints_client_test.go deleted file mode 100644 index 12c40ec40f82..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypoints_client_test.go +++ /dev/null @@ -1,72 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/RecoveryPoints_List.json -func ExampleRecoveryPointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewRecoveryPointsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rshvault", - "rshhtestmdvmrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - &armrecoveryservicesbackup.RecoveryPointsClientListOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/RecoveryPoints_Get.json -func ExampleRecoveryPointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewRecoveryPointsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rshvault", - "rshhtestmdvmrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - "26083826328862", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypointsrecommendedformove_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypointsrecommendedformove_client_test.go deleted file mode 100644 index 3b0540d3561e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypointsrecommendedformove_client_test.go +++ /dev/null @@ -1,53 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json -func ExampleRecoveryPointsRecommendedForMoveClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewRecoveryPointsRecommendedForMoveClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rshvault", - "rshhtestmdvmrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - armrecoveryservicesbackup.ListRecoveryPointsRecommendedForMoveRequest{ - ExcludedRPList: []*string{ - to.Ptr("348916168024334"), - to.Ptr("348916168024335")}, - ObjectType: to.Ptr("ListRecoveryPointsRecommendedForMoveRequest"), - }, - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoveryservicesbackupclient_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoveryservicesbackupclient_client_test.go deleted file mode 100644 index 4284dc238163..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoveryservicesbackupclient_client_test.go +++ /dev/null @@ -1,133 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json -func ExampleClient_GetOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOperationStatus(ctx, - "source-rsv", - "sourceRG", - "00000000-0000-0000-0000-000000000000", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupDataMove/PrepareDataMove_Post.json -func ExampleClient_BeginBMSPrepareDataMove() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginBMSPrepareDataMove(ctx, - "source-rsv", - "sourceRG", - armrecoveryservicesbackup.PrepareDataMoveRequest{ - DataMoveLevel: to.Ptr(armrecoveryservicesbackup.DataMoveLevelVault), - TargetRegion: to.Ptr("USGov Virginia"), - TargetResourceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/targetRG/providers/Microsoft.RecoveryServices/vaults/target-rsv"), - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupDataMove/TriggerDataMove_Post.json -func ExampleClient_BeginBMSTriggerDataMove() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginBMSTriggerDataMove(ctx, - "target-rsv", - "targetRG", - armrecoveryservicesbackup.TriggerDataMoveRequest{ - CorrelationID: to.Ptr("MTg2OTcyMzM4NzYyMjc1NDY3Nzs1YmUzYmVmNi04YjJiLTRhOTItOTllYi01NTM0MDllYjk2NjE="), - DataMoveLevel: to.Ptr(armrecoveryservicesbackup.DataMoveLevelVault), - SourceRegion: to.Ptr("USGov Iowa"), - SourceResourceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv"), - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/TriggerRecoveryPointMove_Post.json -func ExampleClient_BeginMoveRecoveryPoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMoveRecoveryPoint(ctx, - "testVault", - "netsdktestrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "348916168024334", - armrecoveryservicesbackup.MoveRPAcrossTiersRequest{ - ObjectType: to.Ptr("MoveRPAcrossTiersRequest"), - SourceTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - TargetTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - }, - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxies_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxies_client_test.go deleted file mode 100644 index d77452b45754..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxies_client_test.go +++ /dev/null @@ -1,43 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json -func ExampleResourceGuardProxiesClient_NewGetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxiesClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetPager("sampleVault", - "SampleResourceGroup", - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxy_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxy_client_test.go deleted file mode 100644 index 181bb797271c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxy_client_test.go +++ /dev/null @@ -1,118 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json -func ExampleResourceGuardProxyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sampleVault", - "SampleResourceGroup", - "swaggerExample", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json -func ExampleResourceGuardProxyClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, - "sampleVault", - "SampleResourceGroup", - "swaggerExample", - armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ - Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ - ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json -func ExampleResourceGuardProxyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sampleVault", - "SampleResourceGroup", - "swaggerExample", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json -func ExampleResourceGuardProxyClient_UnlockDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UnlockDelete(ctx, - "sampleVault", - "SampleResourceGroup", - "swaggerExample", - armrecoveryservicesbackup.UnlockDeleteRequest{ - ResourceGuardOperationRequests: []*string{ - to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteProtectedItemRequests/default")}, - ResourceToBeDeleted: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/gaallarg/providers/Microsoft.RecoveryServices/vaults/MercuryCrrVault/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;crrtestrg;crrtestvm/protectedItems/SQLDataBase;mssqlserver;testdb"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_restores_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_restores_client_test.go deleted file mode 100644 index c49694252209..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_restores_client_test.go +++ /dev/null @@ -1,65 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json -func ExampleRestoresClient_BeginTrigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewRestoresClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTrigger(ctx, - "testVault", - "netsdktestrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "348916168024334", - armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - }, - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_securitypins_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_securitypins_client_test.go deleted file mode 100644 index 9b9f1a01966c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_securitypins_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupSecurityPin_Get.json -func ExampleSecurityPINsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewSecurityPINsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SwaggerTest", - "SwaggerTestRg", - &armrecoveryservicesbackup.SecurityPINsClientGetOptions{Parameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperation_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperation_client_test.go deleted file mode 100644 index 100653b71c3a..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperation_client_test.go +++ /dev/null @@ -1,62 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json -func ExampleValidateOperationClient_BeginTrigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewValidateOperationClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTrigger(ctx, - "testVault", - "testRG", - &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ - ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), - RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - }, - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationresults_client_test.go deleted file mode 100644 index e20de3400e83..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationresults_client_test.go +++ /dev/null @@ -1,40 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ValidateOperationResults.json -func ExampleValidateOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewValidateOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationstatuses_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationstatuses_client_test.go deleted file mode 100644 index e629c96c6795..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationstatuses_client_test.go +++ /dev/null @@ -1,40 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ValidateOperationStatus.json -func ExampleValidateOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewValidateOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -}